From 8b6b5ce6691c80f3254964b746499d5ca75b59b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tapani=20P=C3=A4lli?= Date: Fri, 15 Nov 2019 09:12:15 +0200 Subject: [PATCH] dri: add __DRI_IMAGE_FORMAT_SXRGB8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add format definition and required plumbing to create images. Cc: Signed-off-by: Tapani Pälli Reviewed-by: Lionel Landwerlin Part-of: --- include/GL/internal/dri_interface.h | 2 ++ src/loader/loader_dri3_helper.c | 2 ++ src/mesa/drivers/dri/common/dri_util.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index f19ec5168a5..09782c8baeb 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -1343,6 +1343,7 @@ struct __DRIdri2ExtensionRec { #define __DRI_IMAGE_FORMAT_UYVY 0x1013 #define __DRI_IMAGE_FORMAT_XBGR16161616F 0x1014 #define __DRI_IMAGE_FORMAT_ABGR16161616F 0x1015 +#define __DRI_IMAGE_FORMAT_SXRGB8 0x1016 #define __DRI_IMAGE_USE_SHARE 0x0001 #define __DRI_IMAGE_USE_SCANOUT 0x0002 @@ -1370,6 +1371,7 @@ struct __DRIdri2ExtensionRec { #define __DRI_IMAGE_FOURCC_SARGB8888 0x83324258 #define __DRI_IMAGE_FOURCC_SABGR8888 0x84324258 +#define __DRI_IMAGE_FOURCC_SXRGB8888 0x85324258 /** * Queryable on images created by createImageFromNames. diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index be33575e1a8..45e1c102ed1 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -1119,6 +1119,7 @@ dri3_cpp_for_format(uint32_t format) { case __DRI_IMAGE_FORMAT_ABGR2101010: case __DRI_IMAGE_FORMAT_SARGB8: case __DRI_IMAGE_FORMAT_SABGR8: + case __DRI_IMAGE_FORMAT_SXRGB8: return 4; case __DRI_IMAGE_FORMAT_XBGR16161616F: case __DRI_IMAGE_FORMAT_ABGR16161616F: @@ -1172,6 +1173,7 @@ image_format_to_fourcc(int format) switch (format) { case __DRI_IMAGE_FORMAT_SARGB8: return __DRI_IMAGE_FOURCC_SARGB8888; case __DRI_IMAGE_FORMAT_SABGR8: return __DRI_IMAGE_FOURCC_SABGR8888; + case __DRI_IMAGE_FORMAT_SXRGB8: return __DRI_IMAGE_FOURCC_SXRGB8888; case __DRI_IMAGE_FORMAT_RGB565: return DRM_FORMAT_RGB565; case __DRI_IMAGE_FORMAT_XRGB8888: return DRM_FORMAT_XRGB8888; case __DRI_IMAGE_FORMAT_ARGB8888: return DRM_FORMAT_ARGB8888; diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 3a03e4d0b01..e3ea4d6cfff 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -950,6 +950,10 @@ static const struct { .image_format = __DRI_IMAGE_FORMAT_SARGB8, .mesa_format = MESA_FORMAT_B8G8R8A8_SRGB, }, + { + .image_format = __DRI_IMAGE_FORMAT_SXRGB8, + .mesa_format = MESA_FORMAT_B8G8R8X8_SRGB, + }, { .image_format = __DRI_IMAGE_FORMAT_R16, .mesa_format = MESA_FORMAT_R_UNORM16, -- 2.30.2