[Mesa-dev] [PATCH] dri/i915, dri/i965: Fix support for planar images

Ander Conselvan de Oliveira conselvan2 at gmail.com
Tue Nov 12 04:47:08 PST 2013


From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>

Planar images have format __DRI_IMAGE_FORMAT_NONE, but the patch that
moved the conversion from dri_format to the mesa format made it
impossible to allocate a image with that format.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
---
 src/mesa/drivers/dri/i915/intel_screen.c |    3 ++-
 src/mesa/drivers/dri/i965/intel_screen.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index 2c309ed..a10331c 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -246,7 +246,8 @@ intel_allocate_image(int dri_format, void *loaderPrivate)
     image->offset = 0;
 
     image->format = driImageFormatToGLFormat(dri_format);
-    if (image->format == 0) {
+    if (dri_format != __DRI_IMAGE_FORMAT_NONE &&
+        image->format == MESA_FORMAT_NONE) {
        free(image);
        return NULL;
     }
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index e39d654..6bcfe2c 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -300,7 +300,8 @@ intel_allocate_image(int dri_format, void *loaderPrivate)
     image->offset = 0;
 
     image->format = driImageFormatToGLFormat(dri_format);
-    if (image->format == 0) {
+    if (dri_format != __DRI_IMAGE_FORMAT_NONE &&
+        image->format == MESA_FORMAT_NONE) {
        free(image);
        return NULL;
     }
-- 
1.7.9.5



More information about the mesa-dev mailing list