dri/i915, dri/i965: Fix support for planar images
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 12 Nov 2013 12:47:08 +0000 (14:47 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 12 Nov 2013 23:57:39 +0000 (15:57 -0800)
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@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
src/mesa/drivers/dri/i915/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.c

index 2c309ed4a16fdc774bdff934ca7bf1e0017ecc9b..a10331cea0b50773f63942830824205b170be825 100644 (file)
@@ -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;
     }
index e39d6545970856ec3ddcae6c5f3df9384071caf1..6bcfe2c311559166a61501ddfc46025973e9e21c 100644 (file)
@@ -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;
     }