All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Ser <contact@emersion.fr>
To: Pekka Paalanen <ppaalanen@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3 4/4] drm: require each CRTC to have a unique primary plane
Date: Wed, 16 Dec 2020 15:23:17 +0000	[thread overview]
Message-ID: <Ieaf7Com49xFBQeZZDqxLVWsOnfF7rjMfo2DaLdZ10oVx6k6_sVvCGjyXqroH9PGSaE5wu3vcgwrYnm1jkArnG87_R7kiuZ3pmE_T2zim_Q=@emersion.fr> (raw)
In-Reply-To: <20201214104149.2d5532c4@eldfell>

On Monday, December 14th, 2020 at 9:41 AM, Pekka Paalanen <ppaalanen@gmail.com> wrote:

> On Fri, 11 Dec 2020 14:39:35 +0000
> Simon Ser <contact@emersion.fr> wrote:
>
> > On Friday, December 11th, 2020 at 2:50 PM, Pekka Paalanen <ppaalanen@gmail.com> wrote:
> >
> > > is there a reason why one cannot have more primary planes than CRTCs in
> > > existence?
> > >
> > > Daniel implied that in <20201209003637.GK401619@phenom.ffwll.local>,
> > > but I didn't get the reason for it yet.
> > >
> > > E.g. if all your planes are interchangeable in the sense that you can
> > > turn on a CRTC with any one of them, would one not then expose all the
> > > planes as "Primary"?
> >
> > I'm thinking of primary as a hint for simple user-space: "you can likely
> > light up a CRTC if you attach this plane and don't do anything crazy".
> > For anything more complicated, user-space uses atomic commits and can
> > completely ignore whether a plane is primary, cursor or overlay.
>
> That's a nice reason, do we have those written down anywhere?

Doesn't seem like it. The docs for enum drm_plane_type incorrectly say that the
a plane of type "Primary" will be used for legacy IOCTLs. Also, there are no
docs for the "type" property at all. I'm not even sure where to document it, as
there's no section for plane properties.

> - plane type "Primary" is a hint to userspace that using this plane
>   alone on a CRTC has the highest probability of being able to turn on
>   the CRTC
>
> - plane types are just a hint to userspace, userspace can and *should*
>   use atomic test_only commits to discover more ways of making use of
>   the planes (note: if this applies to cursor planes, it will invalidate
>   some "optimizations" that virtual hardware drivers like vmwgfx(?)
>   might do by having the cursor plane position controller directly from
>   the host rather than looped through the guest)

Yes. In an old thread, I suggested having a DRM cap that needs to be enabled
to allow the driver to de-synchronize a cursor plane's CRTC_X/Y.

> > > If the planes have other differences, like supported formats or
> > > scaling, then marking them all "Primary" would let userspace know that
> > > it can pick any plane with the suitable properties and expect to turn
> > > on the CRTC with it.
> >
> > That's interesting, but I'd bet no user-space does that. If new user-space
> > wants to, it's better to rely on test-only commits instead.
>
> Ok. So plane types are not a good reason to prune a compositor's testing
> matrix to avoid testing some combinations.

They are a hint, so in this sense they do help pruning the testing matrix. For
instance it would be impossible for user-space to figure out the right cursor
buffer parameters without DRM_CAP_CURSOR_{WIDTH,HEIGHT}. I also think there's
an undocumented assumption that the cursor buffer must be allocated with a
LINEAR layout when the driver doesn't support modifiers.

However, for this particular case I don't think the hint would be helpful.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-12-16 15:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 13:08 [PATCH v3 4/4] drm: require each CRTC to have a unique primary plane Simon Ser
2020-12-11 13:14 ` Daniel Vetter
2020-12-11 13:50 ` Pekka Paalanen
2020-12-11 14:39   ` Simon Ser
2020-12-14  8:41     ` Pekka Paalanen
2020-12-16 15:23       ` Simon Ser [this message]
2020-12-11 14:52 ` Ville Syrjälä

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='Ieaf7Com49xFBQeZZDqxLVWsOnfF7rjMfo2DaLdZ10oVx6k6_sVvCGjyXqroH9PGSaE5wu3vcgwrYnm1jkArnG87_R7kiuZ3pmE_T2zim_Q=@emersion.fr' \
    --to=contact@emersion.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ppaalanen@gmail.com \
    /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.