All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: Daniel Vetter <daniel.vetter@ffwll.ch>,
	DRI Development <dri-devel@lists.freedesktop.org>
Cc: Jose Abreu <Jose.Abreu@synopsys.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH 1/2] drm/doc: Document adjusted/request modes a bit better
Date: Tue, 16 May 2017 03:38:58 +0100	[thread overview]
Message-ID: <579860e9-0173-5d1a-a3f7-be812b59df04@synopsys.com> (raw)
In-Reply-To: <20170515091136.26307-1-daniel.vetter@ffwll.ch>

Hi Daniel,


On 15-05-2017 10:11, Daniel Vetter wrote:
> Laurent started a massive discussion on IRC about this. Let's try to
> document common usage a bit better.
>
> v2: Cross-links+typos.
>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Jose Abreu <Jose.Abreu@synopsys.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Reviewed-by: Jose Abreu <joabreu@synopsys.com>

Best regards,
Jose Miguel Abreu

> ---
>  include/drm/drm_bridge.h                 |  2 +-
>  include/drm/drm_crtc.h                   | 28 +++++++++++++++++++++++++---
>  include/drm/drm_modeset_helper_vtables.h |  6 ++++--
>  3 files changed, 30 insertions(+), 6 deletions(-)
>
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index f694de756ecf..f3ad38d0d621 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -91,7 +91,7 @@ struct drm_bridge_funcs {
>  	 * the display chain, either the final &drm_connector or the next
>  	 * &drm_bridge. The parameter adjusted_mode is the input mode the bridge
>  	 * requires. It can be modified by this callback and does not need to
> -	 * match mode.
> +	 * match mode. See also &drm_crtc_state.adjusted_mode for more details.
>  	 *
>  	 * This is the only hook that allows a bridge to reject a modeset. If
>  	 * this function passes all other callbacks must succeed for this
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 06236b002c22..5f5d53973ca5 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -90,8 +90,6 @@ struct drm_plane_helper_funcs;
>   * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
>   * @connector_mask: bitmask of (1 << drm_connector_index(connector)) of attached connectors
>   * @encoder_mask: bitmask of (1 << drm_encoder_index(encoder)) of attached encoders
> - * @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings
> - * @mode: current mode timings
>   * @mode_blob: &drm_property_blob for @mode
>   * @state: backpointer to global drm_atomic_state
>   *
> @@ -131,9 +129,33 @@ struct drm_crtc_state {
>  	u32 connector_mask;
>  	u32 encoder_mask;
>  
> -	/* adjusted_mode: for use by helpers and drivers */
> +	/**
> +	 * @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. It is purely driver
> +	 * implementation defined what exactly this adjusted mode means. Usually
> +	 * it is used to store the hardware display timings used between the
> +	 * CRTC and encoder blocks.
> +	 */
>  	struct drm_display_mode adjusted_mode;
>  
> +	/**
> +	 * @mode:
> +	 *
> +	 * Display timings requested by userspace. The driver should try to
> +	 * match the refresh rate as close as possible (but note that it's
> +	 * undefined what exactly is close enough, e.g. some of the HDMI modes
> +	 * only differ in less than 1% of the refresh rate). The active width
> +	 * and height as observed by userspace for positioning planes must match
> +	 * exactly.
> +	 *
> +	 * For external connectors where the sink isn't fixed (like with a
> +	 * built-in panel), this mode here should match the physical mode on the
> +	 * wire to the last details (i.e. including sync polarities and
> +	 * everything).
> +	 */
>  	struct drm_display_mode mode;
>  
>  	/* blob property to expose current mode to atomic userspace */
> diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
> index 91d071ff1232..c72fca544a41 100644
> --- a/include/drm/drm_modeset_helper_vtables.h
> +++ b/include/drm/drm_modeset_helper_vtables.h
> @@ -138,7 +138,8 @@ struct drm_crtc_helper_funcs {
>  	 * encoders need to be fed with. Note that this is the inverse semantics
>  	 * of the meaning for the &drm_encoder and &drm_bridge_funcs.mode_fixup
>  	 * vfunc. If the CRTC cannot support the requested conversion from mode
> -	 * to adjusted_mode it should reject the modeset.
> +	 * to adjusted_mode it should reject the modeset. See also
> +	 * &drm_crtc_state.adjusted_mode for more details.
>  	 *
>  	 * This function is used by both legacy CRTC helpers and atomic helpers.
>  	 * With atomic helpers it is optional.
> @@ -510,7 +511,8 @@ struct drm_encoder_helper_funcs {
>  	 * mode is the display mode that should be fed to the next element in
>  	 * the display chain, either the final &drm_connector or a &drm_bridge.
>  	 * The parameter adjusted_mode is the input mode the encoder requires. It
> -	 * can be modified by this callback and does not need to match mode.
> +	 * can be modified by this callback and does not need to match mode. See
> +	 * also &drm_crtc_state.adjusted_mode for more details.
>  	 *
>  	 * This function is used by both legacy CRTC helpers and atomic helpers.
>  	 * This hook is optional.

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-05-16  2:39 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  9:05 [PATCH v3 0/6] Introduce new mode validation callbacks Jose Abreu
2017-05-11  9:05 ` [PATCH v3 1/6] drm: Add crtc/encoder/bridge->mode_valid() callbacks Jose Abreu
2017-05-12  7:00   ` Daniel Vetter
2017-05-12  7:00     ` Daniel Vetter
2017-05-12  7:31   ` [PATCH] " Daniel Vetter
2017-05-12 11:29     ` Laurent Pinchart
2017-05-15  6:50       ` Daniel Vetter
2017-05-12 12:37     ` Andrzej Hajda
2017-05-15  6:56       ` Daniel Vetter
2017-05-15  8:10         ` Andrzej Hajda
2017-05-15  8:14           ` Daniel Vetter
2017-05-12 15:59     ` Jose Abreu
2017-05-15  9:11     ` [PATCH 1/2] drm/doc: Document adjusted/request modes a bit better Daniel Vetter
2017-05-15  9:11       ` [PATCH 2/2] drm/doc: Clarify mode_fixup vs. atomic_check a bit more Daniel Vetter
2017-05-16  2:41         ` Jose Abreu
2017-05-16 13:14         ` Andrzej Hajda
2017-05-16  2:38       ` Jose Abreu [this message]
2017-05-16 13:17       ` [PATCH 1/2] drm/doc: Document adjusted/request modes a bit better Andrzej Hajda
2017-05-15  9:33     ` [PATCH] drm: Add crtc/encoder/bridge->mode_valid() callbacks Daniel Vetter
2017-05-16 13:15       ` Andrzej Hajda
2017-05-11  9:05 ` [PATCH v3 2/6] drm: Add drm_{crtc/encoder/connector}_mode_valid() Jose Abreu
2017-05-15  8:27   ` Andrzej Hajda
2017-05-15  8:27     ` Andrzej Hajda
2017-05-11  9:05 ` [PATCH v3 3/6] drm: Introduce drm_bridge_mode_valid() Jose Abreu
2017-05-11  9:06 ` [PATCH v3 4/6] drm: Use new mode_valid() helpers in connector probe helper Jose Abreu
2017-05-15  8:39   ` Andrzej Hajda
2017-05-15  8:39     ` Andrzej Hajda
2017-05-15  9:30     ` Daniel Vetter
2017-05-15  9:30       ` Daniel Vetter
2017-05-15  9:51       ` Andrzej Hajda
2017-05-15  9:51         ` Andrzej Hajda
2017-05-11  9:06 ` [PATCH v3 5/6] drm: Use mode_valid() in atomic modeset Jose Abreu
2017-05-15  8:45   ` Andrzej Hajda
2017-05-11  9:06 ` [PATCH v3 6/6] drm: arc: Use crtc->mode_valid() callback Jose Abreu
2017-05-15  8:53   ` Daniel Vetter
2017-05-15  8:53     ` Daniel Vetter
2017-05-15 15:52     ` Daniel Vetter
2017-05-15 15:52       ` Daniel Vetter
2017-05-15 23:55       ` Jose Abreu
2017-05-15 23:55         ` Jose Abreu
2017-05-15  8:54   ` Andrzej Hajda
2017-05-15  8:54     ` Andrzej Hajda
2017-05-12  7:32 ` [PATCH v3 0/6] Introduce new mode validation callbacks Daniel Vetter
2017-05-12  7:32   ` Daniel Vetter
2017-05-12 13:37   ` Andrzej Hajda
2017-05-12 13:37     ` Andrzej Hajda

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=579860e9-0173-5d1a-a3f7-be812b59df04@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.