[Intel-gfx] [PATCH] drm/atomic: refuse changing CRTC for planes directly

Daniel Stone daniels at collabora.com
Wed Aug 26 09:33:16 PDT 2015


On Wed, 2015-08-26 at 18:53 +0300, Ville Syrjälä wrote:
> On Wed, Aug 26, 2015 at 05:41:23PM +0200, Daniel Vetter wrote:
> > Very strictly speaking this is possible if you have special hw and
> > genlocked CRTCs. In general switching a plane between two active
> > CRTC
> > just won't work so well and is probably not tested at all. Just
> > forbid
> > it.
> > 
> > I've put this into the core since I really couldn't come up with a
> > case where we don't want to enforce that. But if that ever happens
> > it
> > would be easy to move this check into helpers.
> > 
> > v2: don't bother with complexity and just outright disallow plane
> > switching without the intermediate OFF state. Simplifies drivers,
> > we
> > don't have any hw that could do it anyway and current atomic
> > userspace
> > (weston) works like this already anyway.
> > 
> > Cc: Thierry Reding <thierry.reding at gmail.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> > Cc: Daniel Stone <daniels at collabora.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> > ---
> >  drivers/gpu/drm/drm_atomic.c | 22 ++++++++++++++++++++++
> >  1 file changed, 22 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_atomic.c
> > b/drivers/gpu/drm/drm_atomic.c
> > index 434915448ea0..f27aae3fa765 100644
> > --- a/drivers/gpu/drm/drm_atomic.c
> > +++ b/drivers/gpu/drm/drm_atomic.c
> > @@ -663,6 +663,22 @@ drm_atomic_plane_get_property(struct
> > drm_plane *plane,
> >  	return 0;
> >  }
> >  
> > +static bool
> > +plane_switching(struct drm_atomic_state *state,
> > +		struct drm_plane *plane,
> > +		struct drm_plane_state *plane_state)
> 
> plane_switching_crtc()?

With Ville's shed colour:
Acked-by: Daniel Stone <daniels at collabora.com>

As this won't work in the general case, I'd prefer to see a hint to
userspace that two CRTCs are genlocked before we enable it and people
start to rely on it.

Cheers,
Daniel


More information about the dri-devel mailing list