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 <code@mstoeckl.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14580>
This commit is contained in:
Manuel Stoeckl 2022-01-17 22:02:48 -05:00 committed by Marge Bot
parent d8eff20b9b
commit 7e554e11a1
2 changed files with 4 additions and 6 deletions

View File

@ -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.

View File

@ -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,