From 282ade0f4be5aa05d1853ef5840971c2451a9346 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 2 Mar 2024 12:20:28 -0800 Subject: mesa,mesa-gl: Fix build when dri3 is not enabled Some machines e.g. odroid-c4 disable dri3 and it now fails to build mesa-gl e.g. | aarch64-yoe-linux-ld.lld: error: undefined symbol: dri3_check_multibuffer [3/5] | >>> referenced by drisw_glx.c | >>> libglx.a.p/drisw_glx.c.o:(driswCreateScreenDriver) in archive src/glx/libglx.a Apply patches from a pull request which is already submitted upstream (From OE-Core rev: c713b8458968815b1bb53d3523ee0af52a9f2945) Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- .../files/0001-drisw-fix-build-without-dri3.patch | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch (limited to 'meta/recipes-graphics/mesa/files/0001-drisw-fix-build-without-dri3.patch') 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 @@ +From 4bd15a419e892da843489c374c58c5b29c40b5d6 Mon Sep 17 00:00:00 2001 +From: Romain Naour +Date: Tue, 6 Feb 2024 09:47:09 +0100 +Subject: [PATCH 1/2] drisw: fix build without dri3 + +commit 1887368df41 ("glx/sw: check for modifier support in the kopper path") +added dri3_priv.h header and dri3_check_multibuffer() function in drisw that +can be build without dri3. + + i686-buildroot-linux-gnu/bin/ld: src/glx/libglx.a.p/drisw_glx.c.o: in function `driswCreateScreenDriver': + drisw_glx.c:(.text.driswCreateScreenDriver+0x3a0): undefined reference to `dri3_check_multibuffer' + collect2: error: ld returned 1 exit status + +Add HAVE_DRI3 guard around dri3_priv.h header and the zink code using +dri3_check_multibuffer(). + +Fixes: 1887368df41 ("glx/sw: check for modifier support in the kopper path") + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27478] +Signed-off-by: Romain Naour +Signed-off-by: Khem Raj +--- + src/glx/drisw_glx.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c +index 3d3f752..4b19e2d 100644 +--- a/src/glx/drisw_glx.c ++++ b/src/glx/drisw_glx.c +@@ -32,7 +32,9 @@ + #include + #include "dri_common.h" + #include "drisw_priv.h" ++#ifdef HAVE_DRI3 + #include "dri3_priv.h" ++#endif + #include + #include + #include +@@ -995,6 +997,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, + goto handle_error; + } + ++#ifdef HAVE_DRI3 + if (pdpyp->zink) { + bool err; + psc->has_multibuffer = dri3_check_multibuffer(priv->dpy, &err); +@@ -1005,6 +1008,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv, + goto handle_error; + } + } ++#endif + + glx_config_destroy_list(psc->base.configs); + psc->base.configs = configs; +-- +2.44.0 + -- cgit v1.2.3-54-g00ecf