diff mbox series

mesa: import patch from upstream to fix tools build on musl

Message ID 20230309103717.1235631-1-dmitry.baryshkov@linaro.org
State Accepted, archived
Commit 8bb91d97757f7a84e8ecdbb18457a9d3dcce6417
Headers show
Series mesa: import patch from upstream to fix tools build on musl | expand

Commit Message

Dmitry Baryshkov March 9, 2023, 10:37 a.m. UTC
Fix building the crashdec on the musl systems.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 ...e-unsigned-instead-of-uint-to-fix-mu.patch | 44 +++++++++++++++++++
 meta/recipes-graphics/mesa/mesa.inc           |  1 +
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch
diff mbox series

Patch

diff --git a/meta/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch b/meta/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch
new file mode 100644
index 000000000000..3ab22889bf1c
--- /dev/null
+++ b/meta/recipes-graphics/mesa/files/0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch
@@ -0,0 +1,44 @@ 
+From 8a5de0b6cf1090d7f29f3974ec79c32776cf2745 Mon Sep 17 00:00:00 2001
+From: Jami Kettunen <jami.kettunen@protonmail.com>
+Date: Tue, 31 Aug 2021 00:15:58 +0300
+Subject: [PATCH] freedreno/pm4: Use unsigned instead of uint to fix musl build
+
+Upstream-Status: Backport
+
+Fixes the following error I noticed when building against aarch64 with
+musl libc:
+
+  In file included from ../src/freedreno/decode/crashdec.h:38,
+                   from ../src/freedreno/decode/crashdec.c:40:
+  ../src/freedreno/common/freedreno_pm4.h:104:15: error: unknown type name 'uint'
+    104 | static inline uint
+        |               ^~~~
+  ../src/freedreno/common/freedreno_pm4.h:105:25: error: unknown type name 'uint'; did you mean 'int'?
+    105 | pm4_calc_odd_parity_bit(uint val)
+        |                         ^~~~
+        |                         int
+
+Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
+Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19665>
+---
+ src/freedreno/common/freedreno_pm4.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/freedreno/common/freedreno_pm4.h b/src/freedreno/common/freedreno_pm4.h
+index 8f958953d693..091247e709a0 100644
+--- a/src/freedreno/common/freedreno_pm4.h
++++ b/src/freedreno/common/freedreno_pm4.h
+@@ -105,8 +105,8 @@ pm4_pkt7_hdr(uint8_t opcode, uint16_t cnt)
+ #define cp_type3_opcode(pkt) (((pkt) >> 8) & 0xFF)
+ #define type3_pkt_size(pkt)  ((((pkt) >> 16) & 0x3FFF) + 1)
+ 
+-static inline uint
+-pm4_calc_odd_parity_bit(uint val)
++static inline unsigned
++pm4_calc_odd_parity_bit(unsigned val)
+ {
+    return (0x9669 >> (0xf & ((val) ^ ((val) >> 4) ^ ((val) >> 8) ^
+                              ((val) >> 12) ^ ((val) >> 16) ^ ((val) >> 20) ^
+-- 
+2.39.2
+
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
index 8a8a057c6bf8..c0b8f6562585 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 \
            file://0001-meson-misdetects-64bit-atomics-on-mips-clang.patch \
            file://0001-util-format-Check-for-NEON-before-using-it.patch \
            file://0001-gbm-backend-fix-gbm-compile-without-dri.patch \
+           file://0001-freedreno-pm4-Use-unsigned-instead-of-uint-to-fix-mu.patch \
            "
 
 SRC_URI[sha256sum] = "3eed2ecae2bc674494566faab9fcc9beb21cd804c7ba2b59a1694f3d7236e6a9"