Commit graph

69319 commits

Author SHA1 Message Date
Marek Olšák
20e5c35cfe radeonsi: gather uses_discard from shader variants
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
de6ca8c7ec radeonsi: gather writes_z/stencil/sample_mask as shader variant info
si_get_shader_variant_info doesn't need to check the kill flags because
killed stores are removed from NIR before that.

Only shader variants need to clear the writes_* flags if the epilog kills
them.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
a9ac95fc0a radeonsi: gather uses_gs_state_provoking_vtx_first/outprim from the shader
Just use nir_def_bits_used() instead of the manually written conditions.

These are gathered from bits of load_scalar_arg(vs_state_bits):
- uses_vs_state_indexed
- uses_gs_state_provoking_vtx_first
- uses_gs_state_outprim

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
b85984d2b5 radeonsi: gather VS system value usage from shader variants
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
3b276e4ba6 radeonsi: move gathering VMEM information into si_get_shader_variant_info
This is a step towards gathering shader info from shader variants instead of
input NIR.

uses_fbfetch_output can be ignored because it's already lowered to image
loads.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
c59fc30fee radeonsi: always gather shader variant info
All shaders will eventually have their info there, not just FS.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
e114b9b11c radeonsi: don't return progress from run_pre_link_optimization_passes
We will always gather shader info after it, so always optimize instead of
returning progress.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
3d6747f6e0 radeonsi: determine uses_vmem_load_other more accurately
Some opcodes don't load from memory.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
bcd0679258 radeonsi: remove si_shader_info::uses_indirect_descriptor
It shouldn't affect uses_vmem_load_other because divergent descriptors
are loaded with SMEM in waterfall loops.

Also all this removed code is highly questionable. Indirect access doesn't
matter for anything. Divergent access does, and that's handled correctly.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
970825258e radeonsi: restructure si_get_shader_variant_info
iterate over instructions outside of the conditional.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Marek Olšák
f5bc1ebc11 radeonsi: don't check sel->nir in si_init_shader_selector_async
It's always non-NULL.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34492>
2025-05-14 20:19:16 +00:00
Erik Faye-Lund
df38cdce53 gallium/aux: fixup bad indent
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34954>
2025-05-14 16:33:12 +00:00
Erik Faye-Lund
8e48db3028 r600: ingest u_blitter_clear_buffer
r600 is the only driver using this functionality, so let's move it there.

There's a few functions we used that aren't available outside of
u_blitter.c, but it turns out these aren't really needed. The first one
is blitter_check_saved_vertex_states(), that one just verifies that
certain states are saved as they should be. It's a bit sad to lose these
checks, but they are currently always passing, so nothing should break
by dropping them right now.

The second one is blitter_disable_render_cond(), and this one is also OK
to drop, because r600 never calls util_blitter_save_render_condition()
in the first place.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34954>
2025-05-14 16:33:12 +00:00
Erik Faye-Lund
20986b77f3 gallium/aux: move util_pipe_tex_to_tgsi_tex to u_blitter.c
This is the only place this is called from, and this allows us to avoid
a TGSI specific include from generic code.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34954>
2025-05-14 16:33:12 +00:00
Christoph Pillmayer
b115850ece panfrost: Remove unused ls_sb_slot from contexts
ls_sb_slot is unused now in cs_tracing_ctx and cs_exception_handler_ctx.
Let's remove it.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34808>
2025-05-14 14:03:29 +00:00
Christoph Pillmayer
82f36cd8e3 panfrost: Make ls tracker mandatory in cs_builder
This commit moves cs_load_store_tracker from the cs_builder_conf
to cs_builder and makes it no longer optional to supply.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34808>
2025-05-14 14:03:29 +00:00
Georg Lehmann
33b5d8b2ec radeonsi: always lower alu bit sizes
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13072

load_vs_input_from_vertex_buffer can create unsupported 16bit shifts on GFX6/7.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34946>
2025-05-14 07:42:23 +00:00
Mary Guillemard
53f780ec91 panfrost: Remove progress_increment from all CS builders
Progression logic is deprecated since v11 and we don't plan to use it.
Let's get ride of all increment logic on all instructions.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34947>
2025-05-14 07:16:36 +00:00
Patrick Lerda
769510f1cc r600: implement EXT_shader_image_load_store
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Evergreen and cayman have the hardware support for this extension.
This is described by the manual as EXPORT_RAT_INST_INC_UINT_RTN
and EXPORT_RAT_INST_DEC_UINT_RTN.

