All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: airlied@linux.ie, dri-devel@lists.freedesktop.org,
	Leandro Ribeiro <leandro.ribeiro@collabora.com>,
	kernel@collabora.com
Subject: Re: [PATCH 2/2] drm/doc: emphasize difference between plane formats and IN_FORMATS blob
Date: Thu, 8 Apr 2021 16:57:51 +0300	[thread overview]
Message-ID: <20210408165751.7488e793@eldfell> (raw)
In-Reply-To: <YG7pSJHe6gKDJ6Hh@phenom.ffwll.local>


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

On Thu, 8 Apr 2021 13:30:16 +0200
Daniel Vetter <daniel@ffwll.ch> wrote:

> On Thu, Apr 08, 2021 at 12:59:19PM +0300, Pekka Paalanen wrote:

> > 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?  
> 
> I'm not sure. I thought they're the same list underneath in the kernel, at
> least for drivers that do support modifiers. The current wording I think
> suggests more meaning than is actually there.

They may be the same list in the kernel today, but do you want to force
all future drivers and future formats-modifiers to have that too?
Or did the boat sail already?

The existing uAPI considers these two to be independent lists, no
documentation saying otherwise, is there?

Should a kernel driver not have a way to say "this format won't work
via the no-modifiers uAPI"?

The practical consequence in userspace is how should userspace collect
the lists of supported format-modifier pairs, when the kernel has two
independent format lists, one carries modifiers explicitly and the
other does not. The one that carries explicit modifiers cannot denote
"no modifier" AFAIU.

So the "obvious" interpretation in userspace is that:
- the format list that does not carry any modifier information should
  be used with the no-modifiers uAPI, and
- the format list that does carry explicit modifiers should be used
  with the explicit modifiers uAPI.

If you were to say, that if IN_FORMATS exists, use it and ignore the
old no-modifiers format list, then the conclusion in userspace when
IN_FORMATS exists is that you cannot use the no-modifiers uAPI, because
all formats that are listed as supported carry an explicit modifier.

I understand that the format or format-modifier lists are not
authoritative. Formats outside of the lists *could* work. But why would
anyone bother trying something that is not suggested to work?

Or, is the intention such, that all formats in IN_FORMATS list imply
some support through the no-modifiers uAPI too, iff buffer
allocation does not give you an explicit modifier?

Or, should there be an i-g-t test to ensure that both the old and
IN_FORMATS lists have the exact same pixel formats always, carving that
fact into stone and resolving all this ambiguity?

> > Is it also so that passing MOD_INVALID to the explicit modifier uAPI
> > (ADDFB2) is invalid argument? Do we have that documented?  
> 
> We'd need to check that, currently it's an out-of-band flag in the struct.
> Atm DRM_FORMAT_MOD_INVALID is entirely an internal sentinel value to
> denote end-of-array entries.
> 
> In practice it wont pass because we validate the modifiers against the
> advertised list.

Right, so while at it, would be good to document that one cannot
substitute no-modifiers uAPI with explicit modifier uAPI using
MOD_INVALID. This should be documented, because other userspace APIs
have tendency to gravitate towards having just one explicit modifiers
function allowing MOD_INVALID, meaning "no modifier".


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 13:58 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
2021-04-08 11:30         ` Daniel Vetter
2021-04-08 13:57           ` Pekka Paalanen [this message]
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=20210408165751.7488e793@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=leandro.ribeiro@collabora.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.