All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Stone <daniel@fooishbar.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Daniel Stone <daniels@collabora.com>
Subject: Re: [Intel-gfx] [PATCH] drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
Date: Tue, 16 Mar 2021 23:46:38 +0000	[thread overview]
Message-ID: <CAPj87rOtWpBW3u7M+ePPQqT_RKEmCzDA8u4gRfT-HrcRaR7_zg@mail.gmail.com> (raw)
In-Reply-To: <CAKMK7uEak_2YNDZpyho5bBhhYCvoXh6MoPNL6FmV9sU8oELGPA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1829 bytes --]

On Tue, 16 Mar 2021 at 21:35, Daniel Vetter <daniel@ffwll.ch> wrote:

> On Tue, Mar 9, 2021 at 10:14 AM Pekka Paalanen <ppaalanen@gmail.com>
> wrote:
> > On Mon, 8 Mar 2021 16:52:58 -0800
> > "Navare, Manasi" <manasi.d.navare@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

[-- Attachment #1.2: Type: text/html, Size: 2441 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

WARNING: multiple messages have this Message-ID (diff)
From: Daniel Stone <daniel@fooishbar.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Pekka Paalanen <ppaalanen@gmail.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Daniel Stone <daniels@collabora.com>
Subject: Re: [Intel-gfx] [PATCH] drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
Date: Tue, 16 Mar 2021 23:46:38 +0000	[thread overview]
Message-ID: <CAPj87rOtWpBW3u7M+ePPQqT_RKEmCzDA8u4gRfT-HrcRaR7_zg@mail.gmail.com> (raw)
In-Reply-To: <CAKMK7uEak_2YNDZpyho5bBhhYCvoXh6MoPNL6FmV9sU8oELGPA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1829 bytes --]

On Tue, 16 Mar 2021 at 21:35, Daniel Vetter <daniel@ffwll.ch> wrote:

> On Tue, Mar 9, 2021 at 10:14 AM Pekka Paalanen <ppaalanen@gmail.com>
> wrote:
> > On Mon, 8 Mar 2021 16:52:58 -0800
> > "Navare, Manasi" <manasi.d.navare@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

[-- Attachment #1.2: Type: text/html, Size: 2441 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-03-16 23:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 20:41 [PATCH] drm/atomic: Add the crtc to affected crtc only if uapi.enable = true Manasi Navare
2021-03-02 20:41 ` [Intel-gfx] " Manasi Navare
2021-03-03  8:47 ` Pekka Paalanen
2021-03-03  8:47   ` [Intel-gfx] " Pekka Paalanen
2021-03-03 20:44   ` Navare, Manasi
2021-03-03 20:44     ` [Intel-gfx] " Navare, Manasi
2021-03-04  8:42     ` Pekka Paalanen
2021-03-04  8:42       ` [Intel-gfx] " Pekka Paalanen
2021-03-09  0:52       ` Navare, Manasi
2021-03-09  0:52         ` [Intel-gfx] " Navare, Manasi
2021-03-09  9:13         ` Pekka Paalanen
2021-03-09  9:13           ` [Intel-gfx] " Pekka Paalanen
2021-03-16 21:35           ` Daniel Vetter
2021-03-16 21:35             ` [Intel-gfx] " Daniel Vetter
2021-03-16 23:46             ` Daniel Stone [this message]
2021-03-16 23:46               ` Daniel Stone
2021-03-17 21:23               ` Navare, Manasi
2021-03-17 21:23                 ` Navare, Manasi
2021-03-18 23:01             ` Navare, Manasi
2021-03-18 23:01               ` [Intel-gfx] " Navare, Manasi
2021-03-19 14:56               ` Ville Syrjälä
2021-03-19 14:56                 ` [Intel-gfx] " Ville Syrjälä
2021-03-19 20:54                 ` Navare, Manasi
2021-03-19 20:54                   ` [Intel-gfx] " Navare, Manasi
2021-03-19 21:12                   ` Ville Syrjälä
2021-03-19 21:12                     ` [Intel-gfx] " Ville Syrjälä
2021-03-19 21:26                     ` Navare, Manasi
2021-03-19 21:26                       ` [Intel-gfx] " Navare, Manasi
2021-03-19 21:27                       ` Ville Syrjälä
2021-03-19 21:27                         ` [Intel-gfx] " Ville Syrjälä
2021-03-25 22:01                         ` Navare, Manasi
2021-03-25 22:01                           ` [Intel-gfx] " Navare, Manasi
2021-03-26 16:15                           ` Ville Syrjälä
2021-03-26 16:15                             ` [Intel-gfx] " Ville Syrjälä
2021-04-01 21:49                             ` Navare, Manasi
2021-04-01 21:49                               ` [Intel-gfx] " Navare, Manasi
2021-09-29 11:14                               ` Ville Syrjälä
2021-09-29 11:14                                 ` [Intel-gfx] " Ville Syrjälä
2021-03-03 18:09 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-03-03 18:30 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPj87rOtWpBW3u7M+ePPQqT_RKEmCzDA8u4gRfT-HrcRaR7_zg@mail.gmail.com \
    --to=daniel@fooishbar.org \
    --cc=daniel.vetter@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.