[Intel-gfx] [PATCH] drm/atomic: Add the crtc to affected crtc only if uapi.enable = true

Navare, Manasi manasi.d.navare at intel.com
Wed Mar 17 21:23:49 UTC 2021


On Tue, Mar 16, 2021 at 11:46:38PM +0000, Daniel Stone wrote:
> On Tue, 16 Mar 2021 at 21:35, Daniel Vetter <daniel at ffwll.ch> wrote:
> 
> > On Tue, Mar 9, 2021 at 10:14 AM Pekka Paalanen <ppaalanen at gmail.com>
> > wrote:
> > > On Mon, 8 Mar 2021 16:52:58 -0800
> > > "Navare, Manasi" <manasi.d.navare at intel.com> wrote:
> > > > Hmm well after the actual real commit, since the second crtc is stolen
> > > > even though it is not being used for the display output, it is
> > > > used for joiner so the uapi.enable will be true after the real commit.
> > > >
> > > > so actually the assertion would fail in this case.
> > > >
> > > > @Ville @Danvet any suggestions here in that case?
> >
> > That is very bad. We can't frob uapi state like that. I think that
> > calls for even more checks to make sure kms drivers who try to play
> > clever games don't get it wrong, so we probably need to check uapi
> > enable and active state in another mask before/after ->atomic_check
> > too. Or something like that.
> >
> 
> Yeah. We can _never_ generate externally-visible completion events. We can
> later fail to enable the stolen CRTC - because trying to enable new things
> can fail for any reason whatsoever - but we can't generate spurious
> completion events, as doing so falls into the uncanny valley.
> 
> If the kernel is doing clever things behind userspace's back - such as
> stealing planes or CRTCs - then userspace can never know about it, apart
> from failing to enable those resources later. The kernel can either never
> do anything clever (and make userspace bind them both together), or be
> extremely clever (by hiding the entire details from userspace), but it
> cannot choose the halfway house of doing clever things behind userspace's
> back (such as stealing new CRTCs) whilst also exposing all those details to
> userspace (such as delivering spurious completion events for resources
> userspace never requested to be programmed).
> 
> Cheers,
> Daniel

Yes I agree, in this case there will not be any completion events associated with
the stolen slave CRTC since that does not get used for the output.
The completion events will only occur on the bigjoiner master crtc.

But I guess like Danvet suggested we need a separate mask for keeping track of active and
enabled crtcs before and after atomic check. But need to look at how this will fix
the affected crtc not matching warning.

Manasi

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



More information about the Intel-gfx mailing list