[Mesa-dev] [PATCH 3/5] dri2: add picture structure.

Gwenole Beauchesne gb.devel at gmail.com
Mon Apr 23 02:54:13 PDT 2012


Add picture structure describing the DRI image. i.e. whether the DRI
image represents the whole picture or an interleaved (top/bottom field)
version.

This extension makes it possible to maintain stride and size calculations
internal to Mesa, while allowing for texturing interlaced contents. Some
implementations can have an explicit means to handle this case, or could
emulate it with 2*stride + extra bo offset to the selected field.
---
 include/GL/internal/dri_interface.h |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index a65ccc8..ea1328a 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -911,6 +911,11 @@ struct __DRIdri2ExtensionRec {
 #define __DRI_IMAGE_FORMAT_L8           0x1007
 #define __DRI_IMAGE_FORMAT_LA88         0x1008 /* luminance + alpha */
 
+/* Image structure: full picture or interlaced (top/bottom field) pictures */
+#define __DRI_IMAGE_STRUCTURE_FRAME     0x0000
+#define __DRI_IMAGE_STRUCTURE_TOP_FIELD 0x0001
+#define __DRI_IMAGE_STRUCTURE_BOTTOM_FIELD 0x0002
+
 #define __DRI_IMAGE_USE_SHARE		0x0001
 #define __DRI_IMAGE_USE_SCANOUT		0x0002
 #define __DRI_IMAGE_USE_CURSOR		0x0004
@@ -923,6 +928,7 @@ struct __DRIdri2ExtensionRec {
 #define __DRI_IMAGE_ATTRIB_HANDLE	0x2001
 #define __DRI_IMAGE_ATTRIB_NAME		0x2002
 #define __DRI_IMAGE_ATTRIB_FORMAT	0x2003 /* available in versions 3+ */
+#define __DRI_IMAGE_ATTRIB_STRUCTURE	0x2004 /* available in versions 4+ */
 
 typedef struct __DRIimageRec          __DRIimage;
 typedef struct __DRIimageAttrsRec     __DRIimageAttrs;
@@ -933,6 +939,7 @@ struct __DRIimageAttrsRec {
     unsigned int        width;
     unsigned int        height;
     unsigned int        pitch;
+    unsigned int        structure;
 };
 
 struct __DRIimageExtensionRec {
-- 
1.7.5.4



More information about the mesa-dev mailing list