Which is the correct place for them.
Currently they cause warnings like:
```
/usr/include/libdrm/drm_fourcc.h:389:9: warning: ‘DRM_FORMAT_S010’ redefined
```
with libdrm >= 2.4.125.
Fixes: 3dce9e8c2 (pixel-formats: Add Sx1x software decoder formats)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
A Vulkan renderer for weston, based on the GL renderer.
The goal is to impose the least requirements as possible on Vulkan
implementations, as to allow even Vulkan 1.0 (or early development)
drivers to run a Wayland compositor. Any additional features or
extensions are made optional if possible.
Currently supports drm, wayland, x11 and headless backends.
As of this implementation, this is still considered an experimental
renderer.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
The implementation got removed already and we can just check
the color_model now.
Fixes: 51ed256d (libweston: Replace pixel format's sampler_type with color_model enum)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
The sampler type, which was initially meant for the GL renderer, is
currently used to derive the color model of pixel formats. This commit
gets rid of this legacy field and replaces it with an explicit one
indicating the color model.
Note that it also fixes the issue that formats wouldn't be considered
YUV if ENABLE_EGL isn't defined because the sampler type field in that
particular case would always be 0.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The channel ordering system currently proposes to swizzle components
in the fragment shader for a few combinations. This commit replaces
this system with texture swizzling parameters in order to support all
the possible combinations in a more efficient way.
This will allow to easily add a lot more formats and as a nice side
effect to force components to 0 or 1, which is useful for opaque
formats.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
A new gl_format_info structure is added to the pixel_format_info
structure in order to store new GL format information (compatible with
Table 1 in gl-utils.c) for each supported format. There will be a
temporary duplication of GL format info in order to keep other parts
of the code not yet ported working. That will be removed later.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Which will be used in later commits. For now using the sampler_type
works for all existing formats, however should we ever want to use
it for RGB formats this functions needs to get adopted.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Add a helper function to turn an array of DRM fourccs into an array of
corresponding struct pixel_format_info pointers.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
This will be useful for client code that wants to create a wl_shm buffer
with a DRM format code.
The test suite will be using this.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Sometimes you will have a pixman_image_t and you need the corresponding
drm_fourcc format.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Add a new hide_from_clients flag which, if set, specifies that the
format is only for internal information and processing, and should not
be advertised for clients.
This will be used for formats like R8 and GR88, which are not useful for
client buffers, but are used internally to implement YUV -> RGB
conversion.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We already had these with effective width and height, but they're useful
externally as well. Pull them out to a helper.
Signed-off-by: Daniel Stone <daniels@collabora.com>
'depth' isn't actually used to determine the bit depth of meaningful
components generally, but specifically to determine whether we can use
the legacy drmModeAddFB (pre-AddFB2) with those formats.
Rename the member to make it more clear what it's used for.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Adds a Pixman format field to the pixel format table, and
adjusts the shm format handling code in the Pixman renderer
to use this table.
Pixman formats have been registered only for specific 565, 8888,
and 2101010 layouts, as these have corresponding DRM format codes
and are commonly used.
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Conditionally build support when libdrm is at least 2.4.107 to make use
of it. Plug it in when printing out the buffer information.
With this in, we add a hard dependecy for libweston to link against
libdrm.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
These fields are necessary when looking for an EGLConfig matching a pixel
format, but the configs do not expose a native visual id. Such happens on the
EGL surfaceless platform where one does not actually care about the exact pixel
format, one just cares it has the right number of bits for each channel and the
right component type.
FP16 formats are coming, so this paves way for them too, allowing them to be
described.
The FIXED/FLOAT terminology comes from EGL_EXT_pixel_format_float.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Replace one more open-coded pixel format translation map with a call to our
central pixel format database, reducing duplication of format information.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
In current form SHM buffers pixel format can only be printed as 0 and 1.
With the help of this helper we align with DRM_FORMAT_ pixel format.
Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
Add a function to find a format description by the DRM format name. This
will be useful when parsing configuration strings.
While at it, fix the two function formattings in pixel-formats.h to
match everything else in the file.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
There is often a need to print the name of a pixel format. Printing the
raw numeric value is hard to decipher, printing the four ASCII
characters is slightly more human-friendly but still needs a decoder
table. Add a name that can be printed easily.
The bulk of this patch was done with:
sed -i -e 's/\.format = DRM_FORMAT_\(.\+\),/DRM_FORMAT(\1),/' libweston/pixel-formats.c
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Rather than duplicating knowledge of pixel formats across several
components, create a custom central repository.
Signed-off-by: Daniel Stone <daniels@collabora.com>
[Pekka: fix include paths and two copy-pastas]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>