summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2012-01-18 15:32:35 -0500
committerKristian Høgsberg <[email protected]>2012-01-18 15:32:51 -0500
commit221c678329fd1c073d5f8dcf387129cd426ecf07 (patch)
tree2979d985c90dedac3f5ae427acbe4b761b1b4fd3 /src/mesa/drivers
parent2f868f1ddd636bc8d4cbcd5beeef1246cec80c65 (diff)
gbm: Validate usage flags in gbm_bo_create_from_egl_image()
The entry point is supposed to validate that the EGLImage is suitable for the passed in usage flags, but that was never implemented.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c16
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c2
2 files changed, 15 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 0566907fb3d..094ff568c44 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -324,14 +324,26 @@ intel_dup_image(__DRIimage *orig_image, void *loaderPrivate)
return image;
}
+static GLboolean
+intel_validate_usage(__DRIimage *image, unsigned int use)
+{
+ if (use & __DRI_IMAGE_USE_CURSOR) {
+ if (image->region->width != 64 || image->region->height != 64)
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
static struct __DRIimageExtensionRec intelImageExtension = {
- { __DRI_IMAGE, __DRI_IMAGE_VERSION },
+ { __DRI_IMAGE, 2 },
intel_create_image_from_name,
intel_create_image_from_renderbuffer,
intel_destroy_image,
intel_create_image,
intel_query_image,
- intel_dup_image
+ intel_dup_image,
+ intel_validate_usage
};
static const __DRIextension *intelScreenExtensions[] = {
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 2e364d02807..a5dff983aa9 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -375,7 +375,7 @@ radeon_query_image(__DRIimage *image, int attrib, int *value)
}
static struct __DRIimageExtensionRec radeonImageExtension = {
- { __DRI_IMAGE, __DRI_IMAGE_VERSION },
+ { __DRI_IMAGE, 1 },
radeon_create_image_from_name,
radeon_create_image_from_renderbuffer,
radeon_destroy_image,