From: Daniel Vetter <daniel@ffwll.ch>
To: Philippe CORNU <philippe.cornu@st.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
David Airlie <airlied@linux.ie>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Yannick FERTRE <yannick.fertre@st.com>,
Daniel Vetter <daniel.vetter@intel.com>,
Vincent ABRIOU <vincent.abriou@st.com>
Subject: Re: [PATCH] drm: clarify adjusted_mode for a bridge connected to a crtc
Date: Mon, 9 Apr 2018 09:56:32 +0200 [thread overview]
Message-ID: <20180409075632.GC31310@phenom.ffwll.local> (raw)
In-Reply-To: <a8c52302-2e70-ab55-54c0-dfde8b42e430@st.com>
On Fri, Apr 06, 2018 at 03:28:27PM +0000, Philippe CORNU wrote:
> Hi Laurent,
>
> On 04/06/2018 04:53 PM, Laurent Pinchart wrote:
> > Hi Philippe,
> >
> > Thank you for the patch.
> >
> > On Monday, 26 February 2018 14:16:04 EEST Philippe Cornu wrote:
> >> This patch clarifies the adjusted_mode documentation
> >> for a bridge directly connected to a crtc.
> >>
> >> Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
> >> ---
> >> This patch is linked to the discussion https://lkml.org/lkml/2018/1/25/367
> >>
> >> include/drm/drm_bridge.h | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> >> index 3270fec46979..b5f3c070467c 100644
> >> --- a/include/drm/drm_bridge.h
> >> +++ b/include/drm/drm_bridge.h
> >> @@ -177,7 +177,8 @@ struct drm_bridge_funcs {
> >> * pipeline has been called already. If the bridge is the first element
> >> * then this would be &drm_encoder_helper_funcs.mode_set. The display
> >> * pipe (i.e. clocks and timing signals) is off when this function is
> >> - * called.
> >> + * called. If the bridge is connected to the crtc, the adjusted_mode
> >> + * parameter is the one defined in &drm_crtc_state.adjusted_mode.
> >
> > Unless I'm mistaken this will always be the mode stored in
> > &drm_crtc_state.adjusted_mode (at least for atomic drivers), regardless of
> > whether the bridge is the first in the chain (connected to the CRTC) or not.
> > What is important to document is that we have a single adjusted_mode for the
> > whole chain of bridges, and that it corresponds to the mode output by the CRTC
> > for the first bridge. Bridges further in the chain can look at that mode,
> > although there will probably be nothing of interest to them there.
> >
> > How about the following text ?
> >
> > /**
> > * @mode_set:
> > *
> > * This callback should set the given mode on the bridge. It is called
> > * after the @mode_set callback for the preceding element in the display
> > * pipeline has been called already. If the bridge is the first element
> > * then this would be &drm_encoder_helper_funcs.mode_set. The display
> > * pipe (i.e. clocks and timing signals) is off when this function is
> > * called.
> > *
> > * The adjusted_mode parameter corresponds to the mode output by the CRTC
> > * for the first bridge in the chain. It can be different from the mode
> > * parameter that contains the desired mode for the connector at the end
> > * of the bridges chain, for instance when the first bridge in the chain
> > * performs scaling. The adjusted mode is mostly useful for the first
> > * bridge in the chain and is likely irrelevant for the other bridges.
> > *
> > * For atomic drivers the adjusted_mode is the mode stored in
> > * &drm_crtc_state.adjusted_mode.
> > *
> > * NOTE:
> > *
> > * If a need arises to store and access modes adjusted for other locations
> > * than the connection between the CRTC and the first bridge, the DRM
> > * framework will have to be extended with DRM bridge states.
> > */
> >
> > Then I think we should also update the documentation of
> > drm_crtc_state.adjusted_mode accordingly:
> >
> > /*
> > * @adjusted_mode:
> > *
> > * Internal display timings which can be used by the driver to handle
> > * differences between the mode requested by userspace in @mode and what
> > * is actually programmed into the hardware.
> > *
> > * For drivers using drm_bridge, this store the hardware display timings
> > * used between the CRTC and the first bridge. For other drivers, the
> > * meaning of the adjusted_mode field is purely driver implementation
> > * defined information, and will usually be used to store the hardware
> > * display timings used between the CRTC and encoder blocks.
> > */
> >
>
> Your proposal is very clear and understandable. I will make a new patch
> version based on it.
Just to avoid confusion: Needs to be a fully new patch on top of latest
drm-misc-next, since no rebasing in a group maintained tree.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
prev parent reply other threads:[~2018-04-09 7:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-26 12:16 Philippe Cornu
2018-03-27 15:51 ` Daniel Vetter
2018-03-29 7:35 ` Philippe CORNU
2018-03-29 7:39 ` Daniel Vetter
2018-04-05 15:15 ` Philippe CORNU
2018-04-06 14:53 ` Laurent Pinchart
2018-04-06 15:28 ` Philippe CORNU
2018-04-09 7:56 ` Daniel Vetter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180409075632.GC31310@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=philippe.cornu@st.com \
--cc=vincent.abriou@st.com \
--cc=yannick.fertre@st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome