aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2012-07-04 22:56:09 -0400
committerKristian Høgsberg <[email protected]>2012-07-11 15:28:34 -0400
commitc0298348089069716cfc1aee2b25d0857c8be450 (patch)
treec20d129d8f384733478faf9343e11c9c273b3f06
parentc0f7fe7b79afa9b95b1af56dce9eb881575b1cde (diff)
__DRIimage: version 5, add new formats and createSubImage
The additions in version 5 enables creating EGLImages for different planes of a YUV buffer. createImageFromName is still used to create the containing __DRIimage, and createSubImage can then be used no that __DRIimage to create __DRIimages that correspond to the y, u, and v planes (__DRI_IMAGE_FORMAT_R8) or the uv planes (__DRI_IMAGE_FORMAT_RG88) for formats such as NV12 where the u and v components are interleaved. Packed formats such as YUYV etc doesn't require any special treatment, we just sample those as a regular ARGB texture. Signed-off-by: Kristian Høgsberg <[email protected]>
-rw-r--r--include/GL/internal/dri_interface.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 29c9a116136..82e5fde7f03 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -919,12 +919,19 @@ struct __DRIdri2ExtensionRec {
* tokens, except in the native endian of the CPU. For example, on
* little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
* MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
+ *
+ * __DRI_IMAGE_FORMAT_NONE is for images that aren't directly usable
+ * by the driver (YUV planar formats) but serve as a base image for
+ * creating sub-images for the different planes within the image.
*/
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
#define __DRI_IMAGE_FORMAT_ABGR8888 0x1004
#define __DRI_IMAGE_FORMAT_XBGR8888 0x1005
+#define __DRI_IMAGE_FORMAT_R8 0x1006 /* Since version 5 */
+#define __DRI_IMAGE_FORMAT_GR88 0x1007
+#define __DRI_IMAGE_FORMAT_NONE 0x1008
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
@@ -981,6 +988,26 @@ struct __DRIimageExtensionRec {
* \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
+ * sub-image shares the underlying buffer object with the parent
+ * image and other sibling sub-images, the life times of parent and
+ * sub-images are not dependent. Destroying the parent or a
+ * sub-image doesn't affect other images. The underlying buffer
+ * object is free when no __DRIimage remains that references it.
+ *
+ * Sub-images may overlap, but rendering to overlapping sub-images
+ * is undefined.
+ *
+ * \since 5
+ */
+ __DRIimage *(*createSubImage)(__DRIimage *image,
+ int width, int height, int format,
+ int offset, int pitch,
+ void *loaderPrivate);
};