[PATCH v1 1/1] drm: bridge: Mark mode_fixup deprecated

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Jul 14 08:45:55 UTC 2021


Hi Sam,

Thank you for the patch.

On Tue, Jul 13, 2021 at 09:32:57PM +0200, Sam Ravnborg wrote:
> Make it obvious that mode_fixup is deprecated and new drivers shall use
> atomic_check.

Could you also mark drm_bridge_chain_mode_fixup() as deprecated ?

Regarding usage of .atomic_check(), while I agree that's the way to go,
we have more work to do. .mode_fixup() was created a long time ago, when
we were supposed to have a single bridge at the output of the CRTC. The
bridge could then instruct the CRTC to output a different mode than what
the display requires. Now that we have support for multiple bridges,
it's not as straightforward, and we've so far just pretended to ignore
the problem. The .mode_fixup() operation is used and abused, and just
telling people to use .atomic_check() will likely make things worse as
that operation has access to the full atomic commit and can alter the
mode of pretty much anything. We need to define clear semantics for
.atomic_check() in bridges.

> Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
> Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Cc: Andrzej Hajda <a.hajda at samsung.com>
> Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Cc: Maxime Ripard <mripard at kernel.org>
> Cc: Thomas Zimmermann <tzimmermann at suse.de>
> Cc: David Airlie <airlied at linux.ie>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> ---
>  include/drm/drm_bridge.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index 46bdfa48c413..668f14234459 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -136,6 +136,9 @@ struct drm_bridge_funcs {
>  	 *
>  	 * NOTE:
>  	 *
> +	 * This is deprecated, do not use!
> +	 * New drivers shall use &drm_bridge_funcs.atomic_check.
> +	 *
>  	 * This function is called in the check phase of atomic modesets, which
>  	 * can be aborted for any reason (including on userspace's request to
>  	 * just check whether a configuration would be possible). Drivers MUST

-- 
Regards,

Laurent Pinchart


More information about the dri-devel mailing list