Commit graph

72828 commits

Author SHA1 Message Date
Erik Faye-Lund
608d65db5b gallium/va: set up symlinks in build-dir
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Without this libva won't be able to find the driver without
LIBVA_DRIVER_NAME trickery, because the driver has a generic name.
But in the DRI case, even LIBVA_DRIVER_NAME won't do, because the driver
name needs to end with "_drv_video.so", which it doesn't.

So let's instead set up symlinks in the build-dir, like DRIL does.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40136>
2026-03-02 13:05:41 +00:00
Erik Faye-Lund
7e4744909b gallium/dri: set LIBVA_DRIVERS_PATH in devenv
We're setting this in the non-DRI codepath, but this was missed when we
started embedding the VA driver into libgallium. This means we no longer
were able to use VA-API from meson devenv, like we could before.

Fixes: 212d57f7e6 ("targets/va: Build va driver into libgallium when building with dri")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40136>
2026-03-02 13:05:41 +00:00
Patrick Lerda
dad942b468 r600: fix cs atomic operations when the shader is called multiple times
This change is useful when the compute shader is called multiple
times with the atomic operations enabled. It fixes some data
coherency issues. This is done by moving
evergreen_emit_atomic_buffer_setup() after r600_flush_emit().

This change is also a partial fix for compute_shader.pipeline-compute-chain.
In this specific case, it makes the memory barrier working.

This change was tested on cayman and barts; it makes these tests
fully deterministic:
khr-gl4[2-6]/shader_atomic_counters/advanced-usage-many-dispatches: fail pass
khr-gles31/core/shader_atomic_counters/advanced-usage-many-dispatches: fail pass
deqp-gles31/functional/synchronization/inter_call/without_memory_barrier/atomic_counter_dispatch_.*_calls_.*_invocations: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40037>
2026-03-02 12:29:30 +00:00
Pavel Ondračka
87a881558f r300: copy target when merging alpha output instruction
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The alpha instruction always wrote to the same rendertarget as the rgb and the
original target was ignored (surprisingly the HW docs explicitly allows rgb and
alpha to write to different targets). This makes tesseract rendering a bit
better, but there are still some remaining issues.

Fixes: 1c2c4ddbd1 ("r300g: copy the compiler from r300c")
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40128>
2026-03-02 11:13:52 +00:00
Pierre-Eric Pelloux-Prayer
82a51ba9b3 frontends/va: fix undefined ref error
When building with "-Dvideo-codecs=h264dec,h265dec,av1dec" va/encode.c
won't be built but it's still required because it's used from
picture.c

Fixes: c4f05bdf60 ("frontends/va: include picture_*.c based on selected codec")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39482>
2026-03-02 09:54:00 +01:00
Pierre-Eric Pelloux-Prayer
fea431ded3 radeonsi: remove nir references when graphics is disabled
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39482>
2026-03-02 09:53:58 +01:00
Pierre-Eric Pelloux-Prayer
4dc706ed5a radeonsi: use with_gfx_compute to disable parts of the driver
The disabled parts are unused when GL is disabled.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39482>
2026-03-02 09:53:56 +01:00
Pierre-Eric Pelloux-Prayer
731006bb8b radeonsi: move si_ps_key_update_framebuffer to si_state.c
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39482>
2026-03-02 09:53:50 +01:00
Pierre-Eric Pelloux-Prayer
b3cbc38a42 radeonsi: move buffer high-level functions to si_buffer.c
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39482>
2026-03-02 09:53:48 +01:00
Pierre-Eric Pelloux-Prayer
b97a6ae5ef radeonsi: split shaders/draw code from si_debug to a new file
Anything that depends on shaders is now part of si_debug_gfx_compute.c

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39482>
2026-03-02 09:53:45 +01:00
Pierre-Eric Pelloux-Prayer
15d52dff45 radeonsi: move mediump code to a separate compilation unit
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39482>
2026-03-02 09:53:43 +01:00
Christian Gmeiner
6135052145 etnaviv: Add S8_UINT texture format support for stencil texturing
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
On GPUs with ETNA_FEATURE_S8, the hardware supports native 8bpp
stencil buffers. The blob driver samples these as R8I (8-bit integer).

This enables the stencil blit fallback to work with pure S8_UINT
stencil buffers, fixing
dEQP-GLES3.functional.fbo.blit.depth_stencil.stencil_index8_scale

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39936>
2026-03-02 08:01:01 +00:00
Christian Gmeiner
ee7583a666 etnaviv: Implement stencil-only blit using util_blitter fallback
Previously, stencil-only blits were silently skipped with "cannot blit
stencil, skipping" because neither the BLT nor RS engines can
selectively copy individual channels from packed depth/stencil formats.

On HALTI5+ GPUs that support stencil texturing (S8X24_UINT), use
util_blitter_stencil_fallback() to perform a shader-based stencil blit.
This clears the destination stencil to zero, then copies each stencil
bit individually using draw calls with per-bit DSA write masks.

