<div dir="ltr"><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 3, 2018 at 5:48 AM, Tapani Pälli <span dir="ltr"><<a href="mailto:tapani.palli@intel.com" target="_blank">tapani.palli@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">ping ..<br>
<br>
(currently Android-IA sets EGL_KHR_gl_colorspace to false because these are missing)<div class="HOEnZb"><div class="h5"><br>
<br>
On 03/19/2018 01:41 PM, Tapani Pälli wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Add format definition and required plumbing to create images.<br>
Note that there is no match to drm_fourcc definition, just like<br>
with existing _DRI_IMAGE_FOURCC_SARGB8888.<br>
<br>
Signed-off-by: Tapani Pälli <<a href="mailto:tapani.palli@intel.com" target="_blank">tapani.palli@intel.com</a>><br>
---<br>
  include/GL/internal/dri_interf<wbr>ace.h    | 2 ++<br>
  src/loader/loader_dri3_helper.<wbr>c        | 2 ++<br>
  src/mesa/drivers/dri/common/dr<wbr>i_util.c | 4 ++++<br>
  src/mesa/drivers/dri/common/ut<wbr>ils.c    | 1 +<br>
  4 files changed, 9 insertions(+)<br>
<br>
diff --git a/include/GL/internal/dri_inte<wbr>rface.h b/include/GL/internal/dri_inte<wbr>rface.h<br>
index 4f4795c7ae..319a1fe4f9 100644<br>
--- a/include/GL/internal/dri_inte<wbr>rface.h<br>
+++ b/include/GL/internal/dri_inte<wbr>rface.h<br>
@@ -1253,6 +1253,7 @@ struct __DRIdri2ExtensionRec {<br>
  #define __DRI_IMAGE_FORMAT_YUYV         0x100f<br>
  #define __DRI_IMAGE_FORMAT_<wbr>XBGR2101010  0x1010<br>
  #define __DRI_IMAGE_FORMAT_<wbr>ABGR2101010  0x1011<br>
+#define __DRI_IMAGE_FORMAT_SABGR8       0x1012<br>
    #define __DRI_IMAGE_USE_SHARE               0x0001<br>
  #define __DRI_IMAGE_USE_SCANOUT               0x0002<br>
@@ -1289,6 +1290,7 @@ struct __DRIdri2ExtensionRec {<br>
  #define __DRI_IMAGE_FOURCC_ABGR8888   0x34324241<br>
  #define __DRI_IMAGE_FOURCC_XBGR8888   0x34324258<br>
  #define __DRI_IMAGE_FOURCC_SARGB8888  0x83324258<br>
+#define __DRI_IMAGE_FOURCC_SABGR8888   0x84324258<br>
  #define __DRI_IMAGE_FOURCC_<wbr>ARGB2101010        0x30335241<br>
  #define __DRI_IMAGE_FOURCC_<wbr>XRGB2101010        0x30335258<br>
  #define __DRI_IMAGE_FOURCC_<wbr>ABGR2101010        0x30334241<br>
diff --git a/src/loader/loader_dri3_helpe<wbr>r.c b/src/loader/loader_dri3_helpe<wbr>r.c<br>
index c1d94c3c21..f8cdd9c642 100644<br>
--- a/src/loader/loader_dri3_helpe<wbr>r.c<br>
+++ b/src/loader/loader_dri3_helpe<wbr>r.c<br>
@@ -1022,6 +1022,7 @@ dri3_cpp_for_format(uint32_t format) {<br>
     case  __DRI_IMAGE_FORMAT_XBGR2101010<wbr>:<br>
     case  __DRI_IMAGE_FORMAT_ABGR2101010<wbr>:<br>
     case  __DRI_IMAGE_FORMAT_SARGB8:<br>
+   case  __DRI_IMAGE_FORMAT_SABGR8:<br>
        return 4;<br>
     case  __DRI_IMAGE_FORMAT_NONE:<br>
     default:<br>
@@ -1041,6 +1042,7 @@ image_format_to_fourcc(int format)<br>
     /* Convert from __DRI_IMAGE_FORMAT to __DRI_IMAGE_FOURCC (sigh) */<br>
     switch (format) {<br>
     case __DRI_IMAGE_FORMAT_SARGB8: return __DRI_IMAGE_FOURCC_SARGB8888;<br>
+   case __DRI_IMAGE_FORMAT_SABGR8: return __DRI_IMAGE_FOURCC_SABGR8888;<br>
     case __DRI_IMAGE_FORMAT_RGB565: return __DRI_IMAGE_FOURCC_RGB565;<br>
     case __DRI_IMAGE_FORMAT_XRGB8888: return __DRI_IMAGE_FOURCC_XRGB8888;<br>
     case __DRI_IMAGE_FORMAT_ARGB8888: return __DRI_IMAGE_FOURCC_ARGB8888;<br>
diff --git a/src/mesa/drivers/dri/common/<wbr>dri_util.c b/src/mesa/drivers/dri/common/<wbr>dri_util.c<br>
index a34f38d611..214be4a3fc 100644<br>
--- a/src/mesa/drivers/dri/common/<wbr>dri_util.c<br>
+++ b/src/mesa/drivers/dri/common/<wbr>dri_util.c<br>
@@ -892,6 +892,8 @@ driGLFormatToImageFormat(mesa_<wbr>format format)<br>
        return __DRI_IMAGE_FORMAT_GR88;<br>
     case MESA_FORMAT_NONE:<br>
        return __DRI_IMAGE_FORMAT_NONE;<br>
+   case MESA_FORMAT_R8G8B8A8_SRGB:<br>
+      return __DRI_IMAGE_FORMAT_SABGR8;<br>
     case MESA_FORMAT_B8G8R8A8_SRGB:<br>
        return __DRI_IMAGE_FORMAT_SARGB8;<br>
     default:<br>
@@ -929,6 +931,8 @@ driImageFormatToGLFormat(uint3<wbr>2_t image_format)<br>
        return MESA_FORMAT_R16G16_UNORM;<br>
     case __DRI_IMAGE_FORMAT_SARGB8:<br>
        return MESA_FORMAT_B8G8R8A8_SRGB;<br>
+   case __DRI_IMAGE_FORMAT_SABGR8:<br>
+      return MESA_FORMAT_R8G8B8A8_SRGB;<br>
     case __DRI_IMAGE_FORMAT_NONE:<br>
        return MESA_FORMAT_NONE;<br>
     default:<br>
diff --git a/src/mesa/drivers/dri/common/<wbr>utils.c b/src/mesa/drivers/dri/common/<wbr>utils.c<br>
index 1cffd3ad08..fc5e2d19f3 100644<br>
--- a/src/mesa/drivers/dri/common/<wbr>utils.c<br>
+++ b/src/mesa/drivers/dri/common/<wbr>utils.c<br>
@@ -208,6 +208,7 @@ driCreateConfigs(mesa_format format,<br>
        masks = masks_table[2];<br>
        break;<br>
     case MESA_FORMAT_R8G8B8A8_UNORM:<br>
+   case MESA_FORMAT_R8G8B8A8_SRGB:<br>
        masks = masks_table[5];<br>
        break;<br>
     case MESA_FORMAT_R8G8B8X8_UNORM:<br>
<br>
</blockquote></div></div><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div>