[Mesa-dev] [PATCH 1/5] dri/image: Add a format modifier attributes query

Jason Ekstrand jason at jlekstrand.net
Wed Aug 16 19:30:55 UTC 2017


---
 include/GL/internal/dri_interface.h | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 2cbd738..a841872 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1178,7 +1178,7 @@ struct __DRIdri2ExtensionRec {
  * extensions.
  */
 #define __DRI_IMAGE "DRI_IMAGE"
-#define __DRI_IMAGE_VERSION 15
+#define __DRI_IMAGE_VERSION 16
 
 /**
  * These formats correspond to the similarly named MESA_FORMAT_*
@@ -1358,6 +1358,13 @@ enum __DRIChromaSiting {
 #define __BLIT_FLAG_FLUSH		0x0001
 #define __BLIT_FLAG_FINISH		0x0002
 
+/**
+ * queryDmaBufFormatModifierAttribs attributes
+ */
+
+/* Available in version 16 */
+#define __DRI_IMAGE_FORMAT_MODIFIER_ATTRIB_PLANE_COUNT   0x0001
+
 typedef struct __DRIimageRec          __DRIimage;
 typedef struct __DRIimageExtensionRec __DRIimageExtension;
 struct __DRIimageExtensionRec {
@@ -1598,6 +1605,24 @@ struct __DRIimageExtensionRec {
                                      int max, uint64_t *modifiers,
                                      unsigned int *external_only,
                                      int *count);
+
+   /**
+    * dmabuf format modifier attribute query for a given format and modifier.
+    *
+    * \param fourcc    The format to query. If this format is not supported by
+    *                  the driver, return false.
+    * \param modifier  The modifier to query. If this format+modifier is not
+    *                  supported by the driver, return false.
+    * \param attrib    The __DRI_IMAGE_FORMAT_MODIFIER_ATTRIB to query.
+    * \param value     A pointer to where to store the result of the query.
+    *
+    * Returns true upon success.
+    *
+    * \since 16
+    */
+   GLboolean (*queryDmaBufFormatModifierAttribs)(__DRIscreen *screen,
+                                                 int fourcc, uint64_t modifier,
+                                                 int attrib, uint64_t *value);
 };
 
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list