From 6bb71b8cbe6b17a5d59e369631502e642804406e Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 15 Aug 2012 11:37:18 +0200 Subject: [PATCH] dri: Remove image write function Since its not used by anything anymore and no release has gone out where it was being used. Tested-by: Scott Moreau Signed-off-by: Jakob Bornecrantz --- include/GL/internal/dri_interface.h | 10 +--------- src/gbm/backends/dri/gbm_dri.c | 2 -- src/mesa/drivers/dri/intel/intel_regions.h | 1 - src/mesa/drivers/dri/intel/intel_screen.c | 28 ---------------------------- 4 files changed, 1 insertion(+), 40 deletions(-) diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 97e1a1a..e766226 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -935,8 +935,7 @@ struct __DRIdri2ExtensionRec { #define __DRI_IMAGE_USE_SHARE 0x0001 #define __DRI_IMAGE_USE_SCANOUT 0x0002 -#define __DRI_IMAGE_USE_CURSOR 0x0004 -#define __DRI_IMAGE_USE_WRITE 0x0008 +#define __DRI_IMAGE_USE_CURSOR 0x0004 /* Depricated */ /** * queryImage attributes @@ -985,13 +984,6 @@ struct __DRIimageExtensionRec { GLboolean (*validateUsage)(__DRIimage *image, unsigned int use); /** - * Write data into image. - * - * \since 4 - */ - int (*write)(__DRIimage *image, const void *buf, size_t count); - - /** * Create an image out of a sub-region of a parent image. This * entry point lets us create individual __DRIimages for different * planes in a planar buffer (typically yuv), for example. While a diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index 47874ae..59a3d81 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -515,8 +515,6 @@ gbm_dri_bo_create(struct gbm_device *gbm, dri_use |= __DRI_IMAGE_USE_SCANOUT; if (usage & GBM_BO_USE_CURSOR_64X64) dri_use |= __DRI_IMAGE_USE_CURSOR; - if (usage & GBM_BO_USE_WRITE) - dri_use |= __DRI_IMAGE_USE_WRITE; /* Gallium drivers requires shared in order to get the handle/stride */ dri_use |= __DRI_IMAGE_USE_SHARE; diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h index 782d669..4ff0efe 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.h +++ b/src/mesa/drivers/dri/intel/intel_regions.h @@ -144,7 +144,6 @@ intel_region_get_aligned_offset(struct intel_region *region, uint32_t x, struct __DRIimageRec { struct intel_region *region; GLenum internal_format; - uint32_t usage; uint32_t dri_format; GLuint format; uint32_t offset; diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index f4c1602..103fcd2 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -339,13 +339,7 @@ intel_create_image(__DRIscreen *screen, tiling = I915_TILING_NONE; } - /* We only support write for cursor drm images */ - if ((use & __DRI_IMAGE_USE_WRITE) && - use != (__DRI_IMAGE_USE_WRITE | __DRI_IMAGE_USE_CURSOR)) - return NULL; - image = intel_allocate_image(format, loaderPrivate); - image->usage = use; cpp = _mesa_get_format_bytes(image->format); image->region = intel_region_alloc(intelScreen, tiling, cpp, width, height, true); @@ -399,7 +393,6 @@ intel_dup_image(__DRIimage *orig_image, void *loaderPrivate) } image->internal_format = orig_image->internal_format; - image->usage = orig_image->usage; image->dri_format = orig_image->dri_format; image->format = orig_image->format; image->offset = orig_image->offset; @@ -416,29 +409,9 @@ intel_validate_usage(__DRIimage *image, unsigned int use) return GL_FALSE; } - /* We only support write for cursor drm images */ - if ((use & __DRI_IMAGE_USE_WRITE) && - use != (__DRI_IMAGE_USE_WRITE | __DRI_IMAGE_USE_CURSOR)) - return GL_FALSE; - return GL_TRUE; } -static int -intel_image_write(__DRIimage *image, const void *buf, size_t count) -{ - if (image->region->map_refcount) - return -1; - if (!(image->usage & __DRI_IMAGE_USE_WRITE)) - return -1; - - drm_intel_bo_map(image->region->bo, true); - memcpy(image->region->bo->virtual, buf, count); - drm_intel_bo_unmap(image->region->bo); - - return 0; -} - static __DRIimage * intel_create_sub_image(__DRIimage *parent, int width, int height, int dri_format, @@ -490,7 +463,6 @@ static struct __DRIimageExtensionRec intelImageExtension = { intel_query_image, intel_dup_image, intel_validate_usage, - intel_image_write, intel_create_sub_image }; -- 2.7.4