This change was tested and passes the piglit tests (17/17)
on cypress, palm and cayman.

Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34501>
2025-05-14 01:23:54 +00:00
Marek Olšák
81bdf1ace6 nir: remove unnecessary (nir_shader *) typecasts
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34489>
2025-05-13 15:38:37 +00:00
Wei Zhao
9a21ac2730 winsys/amdgpu: Remove assert about user fence in amdgpu_fence_wait
The assertion `assert(afence->seq_no <= *user_fence_cpu)` in
`amdgpu_fence_wait` can trigger a Mesa exit during GPU mode2 resets in
virtualized guest environments.

A GPU reset can cause the hardware to discard commands, including the
one that updates the user fence BO (`*user_fence_cpu`). This leaves
`*user_fence_cpu` with an older value, while `afence->seq_no` (from
command submission) is newer, leading to
`afence->seq_no > *user_fence_cpu` and triggering the assert.

Removing this assert prevents Mesa from exiting in this reset scenario.
No adverse side effects observed during testing. The assert appears
overly strict for hardware reset events where command completion is not
guaranteed.

Signed-off-by: Wei Zhao <wei.zhao@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34924>
2025-05-13 14:51:01 +00:00
Danylo Piliaiev
bcf901f5fb tu,freedreno: Use HW option to auto add base instance to instance id
We don't need the lowering of instance id to "base instance + offset"
since hw has VFD_ADD_OFFSET_INSTANCE flag.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34902>
2025-05-13 11:35:39 +00:00
Georg Lehmann
201f6c1a00 gallium: remove left over clover files
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34930>
2025-05-13 10:29:46 +00:00
David Rosca
f5677a9050 radeonsi/video: Use ac_uvd_alloc_stream_handle
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:48 +00:00
David Rosca
46d5926d83 radeonsi/vcn: Stop using stream handle for decode
It's only needed for old UVD without session context. Also remove
the NULL check for session context buffer as we always have the buffer.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:47 +00:00
David Rosca
09d8235938 radeonsi/vcn: Remove unused stream_handle for encode
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:47 +00:00
David Rosca
fb53eec720 radeonsi/uvd_enc: Remove unused stream_handle
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34807>
2025-05-13 09:36:47 +00:00
Mike Blumenkrantz
ef63e3e4d2 zink: fix broken comparison for dummy pipe surface sizing
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
this should create a new surface if the existing one is too small,
not if it is too big

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34933>
2025-05-12 19:34:08 +00:00
Corentin Noël
77c0ff9fc7 virgl: Bail out on file descriptor duplication failure
Do not try to use a negative file descriptor.

CID: 1465120 Argument cannot be negative

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34816>
2025-05-12 14:08:04 +00:00
Corentin Noël
965f41b550 virgl: Ensure to not overflow when encoding string marker
The maximal length is 65535 as an offset of 16 bits is being used to encode it.

Afterwards in VIRGL_CMD0, the buf_len equals 65536, so buf_len << 16 overflows its type which is uint32_t.

CID: 1604743 Overflowed constant
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34816>
2025-05-12 14:08:04 +00:00
Corentin Noël
11a7b112cb vtest: Be more resilient when a resource creation has failed
Do not override the handle number with 0 if we fail to create a new resource.

Also make sure to store the handle consistently in an uint32_t.

CID: 1644460 Overflowed constant
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34816>
2025-05-12 14:08:04 +00:00
Corentin Noël
5bec582e30 vtest: Silence some coverity issues
Add assertion about the returned read/written size being smaller than the size
left

CID: 1605126, 1604911
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34816>
2025-05-12 14:08:04 +00:00
David Rosca
4fca9d9699 pipe/video: Remove st_rps_bits and UseStRpsBits
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34836>
2025-05-12 13:12:05 +00:00
David Rosca
7d55b510e8 frontends/va: Set HEVC NumShortTermPictureSliceHeaderBits
This is the same value as st_rps_bits, which VDPAU already uses.

Reviewed-By: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34836>
2025-05-12 13:12:05 +00:00
Matthieu Oechslin
4e68e422e0 r600: Take dual source blending in account when creating target mask with RATs
This is properly checked when filling CB_... registers in
evergreen_emit_image_state(), but not when generating CB_TARGET_MASK.
It would lead to an invalid command steam if a fragment shader
uses SSBO/Image load/store alongside dual source blending.

Acked-by: Patrick Lerda <patrick9876@free.fr>
Fixes: a6b3792843
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/622
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34333>
2025-05-12 11:42:37 +00:00
Martin Krastev
034cb260ac svga/ci: Increase vmware-vmx-piglit job parallelism to 4
Bump up vmware farm's vmware-vmx-piglit job parallelism to 4.

Signed-off-by: Martin Krastev <martin.krastev@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34925>
2025-05-12 11:23:20 +00:00
Karol Herbst
f0fa2209a8 nir: add nir_opt_algebraic_integer_promotion
This handles basic operations where clang promotes integers to 32 bits
according to the C99 spec in OpenCL C source code.

This is its own opt_algerbraic pass, because we don't wanna fight with
nir_lower_bit_size.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34641>
2025-05-12 09:29:20 +00:00
David Rosca
4ea52147c1 pipe/video: Remove unused UseRefPicList
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34698>
2025-05-12 08:14:59 +00:00
David Rosca
5edac5cd92 frontends/va: Only keep current slice RefPicList for HEVC
This is only used for slice header parsing now.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34698>
2025-05-12 08:14:58 +00:00
David Rosca
639a95cd77 radeonsi/uvd: Stop using HEVC direct reflist
Not needed now that va frontend provides correct ref pic sets.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34698>
2025-05-12 08:14:58 +00:00
David Rosca
203e9c29b4 radeonsi/vcn: Stop using HEVC direct reflist
Not needed now that va frontend provides correct ref pic sets.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34698>
2025-05-12 08:14:58 +00:00
David Rosca
779edc0759 frontends/va: Correctly derive HEVC StCurrBefore, StCurrAfter and LtCurr
StCurrBefore and StCurrAfter are sorted by POC.
For LtCurr there is no defined order, so if there are multiple long term
references in a picture, we need to parse the slice header.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34698>
2025-05-12 08:14:58 +00:00
Eric Engestrom
96d5c5df6f lavapipe/ci: document flakes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34916>
2025-05-11 18:46:12 +00:00
Eric Engestrom
df3f279233 lavapipe/ci: replace large (and growing) list of flakes with a regex
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34916>
2025-05-11 18:46:12 +00:00
Eric Engestrom
7c4f501e99 radv/ci: drop unnecessary CI_TRON_TIMEOUT__BOOT_CYCLE__MINUTES
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It doesn't serve any purpose when `CI_TRON_TIMEOUT__BOOT_CYCLE__RETRIES`
is not set to 1 or more.

The two exception are `zink-radv-vangogh-valve` and
`radv-polaris10-vkcts` which do set `retries` > 0.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34899>
2025-05-09 22:19:39 +00:00
Eric Engestrom
9a9a08994b turnip/ci: drop CI_TRON_TIMEOUT__BOOT_CYCLE__MINUTES
It doesn't serve any purpose when `CI_TRON_TIMEOUT__BOOT_CYCLE__RETRIES`
is not set to 1 or more.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34899>
2025-05-09 22:19:39 +00:00
Eric Engestrom
24ed4a244c nvk/ci: drop CI_TRON_TIMEOUT__BOOT_CYCLE__MINUTES
It doesn't serve any purpose when `CI_TRON_TIMEOUT__BOOT_CYCLE__RETRIES`
is not set to 1 or more.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34899>
2025-05-09 22:19:39 +00:00
Roland Scheidegger
5006d7f1f1 llvmpipe: Fix crash when using nir_tex_src_min_lod
Calculating lod does not always happen with the same vector size as
the vector size of the coords, which led to a crash when using the
new minLod feature. Use same repacking as with explicit lod.

Fixes: a8b104d9bd
Reviewed-by: Brian Paul <brian.paul@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34906>
2025-05-09 21:55:12 +00:00
Adam Jackson
1ef9cd3504 util/cpu: Remove util_cpu_caps_t::family
This had two uses, neither of them very good. On s390x we used it to
store the fact of our s390-ness, which we can replace with
DETECT_ARCH_S390. On x64 we used it to communicate AMD-Zen-ness to the
L3 topology detection code, which we can replace with a local parameter.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34820>
2025-05-09 20:10:10 +00:00
Brian Paul
c2267358c6 svga: increase SVGA_MAX_FRAMEBUFFER_DEFAULT_SAMPLES to 16
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This fixes the piglit arb_framebuffer_no_attachments-query test
(asserted in debug builds, crashed in release builds).  Passes
with this change.

The SVGA_MAX_FRAMEBUFFER_DEFAULT_SAMPLES value is only used to
dimension the svga_rasterizer_state::altRastIds[] array.

Signed-off-by: Brian Paul <brian.paul@broadcom.com>
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34888>
2025-05-09 19:51:43 +00:00