diff options
3 files changed, 102 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch b/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch new file mode 100644 index 0000000000..ab16152090 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Romain Naour <romain.naour@smile.fr> | ||
| 3 | Date: Tue, 6 Feb 2024 09:47:09 +0100 | ||
| 4 | Subject: [PATCH 1/2] drisw: fix build without dri3 | ||
| 5 | |||
| 6 | commit 1887368df41 ("glx/sw: check for modifier support in the kopper path") | ||
| 7 | added dri3_priv.h header and dri3_check_multibuffer() function in drisw that | ||
| 8 | can be build without dri3. | ||
| 9 | |||
| 10 | i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver': | ||
| 11 | drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer' | ||
| 12 | collect2: error: ld returned 1 exit status | ||
| 13 | |||
| 14 | Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using | ||
| 15 | dri3_check_multibuffer(). | ||
| 16 | |||
| 17 | Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path") | ||
| 18 | |||
| 19 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] | ||
| 20 | Signed-off-by: Romain Naour <romain.naour@smile.fr> | ||
| 21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 22 | --- | ||
| 23 | src/glx/drisw_glx.c | 4 ++++ | ||
| 24 | 1 file changed, 4 insertions(+) | ||
| 25 | |||
| 26 | diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c | ||
| 27 | index 3d3f752..4b19e2d 100644 | ||
| 28 | --- a/src/glx/drisw_glx.c | ||
| 29 | +++ b/src/glx/drisw_glx.c | ||
| 30 | @@ -32,7 +32,9 @@ | ||
| 31 | #include <dlfcn.h> | ||
| 32 | #include "dri_common.h" | ||
| 33 | #include "drisw_priv.h" | ||
| 34 | +#ifdef HAVE_DRI3 | ||
| 35 | #include "dri3_priv.h" | ||
| 36 | +#endif | ||
| 37 | #include <X11/extensions/shmproto.h> | ||
| 38 | #include <assert.h> | ||
| 39 | #include <vulkan/vulkan_core.h> | ||
| 40 | @@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, | ||
| 41 | goto handle_error; | ||
| 42 | } | ||
| 43 | |||
| 44 | +#ifdef HAVE_DRI3 | ||
| 45 | if (pdpyp->zink) { | ||
| 46 | bool err; | ||
| 47 | psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err); | ||
| 48 | @@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, | ||
| 49 | goto handle_error; | ||
| 50 | } | ||
| 51 | } | ||
| 52 | +#endif | ||
| 53 | |||
| 54 | glx_config_destroy_list(psc->base.configs); | ||
| 55 | psc->base.configs = configs; | ||
| 56 | -- | ||
| 57 | 2.44.0 | ||
| 58 | |||
diff --git a/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch b/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch new file mode 100644 index 0000000000..036a0b4945 --- /dev/null +++ b/meta/recipes-graphics/mesa/files/0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 62495ebb977866c52d5bed8499a547c49f0d9bc1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Romain Naour <romain.naour@smile.fr> | ||
| 3 | Date: Tue, 6 Feb 2024 09:47:10 +0100 | ||
| 4 | Subject: [PATCH 2/2] glxext: don't try zink if not enabled in mesa | ||
| 5 | |||
| 6 | Commit 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") | ||
| 7 | added an automatic zink fallback even when the zink gallium is not | ||
| 8 | enabled at build time. | ||
| 9 | |||
| 10 | It leads to unexpected error log while loading drisw driver and | ||
| 11 | zink is not installed on the rootfs: | ||
| 12 | |||
| 13 | MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so | ||
| 14 | |||
| 15 | Fixes: 7d9ea77b459 ("glx: add automatic zink fallback loading between hw and sw drivers") | ||
| 16 | |||
| 17 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] | ||
| 18 | Signed-off-by: Romain Naour <romain.naour@smile.fr> | ||
| 19 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 20 | --- | ||
| 21 | src/glx/glxext.c | 2 ++ | ||
| 22 | 1 file changed, 2 insertions(+) | ||
| 23 | |||
| 24 | diff --git a/src/glx/glxext.c b/src/glx/glxext.c | ||
| 25 | index 05c825a..7a06aa9 100644 | ||
| 26 | --- a/src/glx/glxext.c | ||
| 27 | +++ b/src/glx/glxext.c | ||
| 28 | @@ -908,9 +908,11 @@ __glXInitialize(Display * dpy) | ||
| 29 | #endif /* HAVE_DRI3 */ | ||
| 30 | if (!debug_get_bool_option("LIBGL_DRI2_DISABLE", false)) | ||
| 31 | dpyPriv->dri2Display = dri2CreateDisplay(dpy); | ||
| 32 | +#if defined(HAVE_ZINK) | ||
| 33 | if (!dpyPriv->dri3Display && !dpyPriv->dri2Display) | ||
| 34 | try_zink = !debug_get_bool_option("LIBGL_KOPPER_DISABLE", false) && | ||
| 35 | !getenv("GALLIUM_DRIVER"); | ||
| 36 | +#endif /* HAVE_ZINK */ | ||
| 37 | } | ||
| 38 | #endif /* GLX_USE_DRM */ | ||
| 39 | if (glx_direct) | ||
| 40 | -- | ||
| 41 | 2.44.0 | ||
| 42 | |||
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc index cdac01d3aa..e5fa0a76d2 100644 --- a/meta/recipes-graphics/mesa/mesa.inc +++ b/meta/recipes-graphics/mesa/mesa.inc | |||
| @@ -18,6 +18,8 @@ SRC_URI = "https://mesa.freedesktop.org/archive/mesa-${PV}.tar.xz \ | |||
| 18 | file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ | 18 | file://0001-meson.build-check-for-all-linux-host_os-combinations.patch \ |
| 19 | file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ | 19 | file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \ |
| 20 | file://0001-gallium-Fix-build-with-llvm-17.patch \ | 20 | file://0001-gallium-Fix-build-with-llvm-17.patch \ |
| 21 | file://0001-drisw-fix-build-without-dri3.patch \ | ||
| 22 | file://0002-glxext-don-t-try-zink-if-not-enabled-in-mesa.patch \ | ||
| 21 | " | 23 | " |
| 22 | 24 | ||
| 23 | SRC_URI[sha256sum] = "f387192b08c471c545590dd12230a2a343244804b5fe866fec6aea02eab57613" | 25 | SRC_URI[sha256sum] = "f387192b08c471c545590dd12230a2a343244804b5fe866fec6aea02eab57613" |
