Commit graph

207059 commits

Author SHA1 Message Date
Faith Ekstrand
ffe6cdd52d compiler/rust/bitset: Don't reserve space in remove()
If the requested bit is past the end of the set, we can just return
false.  We don't have to grow the bitset.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:16 +00:00
Faith Ekstrand
81c9eddb69 compiler/rust/bitset: Add a BitIndex helper struct
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41915>
2026-06-01 19:51:16 +00:00
Mike Blumenkrantz
fa867cf189 zink/bo: check for usage before completion when reclaiming bos
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
checking completion alone disregards submit_count, which is used to
determine the validity of any existing usage pointer. this could lead to
large numbers of bos with stale usage and infinite memory ballooning

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:59 +00:00
Mike Blumenkrantz
cf1ca02bd0 zink/bo: use pb_buffer_lean to save a little mem
vtbl is not used

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:59 +00:00
Mike Blumenkrantz
47142da666 zink/bo: use only a single layer of slabs
this is simpler and apparently faster

ref cf2dc2d512

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:58 +00:00
Mike Blumenkrantz
d898eee030 zink/bo: stop using pb_buffer vtable for destroy
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:58 +00:00
Mike Blumenkrantz
6df38a29e1 zink/bo: add an enum to disambiguate bo types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:58 +00:00
Mike Blumenkrantz
4e000c1d98 zink/bo: reduce wasted memory due to the size tolerance in pb_cache
ref 5a3bacc376

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:58 +00:00
Mike Blumenkrantz
fce97b7f44 zink: handle uint wrapping with batch submit count
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41936>
2026-06-01 19:20:57 +00:00
Emma Anholt
10c227e934 tu: Always set the kernel's name for BOs.
Given the relative cost of the extra syscall and kmalloc for the name
versus actually allocating pages, we can just always do this and give a
better debugging experience by default.  We expect infrequent memory
allocation on Vulkan, anyway.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41878>
2026-06-01 18:32:10 +00:00
jglrxavpok
0ecffddaf0 RADV: Add object names inside address binding report and vm_fault
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41875>
2026-06-01 18:00:30 +00:00
Karmjit Mahil
3366fcff27 vc4: Use os_get_gpu_heap_size()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
b8786ccf64 pvr: Add heap_memory_percent driconf support
To use the common function, this gives up the warning about the
memory being too small to meet the Vulkan spec for low end
devices.

Note: the common helper expose 25% for devices with <=1GiB but
to adhere to the Vulkan spec, the value is clamped to 1GiB.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
16ab12fc5f crocus: Add heap_memory_percent driconf support
Note: the final `video_memory` size still involves
`aperture_threshold`.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
de3b96ccd8 nvk: Add heap_memory_percent driconf support
The budget calculation has changes slightly as the budget scaling
is applied prior to adding the used up heap memory.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
40076a2860 panfrost: Add heap_memory_percent driconf support
This also changes `video_memory` to use the heuristic instead of
the 10%, consistent with `max_mem_alloc_size`.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
1090dd8427 panvk: Add heap_memory_percent driconf support
The budget calculation has changes slightly as the budget scaling
is applied prior to adding the used up heap memory.

This also introduces a new tier since the common helper exposes
25% of memory as heap on devices with <=1GiB memory. Previously
50% was being used.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
77a7e390d4 freedreno: Add heap_memory_percent driconf support
Note: instead of using the common heuristic, the old behavior is
maintained.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
aa09887c54 tu: Add heap_memory_percent driconf support
Also remove the clamping to va_size in the budget calculation
since the heap_size is already clamped to va_size and the budget
is clamped to heap_size.

This also introduces a new tier since the common helper exposes
25% of memory as heap on devices with <=1GiB memory. Previously
50% was being used.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
f01837c8bb v3d: Add heap_memory_percent driconf support
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
72736c621a v3dv: Add heap_memory_percent driconf support
This also introduces a new tier since the common helper exposes
25% of memory as heap on devices with <=1GiB memory. Previously
50% was being used.

This also fixes `device->heap_used` not using atomic read.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
926dad811e asahi: Add heap_memory_percent driconf support
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
cda640d439 hk: Add heap_memory_percent driconf support
The budget calculation has changes slightly as the budget scaling
is applied prior to adding the used up heap memory.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Mary Guillemard <mary@mary.zone>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
0ce832347a vulkan: Add heap budget helper function
Some drivers scale the available memory proportionally to the
advertised heap memory. The `heap_memory_percent` driconf option
allows tweaking the percentage of system memory exposed as heap
memory, so drivers supporting this also need to scale their
budgets accordingly. So add `vk_gpu_heap_budget_from_system()`.

Some drivers just clamp the available memory to the heap size. This
is accounted for by having the `scale_with_heap` parameter.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Karmjit Mahil
1287fee6f7 util: Add heap_memory_percent driconf option
Also adds helper function to be used by drivers.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41242>
2026-06-01 17:32:50 +00:00
Serdar Kocdemir
475d1ea274 gfxstream: use VK_DRIVER_ID_MESA_GFXSTREAM as driver id
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41932>
2026-06-01 17:16:32 +00:00
Pohsiang (John) Hsu
85c12604b9 d3d12: add av1 handling to d3d12_video_encoder_get_encode_headers and d3d12_video_encoder_update_current_encoder_config_state_av1
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41834>
2026-06-01 16:32:02 +00:00
Caio Oliveira
74d38a6271 intel/gen: Change validation test code to use the parser
Assisted-by: Pi coding agent (GPT-5.5)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41918>
2026-06-01 16:02:41 +00:00
Sid Pranjale
020a6bc282 vulkan: implement VK_EXT_debug_marker
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32722>
2026-06-01 15:31:38 +00:00
Icenowy Zheng
d55418dae7 zink: check Z/S aspect before creating Z/S image view
When moving the code of creating image views to the init_sampler_view()
function, the check for Z/S aspect bits was forgotten to be added
(because it was a big if gating a lot of code originally).

When the driver doesn't have needs_zs_shader_swizzle set, this is not
problematic, because the condition for creating Z/S view is to have only
Z aspect; however the needs_zs_shader_swizzle case now fails because Z/S
views are now created for color images.

Fix the issue by re-adding the Z/S aspect check before checking
needs_zs_shader_swizzle flag.

Fixes: cafa22142b ("zink: create views for samplers lazily")
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41923>
2026-06-01 15:10:35 +00:00
Erik Faye-Lund
4b8ba6e27f pan/ci: add a couple of flakes
These are flakes.

The one that is moved from fails passes veeeery rarely, but it does
happen. Here's an example:

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/100611464

The other one is almost consistently failig. Example:

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/101218732

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41921>
2026-06-01 14:41:41 +00:00
Karol Herbst
05a6b192a5 asahi: fix fdiv lowering
Fixes: d3adef3164 ("agx: defer nir_opt_idiv_const")

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by Janne Grunau <j@jannau.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41386>
2026-06-01 13:43:01 +00:00
Karol Herbst
f509d9ab01 asahi: move batch flushing into agx_launch_internal
The CL CTS basic arraycopy test actually runs out of space there.

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by Janne Grunau <j@jannau.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41386>
2026-06-01 13:43:01 +00:00
Karol Herbst
bd7081747f asahi: fix compute blitter for float16 image copies
Fixes OpenCL CTS clCopyImage tests with CL_HALF_FLOAT

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by Janne Grunau <j@jannau.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41386>
2026-06-01 13:43:01 +00:00
Karol Herbst
8ac7e883cf asahi: fix dst range in buffer copy region
agx_batch_writes_range takes the offset within the buffer, not the address

Fixes: 4a3b905bb8 ("agx: move texture lowering into lib")

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by Janne Grunau <j@jannau.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41386>
2026-06-01 13:43:01 +00:00
Karol Herbst
d25e7e330f nir/lower_alu: fix lower_fminmax_signed_zero for denorms
When both inputs are denorms, the bcsel picks the integer min/max result,
which does not flush denorms and therefore might return the wrong result.

Fixes OpenCL fmin/fmax on asahi.

Fixes: d238d766c6 ("nir: add lower_fminmax_signed_zero")

