dri_util: Add R10G10B10{A,X}2 translation between DRI and mesa_format.
authorMiguel Casas <mcasas@chromium.org>
Mon, 7 May 2018 15:45:20 +0000 (11:45 -0400)
committerChad Versace <chadversary@chromium.org>
Wed, 23 May 2018 17:17:45 +0000 (10:17 -0700)
Add R10G10B10{A,X}2 translation between mesa_format and DRI format
to driGLFormatToImageFormat() and driImageFormatToGLFormat().

Bug: https://crbug.com/776093
Reviewed-by: Chad Versace <chadversary@chromium.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/drivers/dri/common/dri_util.c

index 75d124097b9c8f8f897e7e1d9a05dacb3e593c7c..c58650491dfbb15bea9383562728bcea3463c64f 100644 (file)
@@ -878,6 +878,10 @@ driGLFormatToImageFormat(mesa_format format)
       return __DRI_IMAGE_FORMAT_ARGB2101010;
    case MESA_FORMAT_B10G10R10X2_UNORM:
       return __DRI_IMAGE_FORMAT_XRGB2101010;
+   case MESA_FORMAT_R10G10B10A2_UNORM:
+      return __DRI_IMAGE_FORMAT_ABGR2101010;
+   case MESA_FORMAT_R10G10B10X2_UNORM:
+      return __DRI_IMAGE_FORMAT_XBGR2101010;
    case MESA_FORMAT_B8G8R8A8_UNORM:
       return __DRI_IMAGE_FORMAT_ARGB8888;
    case MESA_FORMAT_R8G8B8A8_UNORM:
@@ -915,6 +919,10 @@ driImageFormatToGLFormat(uint32_t image_format)
       return MESA_FORMAT_B10G10R10A2_UNORM;
    case __DRI_IMAGE_FORMAT_XRGB2101010:
       return MESA_FORMAT_B10G10R10X2_UNORM;
+   case __DRI_IMAGE_FORMAT_ABGR2101010:
+      return MESA_FORMAT_R10G10B10A2_UNORM;
+   case __DRI_IMAGE_FORMAT_XBGR2101010:
+      return MESA_FORMAT_R10G10B10X2_UNORM;
    case __DRI_IMAGE_FORMAT_ARGB8888:
       return MESA_FORMAT_B8G8R8A8_UNORM;
    case __DRI_IMAGE_FORMAT_ABGR8888: