Commit graph

2870 commits

Author SHA1 Message Date
Faith Ekstrand
3739d7a90c util: Don't advertise cache ops on x86 without SSE2
Fixes: 555881e574 ("util/cache_ops: Add some cache flush helpers")
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37958>
2025-10-22 03:36:10 +00:00
José Roberto de Souza
ad86a666ae anv: Add support for low latency hint on Xe KMD
This hint tells KMD and firmware to turn into low latency but high
power usage mode.
i915 already had it now it was implemented in Xe KMD.

Reviewed-by: Sushma Venkatesh Reddy <sushma.venkatesh.reddy@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33214>
2025-10-16 20:23:21 +00:00
Lionel Landwerlin
c20e2733bf Revert "brw: add serialize send stats"
This reverts commit b8ae4ede60 now that
we have a cycle estimation accounting.

Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37816>
2025-10-16 18:55:06 +00:00
Faith Ekstrand
a47184e396 util/cache_ops/x86: Call util_get_cpu_caps() less
This also makes all the paths a bit more clear because we only ever
clflushopt on the clflusopt paths and only ever clflush on the clflush
paths.  It's really not much more code or logic duplication.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37803>
2025-10-16 01:19:44 +00:00
Faith Ekstrand
555881e574 util/cache_ops: Add some cache flush helpers
The x86 implementation was shamelessly stolen from intel_mem.c and the
aarch64 implementaiton was based on the code in Turnip.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37803>
2025-10-16 01:19:44 +00:00
Alyssa Rosenzweig
84d8e6824b treewide: don't check before free
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This was something that came up in the slop MR. Not sure it's actually a
good idea or not but kind of curious what people think, given we have a
sound tool (Coccinelle) to do the transform. Saves a redundant branch
but means extra noninlined function calls.. likely no actual perf impact
but saves some code.

Via Coccinelle patches:

    @@
    expression ptr;
    @@

    -if (ptr) {
    -free(ptr);
    -}
    +free(ptr);

    @@
    expression ptr;
    @@

    -if (ptr) {
    -FREE(ptr);
    -}
    +FREE(ptr);

    @@
    expression ptr;
    @@

    -if (ptr) {
    -ralloc_free(ptr);
    -}
    +ralloc_free(ptr);

    @@
    expression ptr;
    @@

    -if (ptr != NULL) {
    -free(ptr);
    -}
    -
    +free(ptr);

    @@
    expression ptr;
    @@

    -if (ptr != NULL) {
    -FREE(ptr);
    -}
    -
    +FREE(ptr);

    @@
    expression ptr;
    @@

    -if (ptr != NULL) {
    -ralloc_free(ptr);
    -}
    -
    +ralloc_free(ptr);

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> [v3d]
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> [venus]
Reviewed-by: Frank Binns <frank.binns@imgtec.com> [powervr]
Reviewed-by: Janne Grunau <j@jannau.net> [asahi]
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> [radv]
Reviewed-by: Job Noorman <jnoorman@igalia.com> [ir3]
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Job Noorman <jnoorman@igalia.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37892>
2025-10-15 23:01:33 +00:00
Pierre-Eric Pelloux-Prayer
c0c95dc845 util: use F_DUPFD_QUERY on Linux
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
F_DUPFD_QUERY has been introduced in 6.10 exactly for the purpose
of telling if 2 fd points at the same file description so use it
first.

If it's not supported, we'll get r=-1 and errno=EINVAL, and we can
fallback on KCMP or epoll.

