summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorTapani Pälli <[email protected]>2018-03-19 13:41:44 +0200
committerTapani Pälli <[email protected]>2018-04-24 14:55:18 +0300
commitfa4d4d97f3c968f3c8dce728c12f9e8597c93530 (patch)
tree38cbb34654a9959679b87ca2a12213ee1bfa95bd /src/mesa/drivers
parent4559aefb5cee5878198f8491680abe47df3e3250 (diff)
dri: Add __DRI_IMAGE_FORMAT_SABGR8
Add format definition and required plumbing to create images. Note that there is no match to drm_fourcc definition, just like with existing _DRI_IMAGE_FOURCC_SARGB8888. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c4
-rw-r--r--src/mesa/drivers/dri/common/utils.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 0b94d19fa5d..7cb6248b130 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -900,6 +900,8 @@ driGLFormatToImageFormat(mesa_format format)
return __DRI_IMAGE_FORMAT_GR88;
case MESA_FORMAT_NONE:
return __DRI_IMAGE_FORMAT_NONE;
+ case MESA_FORMAT_R8G8B8A8_SRGB:
+ return __DRI_IMAGE_FORMAT_SABGR8;
case MESA_FORMAT_B8G8R8A8_SRGB:
return __DRI_IMAGE_FORMAT_SARGB8;
default:
@@ -937,6 +939,8 @@ driImageFormatToGLFormat(uint32_t image_format)
return MESA_FORMAT_R16G16_UNORM;
case __DRI_IMAGE_FORMAT_SARGB8:
return MESA_FORMAT_B8G8R8A8_SRGB;
+ case __DRI_IMAGE_FORMAT_SABGR8:
+ return MESA_FORMAT_R8G8B8A8_SRGB;
case __DRI_IMAGE_FORMAT_NONE:
return MESA_FORMAT_NONE;
default:
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 1cffd3ad08e..fc5e2d19f34 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -208,6 +208,7 @@ driCreateConfigs(mesa_format format,
masks = masks_table[2];
break;
case MESA_FORMAT_R8G8B8A8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_SRGB:
masks = masks_table[5];
break;
case MESA_FORMAT_R8G8B8X8_UNORM: