* Re: [ANNOUNCE] pixfmtdb
[not found] <nn8qWh16AviRPuLVOg_I-Nn747ncRsuJsZU_VZHvKhxp2hoFBCFsAfezBDkiwM-yn-CXAW_Vos121VKtETNsSZU3EuCuVzcgHBnnWNnww-g=@emersion.fr>
@ 2023-01-23 15:49 ` Laurent Pinchart
2023-01-23 20:25 ` Sebastian Wick
0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2023-01-23 15:49 UTC (permalink / raw)
To: Simon Ser; +Cc: wayland-devel, DRI Development, linux-media
CC'ing the linux-media mailing list.
On Mon, Jan 23, 2023 at 02:10:58PM +0000, Simon Ser wrote:
> Hi all,
>
> In the last few days I've been working on a small new project, pixfmtdb [1].
> It's a Web database of pixel format guides, it can be useful to understand
> how pixels are laid out in memory for a given format and which formats from
> various APIs are compatible with each other.
>
> pixfmtdb relies on the Khronos Data Format Specification [2] to describe
> each format. This means that each format is described with a standardized
> data blob, which can be re-used with other tools for other purposes.
>
> My future plans include adding more formats and format families to pixfmtdb,
> and make it easy to use the data for code generation, in particular for
> automatically generating tables containing metadata about formats, as used
> in Wayland compositors and other projects.
>
> I hope some of you can find this work useful,
>
> Simon
>
> [1]: https://pixfmtdb.emersion.fr
> [2]: https://www.khronos.org/dataformat
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANNOUNCE] pixfmtdb
2023-01-23 15:49 ` [ANNOUNCE] pixfmtdb Laurent Pinchart
@ 2023-01-23 20:25 ` Sebastian Wick
2023-01-23 22:43 ` Simon Ser
0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Wick @ 2023-01-23 20:25 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: Simon Ser, linux-media, DRI Development, wayland-devel
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?
On Mon, Jan 23, 2023 at 4:51 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> CC'ing the linux-media mailing list.
>
> On Mon, Jan 23, 2023 at 02:10:58PM +0000, Simon Ser wrote:
> > Hi all,
> >
> > In the last few days I've been working on a small new project, pixfmtdb [1].
> > It's a Web database of pixel format guides, it can be useful to understand
> > how pixels are laid out in memory for a given format and which formats from
> > various APIs are compatible with each other.
> >
> > pixfmtdb relies on the Khronos Data Format Specification [2] to describe
> > each format. This means that each format is described with a standardized
> > data blob, which can be re-used with other tools for other purposes.
> >
> > My future plans include adding more formats and format families to pixfmtdb,
> > and make it easy to use the data for code generation, in particular for
> > automatically generating tables containing metadata about formats, as used
> > in Wayland compositors and other projects.
> >
> > I hope some of you can find this work useful,
> >
> > Simon
> >
> > [1]: https://pixfmtdb.emersion.fr
> > [2]: https://www.khronos.org/dataformat
>
> --
> Regards,
>
> Laurent Pinchart
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANNOUNCE] pixfmtdb
2023-01-23 20:25 ` Sebastian Wick
@ 2023-01-23 22:43 ` Simon Ser
2023-01-23 23:54 ` Sebastian Wick
0 siblings, 1 reply; 5+ messages in thread
From: Simon Ser @ 2023-01-23 22:43 UTC (permalink / raw)
To: Sebastian Wick
Cc: Laurent Pinchart, linux-media, DRI Development, wayland-devel
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?
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).
[1]: https://github.com/KhronosGroup/dfdutils/blob/5cd41cbdf63e80b00c085c6906a1152709e4c0f2/createdfd.c#L47
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANNOUNCE] pixfmtdb
2023-01-23 22:43 ` Simon Ser
@ 2023-01-23 23:54 ` Sebastian Wick
2023-01-24 12:03 ` Pekka Paalanen
0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Wick @ 2023-01-23 23:54 UTC (permalink / raw)
To: Simon Ser; +Cc: Laurent Pinchart, linux-media, DRI Development, wayland-devel
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.
>
> [1]: https://github.com/KhronosGroup/dfdutils/blob/5cd41cbdf63e80b00c085c6906a1152709e4c0f2/createdfd.c#L47
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [ANNOUNCE] pixfmtdb
2023-01-23 23:54 ` Sebastian Wick
@ 2023-01-24 12:03 ` Pekka Paalanen
0 siblings, 0 replies; 5+ messages in thread
From: Pekka Paalanen @ 2023-01-24 12:03 UTC (permalink / raw)
To: Sebastian Wick
Cc: Simon Ser, wayland-devel, Laurent Pinchart, DRI Development,
linux-media
[-- 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 --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-01-24 12:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox