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

Daniel Stone daniel at fooishbar.org
Tue Mar 16 23:46:38 UTC 2021


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210316/f9e16f09/attachment-0001.htm>


More information about the dri-devel mailing list