diff options
author | Pablo Saavedra Rodi?o <psaavedra@igalia.com> | 2021-10-18 18:21:38 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-29 11:17:20 +0100 |
commit | 7b2b3f400282385b4183aeba1dcfcfa09c804c13 (patch) | |
tree | 78d32bbb465c198c1499219b03406eb7bb2eadf9 /meta/recipes-graphics | |
parent | a85f3639c48ffee7c93f7e5ced5127f51c59d3ca (diff) | |
download | poky-7b2b3f400282385b4183aeba1dcfcfa09c804c13.tar.gz |
mesa: gallium/dri Make YUV formats we're going to emulate external-only
This patch fixes the red label issues on video for Raspberry 4-64 Mesa VC4
driver and for iMX53 Adreno A200 GPU using the Mesa Freedreno driver.
Issue was originally reported in meta-webkit [1] and later contributed
in Mesa [2] where it was already merged in master.
[1] https://github.com/Igalia/meta-webkit/issues/185
[2] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038
(From OE-Core rev: 09f6038fbf479f8047fa566ff6b50bffc7a47f99)
Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r-- | meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch | 52 | ||||
-rw-r--r-- | meta/recipes-graphics/mesa/mesa.inc | 1 |
2 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch b/meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch new file mode 100644 index 0000000000..899450eb2a --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | commit 8bd63cd28939d79d6681943b840627eaa3614ee4 | ||
2 | Author: Pablo Saavedra <psaavedra@igalia.com> | ||
3 | Date: Mon Oct 18 15:48:42 2021 +0200 | ||
4 | |||
5 | gallium/dri: Make YUV formats we're going to emulate external-only. | ||
6 | |||
7 | If we're going to have to bind them as separate planes with colorspace | ||
8 | conversion for sampling on the frontend, then we need to report that | ||
9 | they're only for external-image samplers, otherwise the lowering won't be | ||
10 | applied. | ||
11 | |||
12 | Fixes: 4e3a7dcf ("gallium: enable EGL_EXT_image_dma_buf_import_modifiers unconditionally") | ||
13 | Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com> | ||
14 | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038> | ||
15 | |||
16 | Upstream-Status: Backport [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13038] | ||
17 | |||
18 | diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c | ||
19 | index b0c0d7e..ef8df5a 100644 | ||
20 | --- a/src/gallium/frontends/dri/dri2.c | ||
21 | +++ b/src/gallium/frontends/dri/dri2.c | ||
22 | @@ -1445,16 +1445,24 @@ dri2_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max, | ||
23 | |||
24 | format = map->pipe_format; | ||
25 | |||
26 | + bool native_sampling = pscreen->is_format_supported(pscreen, format, screen->target, 0, 0, | ||
27 | + PIPE_BIND_SAMPLER_VIEW); | ||
28 | if (pscreen->is_format_supported(pscreen, format, screen->target, 0, 0, | ||
29 | - PIPE_BIND_RENDER_TARGET) || | ||
30 | - pscreen->is_format_supported(pscreen, format, screen->target, 0, 0, | ||
31 | - PIPE_BIND_SAMPLER_VIEW) || | ||
32 | - dri2_yuv_dma_buf_supported(screen, map)) { | ||
33 | - if (pscreen->query_dmabuf_modifiers != NULL) | ||
34 | + PIPE_BIND_RENDER_TARGET) || | ||
35 | + native_sampling || | ||
36 | + dri2_yuv_dma_buf_supported(screen, map)) { | ||
37 | + if (pscreen->query_dmabuf_modifiers != NULL) { | ||
38 | pscreen->query_dmabuf_modifiers(pscreen, format, max, modifiers, | ||
39 | external_only, count); | ||
40 | - else | ||
41 | + if (!native_sampling && external_only) { | ||
42 | + /* To support it using YUV lowering, we need it to be samplerExternalOES. | ||
43 | + */ | ||
44 | + for (int i = 0; i < *count; i++) | ||
45 | + external_only[i] = true; | ||
46 | + } | ||
47 | + } else { | ||
48 | *count = 0; | ||
49 | + } | ||
50 | return true; | ||
51 | } | ||
52 | return false; | ||
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index a85f94c75e..7cba03cfcf 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc | |||
@@ -19,6 +19,7 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ | |||
19 | file://0002-meson.build-make-TLS-ELF-optional.patch \ | 19 | file://0002-meson.build-make-TLS-ELF-optional.patch \ |
20 | file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ | 20 | file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ |
21 | file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \ | 21 | file://0001-futex.h-Define-__NR_futex-if-it-does-not-exist.patch \ |
22 | file://0001-gallium-dri-Make-YUV-formats-we-re-going-to-emulate-.patch \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | SRC_URI[sha256sum] = "565c6f4bd2d5747b919454fc1d439963024fc78ca56fd05158c3b2cde2f6912b" | 25 | SRC_URI[sha256sum] = "565c6f4bd2d5747b919454fc1d439963024fc78ca56fd05158c3b2cde2f6912b" |