asahi: Use the compat version of qsort_r
authorAlessandro Astone <ales.astone@gmail.com>
Wed, 4 Oct 2023 21:31:26 +0000 (23:31 +0200)
committerEric Engestrom <eric@engestrom.ch>
Mon, 4 Dec 2023 21:36:35 +0000 (21:36 +0000)
Not all platforms define qsort_r, util_qsort_r takes care of that.

CC: mesa-stable
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25553>
(cherry picked from commit 4f48a140ac9dc2d1581faed21ac07914c6744cb5)

.pick_status.json
src/asahi/compiler/agx_register_allocate.c

index 2f716d8513aacea00eb6542755ea13df80b5e412..ea66f9767e92e9c6fcfdb6eeb06065ba0bf7e96c 100644 (file)
         "description": "asahi: Use the compat version of qsort_r",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
index 18f3f577bdd1b5ea704f2103fb9515be01c17b46..1952dadea223ae2bd2653424fd6c9c84a2d3953c 100644 (file)
@@ -4,6 +4,7 @@
  */
 
 #include "util/u_dynarray.h"
+#include "util/u_qsort.h"
 #include "agx_builder.h"
 #include "agx_compiler.h"
 #include "agx_debug.h"
@@ -564,7 +565,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;