[Mesa-dev] [PATCH 3/6] dri: Make query image WIDTH and HEIGHT be version 4

Jakob Bornecrantz jakob at vmware.com
Tue Aug 21 15:14:40 PDT 2012


Signed-off-by: Jakob Bornecrantz <jakob at vmware.com>
---
 include/GL/internal/dri_interface.h |    2 +-
 src/gbm/backends/dri/gbm_dri.c      |    4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index e766226..09f63ff 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -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;
diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
index 59a3d81..1831f13 100644
--- a/src/gbm/backends/dri/gbm_dri.c
+++ b/src/gbm/backends/dri/gbm_dri.c
@@ -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:
-- 
1.7.9.5



More information about the mesa-dev mailing list