From 7e554e11a1795d3db8f22b7ed059735f06ee4ca8 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Mon, 17 Jan 2022 22:02:48 -0500 Subject: [PATCH] dri: fix incorrect fourcc for R16G16B16A16_UNORM format The DRM fourcc for this format is DRM_FORMAT_ABGR16161616 = 'AB48', not __DRI_IMAGE_FOURCC_RGBA16161616 = 'RA48'. This should have no outward effect for clients, since the format does not get revealed by dri2_query_dma_buf_formats, and is otherwise only used within the library. Signed-off-by: Manuel Stoeckl Part-of: --- include/GL/internal/dri_interface.h | 1 - src/gallium/frontends/dri/dri_helpers.c | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 6d0671f5422..74c807c5faf 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -1242,7 +1242,6 @@ struct __DRIdri2ExtensionRec { #define __DRI_IMAGE_FOURCC_SARGB8888 0x83324258 #define __DRI_IMAGE_FOURCC_SABGR8888 0x84324258 #define __DRI_IMAGE_FOURCC_SXRGB8888 0x85324258 -#define __DRI_IMAGE_FOURCC_RGBA16161616 0x38344152 /* fourcc_code('R', 'A', '4', '8' ) */ /** * Queryable on images created by createImageFromNames. diff --git a/src/gallium/frontends/dri/dri_helpers.c b/src/gallium/frontends/dri/dri_helpers.c index a399d7bf805..e170965bfdd 100644 --- a/src/gallium/frontends/dri/dri_helpers.c +++ b/src/gallium/frontends/dri/dri_helpers.c @@ -443,7 +443,7 @@ static const struct dri2_format_mapping dri2_format_table[] = { { DRM_FORMAT_XBGR16161616F, __DRI_IMAGE_FORMAT_XBGR16161616F, __DRI_IMAGE_COMPONENTS_RGB, PIPE_FORMAT_R16G16B16X16_FLOAT, 1, { { 0, 0, 0, __DRI_IMAGE_FORMAT_XBGR16161616F } } }, - { __DRI_IMAGE_FOURCC_RGBA16161616, __DRI_IMAGE_FORMAT_ABGR16161616, + { DRM_FORMAT_ABGR16161616, __DRI_IMAGE_FORMAT_ABGR16161616, __DRI_IMAGE_COMPONENTS_RGBA, PIPE_FORMAT_R16G16B16A16_UNORM, 1, { { 0, 0, 0, __DRI_IMAGE_FORMAT_ABGR16161616 } } }, { DRM_FORMAT_ARGB2101010, __DRI_IMAGE_FORMAT_ARGB2101010, @@ -693,12 +693,11 @@ dri2_query_dma_buf_formats(__DRIscreen *_screen, int max, int *formats, const struct dri2_format_mapping *map = &dri2_format_table[i]; /* The sRGB format is not a real FourCC as defined by drm_fourcc.h, so we - * must not leak it out to clients. The RGBA16161616 format isn't - * real either, but at some point it could be. Don't leak it out form - * now. + * must not leak it out to clients. The ABGR16161616 format wasn't + * real until recently. Don't leak it out for now. */ if (dri2_format_table[i].dri_fourcc == __DRI_IMAGE_FOURCC_SARGB8888 || - dri2_format_table[i].dri_fourcc == __DRI_IMAGE_FOURCC_RGBA16161616) + dri2_format_table[i].dri_fourcc == DRM_FORMAT_ABGR16161616) continue; if (pscreen->is_format_supported(pscreen, map->pipe_format,