Reviewed-by: Mary Guillemard <mary@mary.zone>
Reviewed-by Janne Grunau <j@jannau.net>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41386>
2026-06-01 13:43:01 +00:00
Ken Xue
641d9f35ae radv: remove checking on the gralloc handle->numFds
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
numFds could be no less than 1 based on the number of plane(s) and
metadata(optional) fd in a gralloc buf handle. and amdgpu backend
of gralloc should make sure all plane bufs within same dma_buf fd
but different offset.

handle->data[0] already indicates dma_buf fd of plane(s) well.

Signed-off-by: Ken Xue <Ken.Xue@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41879>
2026-06-01 11:33:53 +00:00
Patrick Lerda
fa5ce01ea3 r600: update muladd support configuration
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This change updates the configuration to fix some
regressions with the fpu64 emulation.

Note: The r600 has a single precision fma op code which
breaks the fpu64 emulation if used as nir_op_ffma (It
likely returns a double).

This change was tested on palm and barts.
Fixes: aeea2e7c1f ("nir: add fmad_or_ffma helpers and use it in lower_double_ops")

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41781>
2026-06-01 11:08:55 +00:00
Icenowy Zheng
19d786ae6a pipe-loader: use zink for powervr device nodes
The Mesa PowerVR driver is Vulkan only, and Zink is used solely for
APIs implemented by Gallium.

Change the driver name to "zink" if the device node's driver is
"powervr".

Backport-to: 26.1
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41737>
2026-06-01 09:32:08 +00:00
Icenowy Zheng
da11aac770 Revert "pipe-loader: fallback to zink instead of kmsro for render nodes"
This reverts commit adf18abb40.

Some setups rely on matching kmsro for render nodes (e.g. clients to
wlroot-based compositors).

Backport-to: 26.1
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41737>
2026-06-01 09:32:08 +00:00
Kenneth Graunke
405c99d0a6 jay: Add URB load support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:25 +00:00
Kenneth Graunke
9c8f7c481f brw: Fold constants after nir_lower_io for VS/GS/TES outputs
brw_nir_lower_deferred_urb_writes assumes that constant offsets will be
properly folded.  In brw itself we call the big optimization loop which
takes care of this, but jay doesn't do that in-between.

At any rate, nir_lower_io generates a lot of address math that really
ought to get cleaned up, so it seems like a good point to call it here.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:25 +00:00
Kenneth Graunke
fb99a109e4 brw: Fix mistake in brw_nir_lower_deferred_urb_writes
I meant to add these together, not put a random semicolon in the middle
of the expression which meant the offset got tossed on the floor.

Fixes: 6fbe201a12 ("brw: Convert VS/TES/GS outputs to URB intrinsics.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:25 +00:00
Kenneth Graunke
c798a9df1c brw: Refactor urb_read_length setting for TES
We now calculate it when emitting push input loads at the NIR level,
rather than in the backend.

v2: Fix missing interaction with legacy tesslevel remapping

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:24 +00:00
Kenneth Graunke
4dfa11a9d6 brw: Ensure entire input load fits in push data
We were seeing if the start of the load was within the push range,
rather than the entire load.  (We could also split loads, but that
seems needlessly complex.)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:24 +00:00
Kenneth Graunke
f4260b15cf brw: Fix URB read length for tessellation evaluation shaders
Calculate the end of our read as a byte offset and divide by the 32B
unit of URB reads.  We were calculating 1 byte beyond the start offset
and dividing by 8 (the number of 4 byte DWords in 1 unit of URB read).

Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:24 +00:00
Kenneth Graunke
887c04239f anv: Drop TES dispatch mode asserts
SIMD4x2 mode is only supported by elk which anv doesn't use.  iris
doesn't check this.  Eventually we should probably just demote the
dispatch_mode field to the stages that still need it.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
2026-06-01 08:30:23 +00:00
David Rosca
88577c5e54 ac/parse_ib: Add VCN timestamp command
Also remove OP_ prefix from other common commands.

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41861>
2026-06-01 07:34:11 +00:00
David Rosca
2aec2e8dba ac/parse_ib: Add VCN decode queue parsing
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41861>
2026-06-01 07:34:11 +00:00
Samuel Pitoiset
e32d518819 radv: cleanup conditional header includes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41865>
2026-06-01 06:35:31 +00:00