Fixes dEQP-GLES3.functional.fbo.blit.depth_stencil.depth24_stencil8_stencil_only

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39936>
2026-03-02 08:01:01 +00:00
Christian Gmeiner
7d7c164024 etnaviv: Mark TS config dirty after BLT blit
After a BLT blit invalidates the destination's tile status,
ETNA_DIRTY_DERIVE_TS was not set, so etna_update_ts_config() would not
run before the next draw. This caused TS_MEM_CONFIG to retain stale
DEPTH_FAST_CLEAR/DEPTH_COMPRESSION bits from the previous draw, even
though the destination depth data was overwritten by the blit.

This fixes depth/stencil blit tests like
dEQP-GLES3.functional.fbo.blit.depth_stencil.depth24_stencil8_basic.

The RS blit path already sets this dirty bit.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39936>
2026-03-02 08:01:00 +00:00
Rob Clark
1e1d8931c7 freedreno: Reduce advertised memory
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This matches what closed driver does, and avoids problems with CL CTS
allocation tests trying to use too much memory.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:04:30 -08:00
Rob Clark
f5c4dd0d93 freedreno: Use linear for 1d/1d_array
Trying to use UBWC for 1d causes problems with cl cts image writes.  And
also seems kind of pointless.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:04:30 -08:00
Rob Clark
2318599252 freedreno/a6xx: Rework flushing events
Adds missing FLUSH_CACHE event, and combines the flushing with existing
barrier emit to avoid duplicating flushes.

Fixes some flakeyness seen with UBWC images on gen8.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:02 -08:00
Rob Clark
2a751765e7 freedreno/a6xx: Don't emit epilogue per-tile
This was intended to run after _all_ tiles.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:02 -08:00
Rob Clark
19a91a6108 freedreno: Reuse last_fence when possible
Avoid creating a dummy batch in the non-TC (async-flush) path, if we can
re-use last_fence.

