dri: Make query image WIDTH and HEIGHT be version 4
authorJakob Bornecrantz <jakob@vmware.com>
Tue, 21 Aug 2012 16:01:55 +0000 (18:01 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Sun, 26 Aug 2012 13:39:50 +0000 (15:39 +0200)
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
include/GL/internal/dri_interface.h
src/gbm/backends/dri/gbm_dri.c

index e7662264d9d0f22c6b347ad804269a6feecbc066..09f63ffdc964b260f21e82a20f311811b125d700 100644 (file)
@@ -945,7 +945,7 @@ struct __DRIdri2ExtensionRec {
 #define __DRI_IMAGE_ATTRIB_HANDLE      0x2001
 #define __DRI_IMAGE_ATTRIB_NAME                0x2002
 #define __DRI_IMAGE_ATTRIB_FORMAT      0x2003 /* available in versions 3+ */
-#define __DRI_IMAGE_ATTRIB_WIDTH       0x2004 /* available in versions 5+ */
+#define __DRI_IMAGE_ATTRIB_WIDTH       0x2004 /* available in versions 4+ */
 #define __DRI_IMAGE_ATTRIB_HEIGHT      0x2005
 
 typedef struct __DRIimageRec          __DRIimage;
index 59a3d8131653abde8368ff11d82dba58442a4a2a..1831f1377897c6159b3e2e4319fa8d63fed94b68 100644 (file)
@@ -365,6 +365,10 @@ gbm_dri_bo_import(struct gbm_device *gbm,
    unsigned dri_use = 0;
    int dri_format, width, height, gbm_format, stride, cpp, offset;
 
+   /* Required for query image WIDTH & HEIGHT */
+   if (dri->image->base.version < 4)
+      return NULL;
+
    switch (type) {
 #if HAVE_WAYLAND_PLATFORM
    case GBM_BO_IMPORT_WL_BUFFER: