public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Sebastian Wick <sebastian.wick@redhat.com>
Cc: Simon Ser <contact@emersion.fr>,
	wayland-devel <wayland-devel@lists.freedesktop.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	linux-media@vger.kernel.org
Subject: Re: [ANNOUNCE] pixfmtdb
Date: Tue, 24 Jan 2023 14:03:07 +0200	[thread overview]
Message-ID: <20230124140307.3851d70c@eldfell> (raw)
In-Reply-To: <CA+hFU4wQ14fn-giuL6oxMmXfg0WPPrXcHHeT5-7tagP54xuXFg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3005 bytes --]

On Tue, 24 Jan 2023 00:54:07 +0100
Sebastian Wick <sebastian.wick@redhat.com> wrote:

> On Mon, Jan 23, 2023 at 11:43 PM Simon Ser <contact@emersion.fr> wrote:
> >
> > On Monday, January 23rd, 2023 at 21:25, Sebastian Wick <sebastian.wick@redhat.com> wrote:
> >  
> > > Why is the TF defined for GL formats and both the primaries and TF for
> > > Vulkan formats? The only exception here should be sRGB formats. Where
> > > did you get the information from?  
> >
> > This is what upstream dfdutils does [1]. Can you explain why you think
> > it should be undefined instead of linear?  
> 
> The channels have no meaning. You can put whatever you want in there.
> It doesn't have to be linear, it doesn't have to be colors and
> especially not colors with specific primaries. It's only when it's
> used to form an image that the TF and primaries are known. Vulkan
> specifically requires you to explicitly provide this information to
> the WSI and YCC samplers (generally everywhere where knowing them is
> required) and never assumes that certain pixel formats imply certain
> TFs and primaries (exception being the sRGB variants).
> 
> 
> (See also https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#_issues_26,
> Q 23)
> 
> The problem here seems to be that the Data Format spec describes more
> than the pixel format. If you want to share an image, the TF and
> primaries are essential but they are not an inherent part of the pixel
> format of the image. So yeah, I think what dfdutils does is...
> probably not wrong but not what you're after.
> 
> >
> > I was wondering what to do for DRM formats regarding these. I think it
> > would be worthwhile to do like Vulkan: set TF = linear, primaries =
> > BT.709, pre-multiplied alpha = yes. These are the things KMS assume
> > when there is no override (ie, when there is no KMS property saying
> > otherwise).  
> 
> Please no. All undefined is absolutely the right thing to do. Adding
> any more meaning to pixel formats is a horrible idea. The KMS
> properties are also not an override, they describe the image and the
> description has default values.

Hi,

I agree with Sebastian here.

The same with (plain) Pixman, Cairo and OpenGL formats. They don't
define primaries nor TF.

Personally I think that sRGB "pixel formats" are semantically simply
not a part of the same enumeration as plain pixel formats, but API-wise
it was a convenient trick to add a "pixel format" that implies
different processing in the same old API functions.

Most of the APIs do computations as if the TF was linear (assuming you
think in higher semantic terms than basic mathematical operations),
but the pixel format does not define that it is. The responsibility of
applying meaningful computations is left for the user of the APIs.


Thanks,
pq

> >
> > [1]: https://github.com/KhronosGroup/dfdutils/blob/5cd41cbdf63e80b00c085c6906a1152709e4c0f2/createdfd.c#L47
> >  
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2023-01-24 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <nn8qWh16AviRPuLVOg_I-Nn747ncRsuJsZU_VZHvKhxp2hoFBCFsAfezBDkiwM-yn-CXAW_Vos121VKtETNsSZU3EuCuVzcgHBnnWNnww-g=@emersion.fr>
2023-01-23 15:49 ` [ANNOUNCE] pixfmtdb Laurent Pinchart
2023-01-23 20:25   ` Sebastian Wick
2023-01-23 22:43     ` Simon Ser
2023-01-23 23:54       ` Sebastian Wick
2023-01-24 12:03         ` Pekka Paalanen [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=20230124140307.3851d70c@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=contact@emersion.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sebastian.wick@redhat.com \
    --cc=wayland-devel@lists.freedesktop.org \
    /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