[PATCH RFC] drm/atomic: Fall back to legacy call back in *_connector_dpms()

Daniel Vetter daniel at ffwll.ch
Fri Feb 12 15:34:56 UTC 2016


On Fri, Feb 12, 2016 at 05:17:19PM +0200, Jyri Sarha wrote:
> Fall back to legacy drm_helper_connector_dpms() call back in
> drm_atomic_helper_connector_dpms() if DRIVER_ATOMIC feature is not
> present.
> 
> Calling drm_atomic_helper_connector_dpms() from non atomic driver
> causes undefined behavior. This is a problem with componentized
> encoder/connector drivers that may be bound to both atomic and
> non atomic drivers.
> 
> Signed-off-by: Jyri Sarha <jsarha at ti.com>
> ---
> This is just an alternative to this:
> https://lists.freedesktop.org/archives/dri-devel/2016-January/098867.html

I like the linked patch much better, since non-atomic really should die.
Inflicting non-atomic on atomic helpers is bad imo, so nack from me on
this patch here.
-Daniel
> 
> Either one of the patches should be taken for Beaglebone-black, or any
> other non atomic driver using tda998x, to work.
> 
>  drivers/gpu/drm/drm_atomic_helper.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 57cccd6..6ad0303 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -2344,6 +2344,9 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
>  	bool active = false;
>  	int old_mode = connector->dpms;
>  
> +	if (!drm_core_check_feature(connector->dev, DRIVER_ATOMIC))
> +		return drm_helper_connector_dpms(connector, mode);
> +
>  	if (mode != DRM_MODE_DPMS_ON)
>  		mode = DRM_MODE_DPMS_OFF;
>  
> -- 
> 1.9.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list