dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Simon Ser <contact@emersion.fr>
Cc: dri-devel@lists.freedesktop.org,
	Simona Vetter <simona.vetter@ffwll.ch>,
	Pekka Paalanen <pekka.paalanen@collabora.com>,
	David Turner <david.turner@raspberrypi.com>
Subject: Re: [PATCH] drm: document DRM_MODE_PAGE_FLIP_EVENT interactions with atomic
Date: Fri, 17 Jan 2025 14:45:31 +0200	[thread overview]
Message-ID: <Z4pQ6916_hVJq71x@intel.com> (raw)
In-Reply-To: <bJlwXyrHx2dVR07f-XR1pvRbKIYBNPCXNptvmU81YxnaCJ2nCfxBNinnpasJdXStjbGzJ0pCY9TlzOdWqWqdDYpaWYjGepN6DDXVhBwpNHM=@emersion.fr>

On Fri, Jan 17, 2025 at 11:40:15AM +0000, Simon Ser wrote:
> On Friday, January 17th, 2025 at 12:32, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 
> > > + * When used with atomic uAPI, one event will be delivered per CRTC included in
> > > + * the atomic commit. A CRTC is included in an atomic commit if one of its
> > > + * properties is set, or if a property is set on a connector or plane linked
> > > + * via the CRTC_ID property to the CRTC. At least one CRTC must be included,
> > > + * and all pulled in CRTCs must be either previously or newly powered on (in
> > > + * other words, a powered off CRTC which stays off cannot be included in the
> > > + * atomic commit).
> > 
> > I don't understand all this stuff about powered off crtcs? If
> > someone sucks in a powered off thing then things will generally
> > work just fine.
> 
> Not with the page-flip event flag:
> 
> 	/*
> 	 * Reject event generation for when a CRTC is off and stays off.
> 	 * It wouldn't be hard to implement this, but userspace has a track
> 	 * record of happily burning through 100% cpu (or worse, crash) when the
> 	 * display pipe is suspended. To avoid all that fun just reject updates
> 	 * that ask for events since likely that indicates a bug in the
> 	 * compositor's drawing loop. This is consistent with the vblank IOCTL
> 	 * and legacy page_flip IOCTL which also reject service on a disabled
> 	 * pipe.
> 	 */
> 	if (new_crtc_state->event &&
> 	    !new_crtc_state->active && !old_crtc_state->active) {
> 		drm_dbg_atomic(crtc->dev,
> 			       "[CRTC:%d:%s] requesting event but off\n",
> 			       crtc->base.id, crtc->name);
> 		return -EINVAL;
> 	}

OK, so we're only talking about userspace stuff here. The kernel
can still pull stuff in without too many issues (apart from the
one mentined below).

> 
> > There is a bit of corner case with the way we internally complete
> > the commits for disabled things (not just crtcs, but also planes
> > and connectors) and that can apparently happen a bit later than
> > the commit completion for the enabled things. That seems to be
> > causing a bit of grief for sway which insists on adding all kinds
> > of disabled planes to every commit:
> > https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13410
> 
> Hm, interesting. So including an already-disabled cursor plane in a
> commit may fail the next commit with EBUY? I expect a lot of user-space
> to do this as well, e.g. Weston.

We may need to think if we could move that internal fake commit
completion earlier a bit. But I don't actually remeber the
specifics why it was added (presumably some commit ordering
vs. cleanup problem) so not sure if that's easily doable or not.

-- 
Ville Syrjälä
Intel

      reply	other threads:[~2025-01-17 12:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 16:25 [PATCH] drm: document DRM_MODE_PAGE_FLIP_EVENT interactions with atomic Simon Ser
2025-01-17 11:15 ` Pekka Paalanen
2025-04-14  8:24   ` Simon Ser
2025-04-15 10:53     ` Daniel Stone
2025-01-17 11:32 ` Ville Syrjälä
2025-01-17 11:40   ` Simon Ser
2025-01-17 12:45     ` Ville Syrjälä [this message]

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=Z4pQ6916_hVJq71x@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=contact@emersion.fr \
    --cc=david.turner@raspberrypi.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=pekka.paalanen@collabora.com \
    --cc=simona.vetter@ffwll.ch \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox