dri: Remove image write function
authorJakob Bornecrantz <jakob@vmware.com>
Wed, 15 Aug 2012 09:37:18 +0000 (11:37 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Sun, 26 Aug 2012 13:39:41 +0000 (15:39 +0200)
Since its not used by anything anymore and no release has gone out
where it was being used.

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
src/mesa/drivers/dri/intel/intel_regions.h
src/mesa/drivers/dri/intel/intel_screen.c

index 97e1a1a44d58935343973053c3be16af9aba0e70..e7662264d9d0f22c6b347ad804269a6feecbc066 100644 (file)
@@ -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
@@ -984,13 +983,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
index 47874aede9c48794ba27c86407c5b1466fb99c4a..59a3d8131653abde8368ff11d82dba58442a4a2a 100644 (file)
@@ -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;
index 782d6696dcf1b649a2a9ec3f90cc066b8d101e00..4ff0efed72acbe0f5bce3a5aaeb226757426b1a2 100644 (file)
@@ -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;
index f4c16022c382b562811cb6281ab8c540a32cda98..103fcd257c1154571ca8156dbd53b050397830d3 100644 (file)
@@ -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
 };