summaryrefslogtreecommitdiffstats
path: root/recipes-graphics/mesa/mesa/0001-dri-add-createImageWithModifiers2-interface.patch
blob: 261c54cc2cf4bd46d24c1c0f9da5cc6cb7e5ca8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
From afd8b2f498a417de6ecdbd13045d97c9ecf4391b Mon Sep 17 00:00:00 2001
From: Simon Ser <contact@emersion.fr>
Date: Mon, 14 Dec 2020 18:32:47 +0100
Subject: [PATCH] dri: add createImageWithModifiers2 interface

With the addition of createImageWithModifiers usage flags were
dropped, as it was believed at the time that modifers will be a
full replacement for the usage flags. This has turned out to be
untrue, as modifiers are not able to describe buffer placement.

Add a new version of the interface, that allows to specifiy
use flags in addition to the modifier.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>
Upstream-Status: Applied [https://gitlab.freedesktop.org/mesa/mesa/-/commit/afd8b2f498a417de6ecdbd13045d97c9ecf4391b]
---
 include/GL/internal/dri_interface.h | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 9b85e67ce49..a7d9903f94e 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1328,7 +1328,7 @@ struct __DRIdri2ExtensionRec {
  * extensions.
  */
 #define __DRI_IMAGE "DRI_IMAGE"
-#define __DRI_IMAGE_VERSION 18
+#define __DRI_IMAGE_VERSION 19
 
 /**
  * These formats correspond to the similarly named MESA_FORMAT_*
@@ -1803,6 +1803,28 @@ struct __DRIimageExtensionRec {
                                           uint32_t flags,
                                           unsigned *error,
                                           void *loaderPrivate);
+
+   /**
+    * Creates an image with implementation's favorite modifiers and the
+    * provided usage flags.
+    *
+    * This acts like createImageWithModifiers except usage is also specified.
+    *
+    * 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 19
+    */
+   __DRIimage *(*createImageWithModifiers2)(__DRIscreen *screen,
+                                            int width, int height, int format,
+                                            const uint64_t *modifiers,
+                                            const unsigned int modifier_count,
+                                            unsigned int use,
+                                            void *loaderPrivate);
 };
 
 
-- 
2.31.1