summaryrefslogtreecommitdiffstats
path: root/recipes-graphics/mesa/files/0001-dri2-query-dma-buf-modifiers.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-graphics/mesa/files/0001-dri2-query-dma-buf-modifiers.patch')
-rw-r--r--recipes-graphics/mesa/files/0001-dri2-query-dma-buf-modifiers.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/recipes-graphics/mesa/files/0001-dri2-query-dma-buf-modifiers.patch b/recipes-graphics/mesa/files/0001-dri2-query-dma-buf-modifiers.patch
new file mode 100644
index 0000000..3ff469d
--- /dev/null
+++ b/recipes-graphics/mesa/files/0001-dri2-query-dma-buf-modifiers.patch
@@ -0,0 +1,45 @@
1mesa: querying dma_buf_modifiers for specific formats
2
3mesa wl_drm protocol is the backend for wayland server side which requires
4the dmabuf modifiers for some DRM formats on specific devices like RPI.
5Currently there is no support of giving any dmabuf modifiers on wl_drm protocol.
6This dma_buf modifiers allows EGL implementations to add extra attributes
7to drm_fourcc format.
8
9Upstream-Status: Pending
10
11Signed-off-by: Balaji Velmurugan <balaji.velmurugan@ltts.com>
12
13diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
14index 6ce6f19..2f9d47d 100644
15--- a/src/gallium/state_trackers/dri/dri2.c
16+++ b/src/gallium/state_trackers/dri/dri2.c
17@@ -1368,14 +1368,28 @@ dri2_from_planar(__DRIimage *image, int plane, void *loaderPrivate)
18 return img;
19 }
20
21+static boolean
22+dri2_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
23+ uint64_t *modifiers, unsigned int *external_only,
24+ int *count);
25 static __DRIimage *
26 dri2_from_fds(__DRIscreen *screen, int width, int height, int fourcc,
27 int *fds, int num_fds, int *strides, int *offsets,
28 void *loaderPrivate)
29 {
30+ uint64_t modifier= DRM_FORMAT_MOD_INVALID;
31+ unsigned int external_only= 0;
32+ int count= 0;
33+ boolean result;
34+ result= dri2_query_dma_buf_modifiers( screen, fourcc, 1, &modifier, &external_only, &count);
35+ return dri2_create_image_from_fd(screen, width, height, fourcc,
36+ modifier, fds, num_fds,
37+ strides, offsets, NULL, loaderPrivate);
38+ #if 0
39 return dri2_create_image_from_fd(screen, width, height, fourcc,
40 DRM_FORMAT_MOD_INVALID, fds, num_fds,
41 strides, offsets, NULL, loaderPrivate);
42+ #endif
43 }
44
45 static boolean