#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
*/
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
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;
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);
}
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;
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,
intel_query_image,
intel_dup_image,
intel_validate_usage,
- intel_image_write,
intel_create_sub_image
};