render: add new 16- and 32-bits-per-component pixel formats

These new formats have been introduced in libdrm 2.4.129:
31e68ea81c
This commit is contained in:
Simon Ser 2025-11-20 18:25:35 +01:00
parent 53cdceb371
commit d512c00791
2 changed files with 33 additions and 1 deletions

View file

@ -98,7 +98,7 @@ wayland_server = dependency('wayland-server',
)
drm = dependency('libdrm',
version: '>=2.4.122',
version: '>=2.4.129',
fallback: 'libdrm',
default_options: [
'auto_features=disabled',

View file

@ -44,10 +44,26 @@ static const struct wlr_pixel_format_info pixel_format_info[] = {
.drm_format = DRM_FORMAT_R8,
.bytes_per_block = 1,
},
{
.drm_format = DRM_FORMAT_R16F,
.bytes_per_block = 2,
},
{
.drm_format = DRM_FORMAT_R32F,
.bytes_per_block = 4,
},
{
.drm_format = DRM_FORMAT_GR88,
.bytes_per_block = 2,
},
{
.drm_format = DRM_FORMAT_GR1616F,
.bytes_per_block = 4,
},
{
.drm_format = DRM_FORMAT_GR3232F,
.bytes_per_block = 8,
},
{
.drm_format = DRM_FORMAT_RGB888,
.bytes_per_block = 3,
@ -56,6 +72,18 @@ static const struct wlr_pixel_format_info pixel_format_info[] = {
.drm_format = DRM_FORMAT_BGR888,
.bytes_per_block = 3,
},
{
.drm_format = DRM_FORMAT_BGR161616,
.bytes_per_block = 6,
},
{
.drm_format = DRM_FORMAT_BGR161616F,
.bytes_per_block = 6,
},
{
.drm_format = DRM_FORMAT_BGR323232F,
.bytes_per_block = 12,
},
{
.drm_format = DRM_FORMAT_RGBX4444,
.bytes_per_block = 2,
@ -136,6 +164,10 @@ static const struct wlr_pixel_format_info pixel_format_info[] = {
.opaque_substitute = DRM_FORMAT_XBGR16161616F,
.bytes_per_block = 8,
},
{
.drm_format = DRM_FORMAT_ABGR32323232F,
.bytes_per_block = 16,
},
{
.drm_format = DRM_FORMAT_XBGR16161616,
.bytes_per_block = 8,