summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2016-11-04 11:31:15 -0700
committerBen Widawsky <ben@bwidawsk.net>2017-03-15 10:36:04 -0700
commitd075cce25888f276986bd78c74bc3e029cb29e46 (patch)
treee58c1c160a5f60360c07d0e2c86b54a243a8e03b /include
parent0550f3d6313a95552da0be4a52f42fb99ea2c136 (diff)
dri: Add an image creation with modifiers
Modifiers will be obtained or guessed by the client and passed in during image creation/import. In guessing, a client might decide to simply pass along all known modifiers This requires bumping the DRIimage version. As of this patch, the modifiers aren't plumbed all the way down, this patch simply makes sure the interface level stuff is correct. v2: Don't allow usage + modifiers v3: Make NAND actually NAND. Bug introduced in v2. (Jason) v4: - s/obtains/obtained (Jason) - Pull out i965 imlemnentation into a later patch (Emil) Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/GL/internal/dri_interface.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 598d111f33a..53fac6fc3c9 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1136,7 +1136,7 @@ struct __DRIdri2ExtensionRec {
* extensions.
*/
#define __DRI_IMAGE "DRI_IMAGE"
-#define __DRI_IMAGE_VERSION 13
+#define __DRI_IMAGE_VERSION 14
/**
* These formats correspond to the similarly named MESA_FORMAT_*
@@ -1257,6 +1257,8 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_ATTRIB_NUM_PLANES 0x2009 /* available in versions 11 */
#define __DRI_IMAGE_ATTRIB_OFFSET 0x200A /* available in versions 13 */
+#define __DRI_IMAGE_ATTRIB_MODIFIER_LOWER 0x200B /* available in versions 14 */
+#define __DRI_IMAGE_ATTRIB_MODIFIER_UPPER 0x200C /* available in versions 14 */
enum __DRIYUVColorSpace {
__DRI_YUV_COLOR_SPACE_UNDEFINED = 0,
@@ -1468,6 +1470,29 @@ struct __DRIimageExtensionRec {
*/
void (*unmapImage)(__DRIcontext *context, __DRIimage *image, void *data);
+
+ /**
+ * Creates an image with implementation's favorite modifiers.
+ *
+ * This acts like createImage except there is a list of modifiers passed in
+ * which the implementation may selectively use to create the DRIimage. The
+ * result should be the implementation selects one modifier (perhaps it would
+ * hold on to a few and later pick).
+ *
+ * The created image should be destroyed with destroyImage().
+ *
+ * Returns the new DRIimage. The chosen modifier can be obtained later on
+ * and passed back to things like the kernel's AddFB2 interface.
+ *
+ * \sa __DRIimageRec::createImage
+ *
+ * \since 14
+ */
+ __DRIimage *(*createImageWithModifiers)(__DRIscreen *screen,
+ int width, int height, int format,
+ const uint64_t *modifiers,
+ const unsigned int modifier_count,
+ void *loaderPrivate);
};