All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: "Simon Ser" <contact@emersion.fr>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: airlied@linux.ie, kernel@collabora.com,
	Leandro Ribeiro <leandro.ribeiro@collabora.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/doc: emphasize difference between plane formats and IN_FORMATS blob
Date: Thu, 8 Apr 2021 12:59:19 +0300	[thread overview]
Message-ID: <20210408125919.4a83119c@eldfell> (raw)
In-Reply-To: <RW8-e8gSvP1pTckh_2alh-dqd3OR_bdl8e5PYdZVWBL4VnBMh0_ZWEfdlRmoQvzI0lGVH62Fp83MCaPqLZxlCE5pjntUhq-zW0v4-S_4Vos=@emersion.fr>


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

On Thu, 08 Apr 2021 08:39:10 +0000
Simon Ser <contact@emersion.fr> wrote:

> On Wednesday, April 7th, 2021 at 3:51 PM, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 
> > > +	 * To find out the list of formats that support modifiers, userspace
> > > +	 * must use the plane IN_FORMATS blob property.
> > >  	 */  
> >
> > Addfb2+modifiers predates the IN_FORMATS blob, so this doesn't
> > match reality.  
> 
> TBH, I'm inclined not to care about this edge-case. It's already
> complicated enough for user-space to figure out what's the right thing
> to do when supporting both implicit modifiers and explicit modifiers.
> Using modifiers without IN_FORMATS is risky, since a whole part of the
> modifier negotiation mechanism is missing.
> 
> Maybe we can just stick a "since kernel x.y.z" in here to address your
> concern.

Yeah, or we could word it less "must", e.g. "The list of supported
formats with their explicit modifiers is advertised via IN_FORMATS blob."

We don't have to require userspace to not use the explicit modifier
uAPI if IN_FORMATS does not exist. There might be other ways how
userspace determines the explicit modifiers, like a Wayland compositor
advertising those format-modifier pairs that EGL can import. Then
clients use those, and the compositor can try to import those to KMS as
well. Maybe it works, maybe it doesn't (the same even if IN_FORMATS
exists).

IN_FORMATS just gives better chances of picking something that ends up
working.

The thing userspace *must not* do is to try to use the no-modifiers uAPI
when it has an explicit modifier. But do we then have exceptions for
MOD_LINEAR?

If a buffer has been allocated with explicit modifier MOD_LINEAR, does
it mean it is ok to import to KMS using the no-modifiers uAPI or not?

The other things userspace *must not* do is use the explicit modifier
uAPI when it does not have an explicit modifier, in essence pulling a
modifier out of a hat. It might be tempting to use MOD_LINEAR in that
case, sometimes it might work, but it's wrong. Userspace must use the
no-modifiers uAPI instead.

Right?

The point of these documentation patches is to establish the convention
that:

- drm_mode_get_plane::format_type_ptr is the list of pixel formats that
  can work via the no-modifiers uAPI, but says nothing about the
  explicit modifiers uAPI.

- IN_FORMATS is a list of format-modifier pairs that can work via the
  explicit modifiers API, but says nothing about the no-modifiers uAPI.

Is that a reasonable expectation?

Is it also so that passing MOD_INVALID to the explicit modifier uAPI
(ADDFB2) is invalid argument? Do we have that documented?


Thanks,
pq

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 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

  reply	other threads:[~2021-04-08  9:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 19:21 [PATCH 0/2] Document how userspace should use plane format list and IN_FORMATS Leandro Ribeiro
2021-04-06 19:21 ` [PATCH 1/2] drm/doc: document drm_mode_get_plane Leandro Ribeiro
2021-04-07 13:45   ` Ville Syrjälä
2021-04-08 19:26     ` Leandro Ribeiro
2021-04-20  8:51       ` Simon Ser
2021-04-06 19:21 ` [PATCH 2/2] drm/doc: emphasize difference between plane formats and IN_FORMATS blob Leandro Ribeiro
2021-04-07 13:51   ` Ville Syrjälä
2021-04-08  8:39     ` Simon Ser
2021-04-08  9:59       ` Pekka Paalanen [this message]
2021-04-08 11:30         ` Daniel Vetter
2021-04-08 13:57           ` Pekka Paalanen
2021-04-08 14:39             ` Ville Syrjälä
2021-04-09  9:44               ` Pekka Paalanen
2021-04-12 13:16               ` Daniel Vetter
2021-04-08 11:35 ` [PATCH 0/2] Document how userspace should use plane format list and IN_FORMATS Daniel Vetter
2021-04-08 22:24   ` Leandro Ribeiro
2021-04-12 13:59     ` Daniel Vetter

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=20210408125919.4a83119c@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=airlied@linux.ie \
    --cc=contact@emersion.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=leandro.ribeiro@collabora.com \
    --cc=ville.syrjala@linux.intel.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.