Acked-by: Simona Vetter <simona.vetter@ffwll.ch>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34447>
2025-10-15 07:58:12 +00:00
Pierre-Eric Pelloux-Prayer
17e286529b util: mimic KCMP_FILE via epoll when KCMP is missing
On Linux platforms where KCMP isn't allowed epoll can be used
as a fallback mechanism to provide the same feature.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34447>
2025-10-15 07:58:12 +00:00
Timothy Arceri
45a8cce5d6 util/range_remap: switch to using sorted array
Here we switch to using a sorted arrays for the binary search which
significantly speeds up the lookups. For a shader with ~8000
uniforms its up to 10x faster and the godot-tps-gles3-high.trace
in issue #13894 returns to its original runtime length before we
switched to using range remap in e052254066

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37754>
2025-10-15 02:16:36 +00:00
Timothy Arceri
2ea58908ae util/range_remap: add util_range_switch_to_sorted_array() helper
This creates an array of the linked list elements to be used for
faster binary searches in the following patch, and frees the old
linked list.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37754>
2025-10-15 02:16:36 +00:00
Timothy Arceri
f8326657f8 util/range_remap: use child memory context for list
This will allow us to easily free the list when we switch to
a sorted array in a following patch

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37754>
2025-10-15 02:16:35 +00:00
Timothy Arceri
9536de6eac util/range_remap: split list node from range entry
This will allow us to create an array of entries without the
node member in a following patch.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37754>
2025-10-15 02:16:34 +00:00
Timothy Arceri
754c6d0f54 glsl/util: update util_range_remap to use range_remap struct
This will allow us to use the linked list for validation of inserts
during linking then switch to using an array for fast binary searches.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37754>
2025-10-15 02:16:34 +00:00
Timothy Arceri
35d5e903ac util/range_remap: dont overwrite entry if ptr is NULL
If the ptr value is NULL and we match an existing entry during an
insert call we now just return the existing value. This allows us
to drop an extra lookup, this will become important as the
following patches change `util_range_remap()` lookups to use a
sorted array that is not created until after we have added all
entries to our linked list.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37754>
2025-10-15 02:16:33 +00:00
Rob Hughes
b79013ead9 llvmpipe: Work around WSL 1 missing support for memfd_create()
WSL version 1 has a known limitation that the kernel does not support
the memfd_create() syscall, and it always returns -1 (see
https://github.com/microsoft/WSL/issues/3542). This results in
lavapipe/llvmpipe failing to create the anonymous file it needs for
allocations from the pipe_screen object, which in turn results in
results in failed application calls to Vulkan APIs (in the case I
observed, vkMapMemory returned an invalid (0xffffffff) pointer along
with VK_SUCCESS, leading to the application segfaulting).

This issue can be reproduced by simply running `vkcube` (or, presumably
any other simple Vulkan application) inside WSL 1, e.g.:

xvfb-run -s '-screen 0 1024x768x24' vkcube --c 300

This patch addresses the issue with several changes:

1. llvmpipe_create_screen() now checks for errors from the
   os_create_anonymous_file function and errors out early, making it
   easier to track down issues similar to this. Previously, the invalid
   fd of -1 would be stored in the pipe_screen struct and the problems
   would only appear later.
2. os_create_anonymous_file() now attempts to handle the case where
   memfd_create() fails, by falling back to creating a file in a
   temporary directory. This fallback is the same as is already done for
   builds that don't have memfd_create available at build time - note
   that the difference here is that this is a _runtime_ fallback, as is
   needed for the case of WSL 1.
3. The fallback logic previously relied on the XDG_RUNTIME_DIR
   environment variable, which might not be set when running inside WSL
   because there is unlikely to be a desktop environment configured.
   This patch adds a fallback of creating a new directory inside /tmp in
   this case.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37679>
2025-10-14 17:40:12 +00:00
Lionel Landwerlin
b8ae4ede60 brw: add serialize send stats
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37394>
2025-10-10 11:19:39 +00:00
Olivia Lee
10a8defecc util/macros: coerce likely/unlikely to bool even without __builtin_expect
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Coercing the argument to a bool when we have __builtin_expect but
leaving it unmodified otherwise is a recipe for really subtle bugs. I
don't know if any bugs like that exist currently, but I almost
introduced one in panfrost.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37801>
2025-10-10 01:37:28 +00:00
Alyssa Rosenzweig
85207a4f6a util: add BITSET_CALLOC helper
comes up a bunch.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37779>
2025-10-09 12:29:55 +00:00
Lionel Landwerlin
3df4d86409 u_trace: use os_get_option instead of getenv
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tim Van Patten <timvp@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37740>
2025-10-08 16:00:49 +00:00
Rob Clark
e60d34fa78 freedreno: Disable explicit sync heuristic for Xwayland
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Xwayland seems to mix implicit and explicit sync, depending on client
app.  This trips up the heuristic that disables implicit sync once it
starts seeing app using explicit sync.  This is not typical behavior,
so add a driconf override to disable the heuristic.

Fixes: 137cd3b0fa ("freedreno/drm: Move no_implicit_sync accounting")
Cc: mesa-stable
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37703>
2025-10-06 15:55:48 +00:00
Timothy Arceri
db2126f8ef util: rewrite remap util to avoid looping list
Here we write the binary search to avoid looping over the list
by keeping track of the mid point entries and moving directly
from the last test point.

Fixes: bf946bcc ("util: add range remap util")

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37386>
2025-10-05 05:29:36 +00:00
Timothy Arceri
57ac68f616 util: add shortcut for range remap inserts
The user of this insert function often just inserts things in a
consecutive manner. So here we add a shortcut for inserting entries
at the tail of the list.

Fixes: bf946bccf2 ("util: add range remap util")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13894

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37386>
2025-10-05 05:29:36 +00:00
Alyssa Rosenzweig
c2ae207e80 brw,anv: use XML-based stats
I didn't bother switching either iris or elk/hasvk but one could.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37517>
2025-10-02 20:22:00 +00:00
Alyssa Rosenzweig
b575b0954a util/shader_stats: allow "hidden" stats
to allow drivers to do more complex printing without needing a subclass
paradigm. To be used on Intel.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37517>
2025-10-02 20:22:00 +00:00
Mel Henning
e7a62d5eff util/macros: Add ATTRIBUTE_COLD
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37475>
2025-09-26 19:40:45 +00:00
Georg Lehmann
4b24bc7c70 util: add util_round_down_npot
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37548>
2025-09-26 08:45:05 +00:00
Yonggang Luo
00783d821d meson/util: Define _GNU_SOURCE for mingw
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13944
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13906

Even though use -Dc_std=gnu18 -Dcpp_std=gnu++20 can also compile with mingw,
but for not bothering user, let's us define _GNU_SOURCE for mingw, and it's also
expose more functional that exists in mingw

As it's not a fixes just a improve so have no fixes in commit message

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
Tested-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37514>
2025-09-24 18:13:03 +00:00
Eric Engestrom
91e5e7d79d util/meson: make sure shader_stats.h is generated in time for anything that depends on mesautil
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37544>
2025-09-24 10:23:18 +00:00
Pierre-Eric Pelloux-Prayer
1b23a2ba80 util, vulkan: use u_overflow.h
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331>
2025-09-23 09:09:55 +02:00
Pierre-Eric Pelloux-Prayer
cfbf745a79 mesa: add u_overflow.h
It defines a couple of helpers to deal with signed and unsigned
integers overflow.

If __builtin_add_overflow (and others) intrinics are available
they're used, otherwise overflow checks are done manually.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37331>
2025-09-23 09:09:55 +02:00
Juston Li
867846d2bc android/gralloc0: add CROS_GRALLOC_DRM_GET_BUFFER_COLOR_INFO
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Implement retrieving color buffer info via gralloc0. This is a simpler
alternative to imapper4/5 which requires a dependency on libui that
would require a heavy effort to import headers and stub to be able to
build out of tree.

Since VNDK no longer releases headers since API Level 35 and they are
now only auto-generated, copy over the neccessary defines.

Signed-off-by: Juston Li <justonli@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37185>
2025-09-17 08:01:41 +00:00
Gurchetan Singh
08fb1c16b4 util: rust: spelling and whitespace fixes
Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37410>
2025-09-16 23:26:27 +00:00
Alyssa Rosenzweig
a2d14208b0 util: add unit tests for util/lut.h
Wasn't 100% sure about some of these derivations so let's add tests.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37200>
2025-09-16 21:48:37 +00:00
Alyssa Rosenzweig
95badb6b1d util: add boolean lookup table helpers
Many instruction sets (Intel, Apple, NVIDIA) implement bitwise operations with a
single general instruction that takes a lookup table in sum-of-products
(minterms) form. Working with these tables manually is a bit gnarly, and
multiple backends need to do this. This adds common code for representing such
lookup tables with 2- or 3-sources, with a rich set of helpers for building,
inspecting, and manipulating the LUTs.

Eventually, we may want to introduce a nir_op_bitop3 instruction to NIR to build
common code for fusing boolean expression trees into lookup tables. That NIR
pass will presumably use the helpers here.

NAK already has this abstraction internally (in Rust). Possibly NAK will be able
to drop (or cut down) that code once we handle this in NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37200>
2025-09-16 21:48:37 +00:00
Alyssa Rosenzweig
86a5dd10ac util: add util_bit_swap macro
We will use this to manipulate lookup tables, but it's a common algorithm.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37200>
2025-09-16 21:48:37 +00:00
Valentine Burley
ee56aed92d util: Disable Werror for BLAKE3
Avoid treating warnings as errors in the third-party BLAKE3 code.

Suggested-by: @eric

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35853>
2025-09-16 06:16:20 +00:00
Valentine Burley
8d2bb19c63 util: Update BLAKE3 from 1.5.1 to 1.8.2
Steps for uprev:
 - copy files from BLAKE3/c src/util/blake3/
 - edit README
 - `for file in *.asm; do mv "$file" "${file%.asm}.masm"; done`
 - keep
  - blake3.h (no relevant changes), only change BLAKE3_VERSION_STRING
  - blake3_sse2_x86-64_unix.S (no changes)
  - blake3_avx512_x86-64_unix.S (no changes)
  - blake3_sse41_x86-64_unix.S (no changes)

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35853>
2025-09-16 06:16:19 +00:00
Boris Brezillon
18f352090d util/format: Add a Z24_UNORM_PACKED format
Mali GPUs support Z24_UNORM stored on three bytes instead of four. Add
a new format for this case.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37158>
2025-09-15 10:59:04 +00:00
Boris Brezillon
f57cc49683 util/format: Autogen type conversion helpers
We are about to need new type converters for our AFBC mode selection
logic (AFBC is type agnostic, but we currently accept only UNORM
formats), so let's switch to an autogen solution for the existing ones,
and generate all missing type converters along the way.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37158>
2025-09-15 10:59:04 +00:00
Yonggang Luo
bd915eeb96 util: Fixes gcc warning: declaration of 'strndup' shadows a built-in function [-Wshadow]
../../src/util/strndup.h:37:1: warning: declaration of 'strndup' shadows a built-in function [-Wshadow]
   37 | strndup(const char *str, size_t max)
      | ^~~~~~~

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37289>
2025-09-13 08:23:07 +00:00
Samuel Pitoiset
c122d70dfd radv: set radv_gfx12_hiz_wa=partial for some games to mitigate performance loss
The full workaround can hurt performance and there is no other known
solution. The only one is to select which HiZ WA works the best by
trial and error.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174>
2025-09-11 15:21:50 +00:00
Samuel Pitoiset
b00b8c763b radv: disable radv_disable_hiz_his_gfx12 for Mafia Definition Edition
This should be properly fixed now. Also remove this drirc option which
should no longer be needed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174>
2025-09-11 15:21:50 +00:00
Samuel Pitoiset
5f8f4686bf radv: replace RADV_GFX12_HIZ_WA by a drirc option
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36174>
2025-09-11 15:21:50 +00:00
Ella Stanforth
01c7c97ef7 util/tests: Add list iterator tests
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37061>
2025-09-10 07:38:25 +00:00
Ella Stanforth
d943a91b71 util/list: Add iterator debug to more routines.
Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37061>
2025-09-10 07:38:24 +00:00
Ella Stanforth
6863223033 util/list: Fix next instruction removal usecase for non safe iterators
Introducing this iterator debug information breaks the usecase of removing
elements in the list other than the current element.

Fixes: 372e83b95f

Reviewed-by: Rob Clark <rob.clark@oss.qualcomm.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37061>
2025-09-10 07:38:24 +00:00
Timothy Arceri
bf946bccf2 util: add range remap util
This util allows a range of values to be remapped to a single
pointer.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36997>
2025-09-10 05:11:47 +00:00
Francisco Jerez
74168a601e util/ra: Allow driver to override class P value.
This is helpful for the driver to have the option to provide a custom
threshold for the PQ test performed by the graph coloring algorithm.

A threshold lower than the physical number of registers is helpful on
platforms where the number of registers used can impose a limit on the
thread parallelism of the program.  In such platforms even though a
passing PQ test guarantees that the node can be pushed onto the stack
and neglected while coloring the remaining nodes, the ordering in
which this happen can have a dramatic effect in the register pressure
of the resulting shader and therefore also on the thread parallelism
of the program.

Setting a P value threshold lower than the real P value will cause
nodes with Q value above the threshold to use the existing optimistic
coloring heuristic that takes the effort of ordering nodes in the
stack by Q value, in order to do a better job at minimizing the total
register requirement of the program.  Even though this causes us to
hit the optimistic codepaths for trivially colorable nodes the
interference graph is still guaranteed to be trivially colorable if it
was trivially colorable without the override.

The use of a threshold lower than the real P value will come at a
compile-time performance cost, the specific trade-off between
compile-time and run-time can be adjusted by the driver based on the
number of registers available to each thread without causing a hit to
thread parallelism.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36618>
2025-09-10 02:15:55 +00:00
Mel Henning
0d07b86073 util: Add range_minimum_query
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36184>
2025-09-08 23:03:13 +00:00
Faith Ekstrand
14c2afcb06 util/log: Add a MESA_LOG_LEVEL environment variable
This lets us control how much logging we want Mesa to do, which is
useful in CI where we don't want to collect lots of log spam that then
has to be saved somewhere.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37203>
2025-09-08 21:28:10 +00:00