[Mesa-stable] [PATCH 5/7] i965/screen: Don't advertise support for RG formats

Jason Ekstrand jason at jlekstrand.net
Wed Jun 6 17:47:39 UTC 2018


Cc: mesa-stable at lists.freedesktop.org
---
 src/mesa/drivers/dri/i965/intel_screen.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 5f0eeb41779..f681b221e7b 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -1269,6 +1269,18 @@ intel_image_format_is_supported(const struct intel_image_format *fmt)
        fmt->fourcc == __DRI_IMAGE_FOURCC_SABGR8888)
       return false;
 
+   /* The dri_interface.h file says:
+    *
+    *    "R8, GR88 and NONE should not be used with createImageFromName or
+    *    createImage, and are returned by query from sub images created with
+    *    createImageFromNames (NONE, see above) and fromPlane (R8 & GR88)."
+    *
+    * Let's not advertise support for R or RG formats.
+    */
+   if (fmt->components == __DRI_IMAGE_COMPONENTS_R ||
+       fmt->components == __DRI_IMAGE_COMPONENTS_RG)
+      return false;
+
    return true;
 }
 
-- 
2.17.1



More information about the mesa-stable mailing list