Module: Mesa
Branch: main
Commit: 4f48a140ac9dc2d1581faed21ac07914c6744cb5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f48a140ac9dc2d1581faed21ac07914c6744cb5

Author: Alessandro Astone <[email protected]>
Date:   Wed Oct  4 23:31:26 2023 +0200

asahi: Use the compat version of qsort_r

Not all platforms define qsort_r, util_qsort_r takes care of that.

CC: mesa-stable
Acked-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25553>

---

 src/asahi/compiler/agx_register_allocate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/asahi/compiler/agx_register_allocate.c 
b/src/asahi/compiler/agx_register_allocate.c
index 8ee2f6a0fde..a5f9b2de947 100644
--- a/src/asahi/compiler/agx_register_allocate.c
+++ b/src/asahi/compiler/agx_register_allocate.c
@@ -8,6 +8,7 @@
 #include "agx_compiler.h"
 #include "agx_debug.h"
 #include "agx_opcodes.h"
+#include "util/u_qsort.h"
 
 /* SSA-based register allocator */
 
@@ -566,7 +567,7 @@ insert_copies_for_clobbered_killed(struct ra_ctx *rctx, 
unsigned reg,
       return;
 
    /* Sort by descending alignment so they are packed with natural alignment */
-   qsort_r(vars, nr_vars, sizeof(vars[0]), sort_by_size, rctx->sizes);
+   util_qsort_r(vars, nr_vars, sizeof(vars[0]), sort_by_size, rctx->sizes);
 
    /* Reassign in the destination region */
    unsigned base = reg;

Reply via email to