All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leandro Ribeiro <leandro.ribeiro@collabora.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: airlied@linux.ie, pekka.paalanen@collabora.co.uk,
	kernel@collabora.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 0/2] Document how userspace should use plane format list and IN_FORMATS
Date: Thu, 8 Apr 2021 19:24:30 -0300	[thread overview]
Message-ID: <14b8b86b-edc5-f726-5920-d5d381d3f538@collabora.com> (raw)
In-Reply-To: <YG7qbA3KthIUXhDn@phenom.ffwll.local>



On 4/8/21 8:35 AM, Daniel Vetter wrote:
> On Tue, Apr 06, 2021 at 04:21:16PM -0300, Leandro Ribeiro wrote:
>> This patch is to emphasize how userspace should use the plane format list and
>> the IN_FORMATS blob. The plane format list contains the formats that do not
>> require modifiers, and the blob property has the formats that support
>> modifiers.
>
> Uh this is a very strong statement that I don't think is supported by
> kernel driver code. Where is this from.
>
>> Note that these are not disjoint sets. If a format supports modifiers but the
>> driver can also handle it without a modifier, it should be present in both the
>> IN_FORMATS blob property and the plane format list.
> 
> Same here ...
> 

Yes, sorry. The wording was not good. To clarify:

I'm trying to document a good approach that userspace *can* (not must)
take to be able to tell if a certain format can be used in the
pre-modifier kernel uAPI or if it only works with modifiers.

The background is that we are reworking the way that Weston stores the
formats and modifiers supported by the planes, and there were some wrong
assumptions in the code related to what we can assume that the KMS
driver supports.

We've discussed and decided to send a patch to raise a discussion and
check if the conclusions that we've made were reasonable. And if not,
what would be a better approach.

This is part of a MR in which we add support for the dmabuf-hints
protocol extension in Weston. In sort, in Weston we store the formats
and modifiers supported by the planes. Then we send them to the client
and it may pick one of these format/modifier pairs to allocate its
buffers, increasing the chances of its surface ending up in a plane.

Here are two commits of the MR that are related to this discussion:

https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/544/diffs?commit_id=de6fc18bc35c2e43dff936dd85f310d1f778a7b8

https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/544/diffs?commit_id=75363bdb121bda2f326109afca5f4c3259423b7d

Thanks!

> I thought these two lists are 100% consistent. If not sounds like driver
> bugs that we need to maybe validate in drm_plane_init.
> 
>> This is important for userspace, as there are situations in which we need to
>> find out if the KMS driver can handle a certain format without any modifiers.
> 
> I don't think you can rely on this. No modifiers means implicit modifier,
> and the only thing that can give you such buffers is defacto mesa
> userspace drivers (since that all depends upon driver private magic, with
> maybe some kernel metadata passed around in private ioctls on the render
> node).
> 
> Maybe for more context, what's the problem you've hit and trying to
> clarify here?
> -Daniel
> 
>>
>> Leandro Ribeiro (2):
>>   drm/doc: document drm_mode_get_plane
>>   drm/doc: emphasize difference between plane formats and IN_FORMATS
>>     blob
>>
>>  drivers/gpu/drm/drm_plane.c |  4 ++++
>>  include/uapi/drm/drm_mode.h | 22 ++++++++++++++++++++++
>>  2 files changed, 26 insertions(+)
>>
>> -- 
>> 2.31.1
>>
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-04-08 22:24 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
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 [this message]
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=14b8b86b-edc5-f726-5920-d5d381d3f538@collabora.com \
    --to=leandro.ribeiro@collabora.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=pekka.paalanen@collabora.co.uk \
    /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.