This avoids extra flushes with rusticl, which is not using TC.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:02 -08:00
Rob Clark
05e19b365f freedreno: Attach fence to last batch
When we have a sequence of batches to flush (ie. some batch, and all
it's dependent batches), attach a fence to the last in sequence.  This
helps avoid fd_context_flush() from creating an empty batch when it
needs to return a fence, but has nothing else left to flush.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:02 -08:00
Rob Clark
75b3f794a0 freedreno/a6xx: Fix num_groups programming
It would matter more if we used CP_RUN_OPENCL, as CP_EXEC_CS programs
these regs from the pm4 pkt payload.  But might as well at least program
correct values.

This at least makes it easier to compare cmdstream to closed cl driver,
which uses CP_RUN_OPENCL.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:02 -08:00
Rob Clark
97ae8a94d3 freedreno: Block rusticl on older gens
Currently pre-a6xx is missing ir3 support for various things that rusticl
requires, leading to segfaults.

For now, block compute-only contexts on older gens.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:01 -08:00
Rob Clark
560a160f05 freedreno: Flip logging to debug
Debug logging should be optimized out in release builds.  Somehow I
didn't notice that this wasn't the case.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:01 -08:00
Rob Clark
55606efdfc freedreno/a6xx: Barrier debug
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:01 -08:00
Rob Clark
48a82aa1ad freedreno: Fix stdout vs stderr logging
Everything else uses mesa_log*(), which uses stderr.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40144>
2026-03-01 08:00:01 -08:00
Rob Clark
b618b7e725 freedreno: Add missing cl_gl_sharing cap
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: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40140>
2026-03-01 14:34:36 +00:00
Christian Gmeiner
87fca4f51e etnaviv: Limit max line width to 1.0 on GPUs needing wide line emulation
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The HW line rasterizer on some Vivante GPUs doesn't produce
spec-conformant results for wide lines. Correct emulation via
triangle expansion is complex and interacts poorly with features
like primitive IDs, shader side effects (SSBOs, atomics), and
varying interpolation.

Rather than carrying fragile emulation, limit the advertised
max line width to 1.0 on affected GPUs. The GLES3 spec only
requires support for width 1.0, so this doesn't affect conformance.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Daniel Lang <dalang@gmx.at>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40006>
2026-03-01 11:34:56 +00:00
Marek Olšák
f22f117d1a amd: add meson variable idep_amd_generated_headers for all generated headers
group all generated header under the same variable

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40084>
2026-02-28 05:23:59 +00:00
Benjamin Cheng
2b2b1d405a radeonsi/vcn: Use full pitch for pre-encode input
In 1f83e73145, the pre-encode input picture size was also reduced.
However it was recently discovered that VCN FW uses the input picture
pitch as the pitch for this, which means that previous change broke
pre-encode.

Fixes: 1f83e73145 ("radeonsi/vcn: Reduce allocated size for pre-encode recon pics")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40125>
2026-02-27 10:27:27 +00:00
Loïc Molinari
16c9cc9d08 panfrost: Fix -Wunused-but-set-variable warnings using ASSERTED
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39994>
2026-02-26 17:09:34 +00:00
Loïc Molinari
51c953cea0 panfrost: Fix -Wunused-variable warnings using ASSERTED
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39994>
2026-02-26 17:09:33 +00:00
Loïc Molinari
862d621002 panfrost: Fix -Wunused-variable warning on arch > 7
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39994>
2026-02-26 17:09:33 +00:00
Rhys Perry
7c66adf97e ac/llvm: pass ac_cu_info to ac_llvm_context_init
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39992>
2026-02-26 15:49:15 +00:00
Rhys Perry
43603f9b1d amd: add ac_cu_info::local_invocation_ids_packed
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39992>
2026-02-26 15:49:15 +00:00
Rhys Perry
29f8237d30 amd: move various flags to ac_cu_info
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39992>
2026-02-26 15:49:14 +00:00
Rhys Perry
78b3e07bed ac/nir: remove ac_nir_lower_ps_late_options::family
This is unused.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39992>
2026-02-26 15:49:12 +00:00
Rhys Perry
6d31054d86 ac/nir: remove gfx_level parameter from ac_nir_lower_indirect_derefs
This was unused.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39992>
2026-02-26 15:49:12 +00:00
Luigi Santivetti
640bc3bc53 zink: fix format conversion logic for the alpha emulation case
cc: mesa-stable

Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com>
Fixes: 252bff0f ("zink: use real A8_UNORM when possible")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40118>
2026-02-26 15:22:42 +00:00
Lars-Ivar Hesselberg Simonsen
9cea0fd973 pan: Move buffer functions to pan_buffer
These don't really fit in pan_texture anymore, so move them to a
separate pan_buffer-file.

Acked-by: Eric R. Smith <eric.smith@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39294>
2026-02-26 13:27:12 +00:00
Christian Gmeiner
5e61368d3b etnaviv: Enable single-triangle blitter mode
Vivante hardware exhibits floating-point interpolation inconsistencies
at the diagonal seam when the blitter uses a two-triangle quad for scaled
NEAREST blits. Enable the single-triangle blitter mode to match the
proprietary driver's approach of using one oversized triangle
clipped by scissor.

Fixes dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_mag_*
Fixes dEQP-GLES3.functional.fbo.blit.rect.nearest_consistency_min_*

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39973>
2026-02-26 12:18:05 +00:00
Christian Gmeiner
ec41afc7aa u_blitter: Add single-triangle draw mode for NEAREST blit consistency
When the blitter draws a textured quad using two triangles, the
interpolation at the diagonal seam between triangles can produce
slightly different texture coordinates for the same pixel position.
For NEAREST filtering this causes inconsistent texel selection at the
seam boundary, failing dEQP-GLES3 nearest_consistency_* tests.

V3D already works around a similar issue by reordering triangle indices
(use_index_buffer), but Vivante GPUs requires a stronger fix: drawing a
single oversized triangle and relying on scissor to clip to the actual
destination rectangle. This matches the approach used by Vivante's
proprietary driver.

Add a new use_single_triangle flag to blitter_context that drivers can
opt-in.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39973>
2026-02-26 12:18:05 +00:00
Samuel Pitoiset
e8710152fb ac/nir: stop passing radeon_info for addr->coord helpers
Only for gb_addr_config.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40041>
2026-02-26 07:21:06 +00:00
Mike Blumenkrantz
788a8ab239 ntv: call nir_lower_variable_initializers() from ntv_shader_prepare
also assert that this has been called

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40102>
2026-02-25 23:11:37 +00:00
Mike Blumenkrantz
49d07b9ae6 ntv: run nir_remove_dead_variables during ntv_shader_prepare()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40102>
2026-02-25 23:11:37 +00:00
Mike Blumenkrantz
a6928eb015 ntv: re-gather shader info after ntv_shader_prepare
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40102>
2026-02-25 23:11:37 +00:00
Mike Blumenkrantz
6ed178ecd6 ntv: run nir_cleanup_functions() in ntv_shader_prepare()
this is better than leaving the inlined functions sitting around

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40102>
2026-02-25 23:11:37 +00:00
Pohsiang (John) Hsu
8aecdcffa5 mediafoundation: add workaround for max subregion number reported in slice auto mode
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40099>
2026-02-25 22:27:07 +00:00
Pohsiang (John) Hsu
d5bd6874f6 d3d12: add workaround for max subregion number reported in slice auto mode
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40099>
2026-02-25 22:27:07 +00:00
Pohsiang (John) Hsu
1b1cde9d39 mediafoundation: in slice generation mode, send METransformNeedInput
once per frame.

Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40099>
2026-02-25 22:27:07 +00:00
Mike Blumenkrantz
3ba275aa70 zink: add TRANSFER_WRITE -> HOST_READ sync to end of batch
this is technically required by spec, even though at a practical level
it probably has no effect

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40094>
2026-02-25 15:26:20 +00:00