diff options
-rw-r--r-- | recipes-graphics/mesa/files/0001-dri2-query-dma-buf-modifiers.patch | 45 | ||||
-rw-r--r-- | recipes-graphics/mesa/mesa_%.bbappend | 4 |
2 files changed, 49 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 @@ | |||
1 | mesa: querying dma_buf_modifiers for specific formats | ||
2 | |||
3 | mesa wl_drm protocol is the backend for wayland server side which requires | ||
4 | the dmabuf modifiers for some DRM formats on specific devices like RPI. | ||
5 | Currently there is no support of giving any dmabuf modifiers on wl_drm protocol. | ||
6 | This dma_buf modifiers allows EGL implementations to add extra attributes | ||
7 | to drm_fourcc format. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Balaji Velmurugan <balaji.velmurugan@ltts.com> | ||
12 | |||
13 | diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c | ||
14 | index 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 | ||
diff --git a/recipes-graphics/mesa/mesa_%.bbappend b/recipes-graphics/mesa/mesa_%.bbappend index eaa46f2..d3435e7 100644 --- a/recipes-graphics/mesa/mesa_%.bbappend +++ b/recipes-graphics/mesa/mesa_%.bbappend | |||
@@ -1,6 +1,10 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | ||
1 | # DRI3 note: | 2 | # DRI3 note: |
2 | # With oe-core commit 8509e2e1a87578882b71948ccef3b50ccf1228b3 dri3 is set | 3 | # With oe-core commit 8509e2e1a87578882b71948ccef3b50ccf1228b3 dri3 is set |
3 | # as default. To state out clearly that Raspi needs dri3 and to avoid surprises | 4 | # as default. To state out clearly that Raspi needs dri3 and to avoid surprises |
4 | # in case oe-core changes this default, we set dri3 explicitly. | 5 | # in case oe-core changes this default, we set dri3 explicitly. |
6 | |||
7 | SRC_URI_append_rpi = " file://0001-dri2-query-dma-buf-modifiers.patch " | ||
8 | |||
5 | PACKAGECONFIG_append_rpi = " gallium vc4 v3d kmsro ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)}" | 9 | PACKAGECONFIG_append_rpi = " gallium vc4 v3d kmsro ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'x11 dri3', '', d)}" |
6 | DRIDRIVERS_class-target_rpi = "" | 10 | DRIDRIVERS_class-target_rpi = "" |