Commit graph

216778 commits

Author SHA1 Message Date
Emma Anholt
aea949dd29 tu: Make sure we clear dead writes to vars before nir_link_opt_varyings().
It assumes you don't have dead writes to variables in the last block, and
will copy-propagate consts from the first write it finds.

Without this, the upcoming nir_opt_copy_prop_vars() change to have more
restricted write masks caused less nir_opt_dead_write_vars() (since it
doesn't trim write masks for dead writes, only removes fully-dead writes),
and then zero-initialization of variables at the top of a shader got
propagated, rather than the final store of the used channels of the
variable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37313>
2025-10-20 19:24:45 +00:00
Emma Anholt
d8690f9c60 nir/link_opt_varyings: Make it participate in NIR_DEBUG=print.
It's a pass with major effects on shaders, and it's otherwise weird to see
your varying disappear between two passes that shouldn't affect them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37313>
2025-10-20 19:24:45 +00:00
Emma Anholt
c76b52ae00 virgl: Fix VIRGL_DEBUG=tgsi to work on debugoptimized builds.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37313>
2025-10-20 19:24:44 +00:00
Romaric Jodin
762be5eae1 pan/va: make valhall_parse_isa input explicit
Usage of implicit input file in valhall_parse_isa makes it very
complicated for tools like ninja-to-soong to generate the Android
equivalent build file.

Instead use an explicit argument.
It also deduplicate the location of the input file name to have it
only in 'meson.build'.

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37742>
2025-10-20 18:17:02 +00:00
Aitor Camacho
7c268a1e91 kk: Add KosmicKrisp
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/37522>
2025-10-20 17:46:38 +00:00
Connor Abbott
f6c7f16322 tu: Implement VK_EXT_multisampled_render_to_single_sampled
The extension is emulated on top of traditional transient attachments,
with the driver creating extra internal attachments for each subpass
where the MSRTSS sample count doesn't match the color or depth/stencil
attachment's sample count and insert unresolves/resolves around them,
except for the cases where the original attachment is unused
before/after the subpass respectively. An important case is if the
original attachment would be cleared at the beginning of the subpass, in
which case we rewrite the clear to apply to the driver-internal
multisample attachment. This requires redirecting the clear colors in
CmdBeginRenderPass2.

We create images, image views, and backing memory for these attachments
that are part of the framebuffer with classic renderpasses or allocated
per-render-pass with dynamic rendering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:44 +00:00
Connor Abbott
9c5012b03c tu: Add support for "unresolve" ops
These ops replicate the single-sampled source attachment to the
multi-sampled destination attachment before the start of a subpass. This
is the new hardware feature for
VK_EXT_multisample_render_to_single_sampled, and the actual
implementation of the extension emulates everything on top of these.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:44 +00:00
Connor Abbott
7542d5068c tu: Make r*d_src_depth and r*d_src_stencil generic
We will have to use both in one function, so make them compatible and
add them to the ops function table.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:44 +00:00
Connor Abbott
efde8bf599 tu: Remove tu_attachment_info
This is an old leftover from the skeleton stage of the driver, and we
have never needed anything other than the image view. Having this in
the way made it impossible to write generic code that reads the
attachments in the !image_framebuffer and dynamic rendering cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:43 +00:00
Connor Abbott
8a12a0ec24 tu: Add CCU_RESOLVE_CLEAN workaround
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:42 +00:00
Connor Abbott
5cf0e741e2 tu: Make blit setup take source and destination samples
This will be necessary so that the 3d path can handle "unresolves",
where we select the single-sampled shader for the single-sampled source
but enable multisampling *without* per-sample shading to replicate it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:42 +00:00
Connor Abbott
a3652af380 tu: Also disable stencil load for attachments not in GMEM
We were accidentally still emitting loads for D32S8 resolve attachments.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:41 +00:00
Connor Abbott
9417ce287c tu: Fix 3d load path with D24S8 on a7xx
We need to always use the FMT6_Z24S8_AS_R8G8B8A8 format for GMEM even if
UBWC is disabled, as already done for the 2d store path. Because we
use the pre-baked RB_MRT_BUF_INFO register value, this means we have to
override it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:40 +00:00
Connor Abbott
bc14dd98e3 tu: Clear RB_MRT_BUF_INFO::LOSSLESSCOMPEN for stencil
This was already present in the 2d paths but not in the 3d path,
probably because the flag was moved there only on a7xx and it was
missed. Prevents page faults from bad flag buffer accesses.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:40 +00:00
Connor Abbott
2231c51474 tu: Don't resolve twice in between subpasses
tu6_emit_gmem_stores() already handles resolves.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:39 +00:00
Connor Abbott
d491a79027 tu: Don't patch GMEM for input attachments never in GMEM
This can happen if we resolve to a resolve attachment and then use that
resolve attachment as an input attachment in a later subpass. We don't
need to put it in GMEM, but it's still considered "written" because
input attachment reads need a dependency after the resolve.

MSRTSS input attachment tests effectively created such a scenario after
lowering to transient multisample attachments and inserting resolves.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:39 +00:00
Connor Abbott
7a8b7fc480 tu: Remove useless tu_image_view_init parameter
We can find it from the device.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:38 +00:00
Connor Abbott
928e19320c tu: Fix corner case with clearing input attachment
If the first use of an attachment is as an input attachment, but it has
LOAD_OP_CLEAR, then we have to clear the attachment in GMEM and patch
the input attachment to refer to GMEM. Noticed by inspection.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37919>
2025-10-20 17:18:37 +00:00
Aitor Camacho
f711c3afed nir: Add KosmicKrisp required utilities
Reviewed-by: Alyssa Anne Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37520>
2025-10-20 16:22:00 +00:00
Yiwei Zhang
cc1d942727 panvk: use cs_move_reg32 and lower to cs_add32 if needed
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Trivial but still better than cs_add32 workaround on platforms
supporting MOVE_REG32.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37951>
2025-10-20 16:02:59 +00:00
Yiwei Zhang
81692b8168 panvk: minor cleanup in cmd_prepare_push_uniforms
This change:
1. Use a different loop var for outer multidraw repeat
2. Make sure fau total_count matches the filled faus per loop

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37951>
2025-10-20 16:02:59 +00:00
Yiwei Zhang
387f75f43d panvk: fix to advance vs res_table properly
Fix a regression from an unfortunate typo.

Fixes: 48e8d6d207 ("panfrost, panvk: The size of resource tables needs to be a multiple of 4.")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37951>
2025-10-20 16:02:59 +00:00
Yiwei Zhang
800c4d3430 panvk: fix to advance vs driver_set properly
Should only set once outside the multidraw loop so that per draw can
patch its own own desc attribs when needed.

Fixes: a5a0dd3ccc ("panvk: Implement multiDrawIndirect for v10+")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37951>
2025-10-20 16:02:58 +00:00
Gurchetan Singh
cd06ec1dcb gfxstream: codegen: remove CheckOutOfMemory
Nobody uses it.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:07 +00:00
Gurchetan Singh
af6ff36379 gfxstream: codegen: add vkTraceAsyncGOOGLE to GLOBAL_COMMANDS_WITHOUT_DISPATCH
Otherwise the codegen output fails to compile.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:07 +00:00
Jason Macnak
14e01b1eea gfxstream: Handle BGRA in Gfxstream AHB format conversions
Test: cvd create --gpu_mode=gfxstream_guest_angle_host_swiftshader

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:06 +00:00
Gurchetan Singh
37a2a5c552 gfxstream: kumquat: opaque fd or dmabuf, not both
So Mesa drivers actually don't like both:

src/vulkan/runtime/vk_device_memory.c:

"""
 case VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR: {
   const VkImportMemoryFdInfoKHR *fd_info = (void *)ext;
     if (fd_info->handleType) {
       assert(fd_info->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT ||
              fd_info->handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT);
"""

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:06 +00:00
Gurchetan Singh
b8f0933b25 virtio: kumquat: slice length fix
Causes issues with some versions of host gfxstream.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37855>
2025-10-20 15:45:06 +00:00
Christoph Pillmayer
f367cdad0a pan: Fix bi_load_tl dst arg name
bi_load_tl's dst arg was named src, this was confusing.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37955>
2025-10-20 15:14:06 +00:00
Christoph Pillmayer
eba3d3a17e pan: Enable rematerialization for more ops
IADD_IMM and uniform loads should not be spilled. Make them
rematerializable. Restrict to loads that write at most one register
for simplicity for now.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37955>
2025-10-20 15:14:06 +00:00
Timur Kristóf
d20049b430 ac/nir/ngg_mesh: Lower num_subgroups to constant
Mesh shader workgroups always have the same amount of subgroups.

When the API workgroup size is the same as the real workgroup
size, this is a small optimization (using a constant instead of
a shader arg).

When the API workgroup size is smaller than the real workgroup
size (eg. when the number of output vertices or primitves is
greater than the API workgroup size on RDNA 2), this fixes a
potential bug because num_subgroups would return the "real"
workgroup size instead of the API one.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37947>
2025-10-20 14:05:40 +00:00
Silvio Vilerino
a5af8866df p_video_codec::encode_bitstream_sliced: Add last_slice_completion_fence for PIPE_VIDEO_SLICE_MODE_AUTO
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Pohsiang (John) Hsu <pohhsu@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37936>
2025-10-20 13:37:16 +00:00
Patrick Lerda
84dc9af3d4 r600: update nplanes support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This change fixes "piglit/bin/ext_image_dma_buf_import-export -auto".

Fixes: 02aaf360ae ("r600: Implement resource_get_param")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37840>
2025-10-20 11:42:35 +00:00
Patrick Lerda
3b1e3a40a8 r600: fix r600_draw_rectangle refcnt imbalance
The object buf is referenced at the beginning of the
r600_draw_rectangle() function and should be freed
at the end. This issue was introduced with cbb6e0277f.

Fixes: cbb6e0277f ("r600: stop using util_set_vertex_buffers")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37617>
2025-10-20 11:28:39 +00:00
David Rosca
ffec70465c radeonsi/video: Remove rvid_buffer
Not used anymore.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37884>
2025-10-20 11:00:07 +00:00
David Rosca
9764748f91 radeonsi/vpe: Stop using rvid_buffer
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37884>
2025-10-20 11:00:07 +00:00
David Rosca
0c270c602d radeonsi/vce,uvd_enc: Stop using rvid_buffer
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37884>
2025-10-20 11:00:07 +00:00
David Rosca
a0324576aa radeonsi/vcn: Stop using rvid_buffer
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37884>
2025-10-20 11:00:07 +00:00
David Rosca
a25db1c53c radeonsi/video: Change si_vid_resize_buffer to take si_resource
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37884>
2025-10-20 11:00:07 +00:00
David Rosca
663eada9b2 radeonsi/uvd_enc: Don't use temporary feedback buffer when not needed
We don't request feedback for create and destroy commands, so it's
not needed to allocate feedback buffer.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37884>
2025-10-20 11:00:06 +00:00
David Rosca
1033ac0879 radeonsi/vcn: Don't use temporary feedback buffer when not needed
We don't request feedback for create and destroy commands, so it's
not needed to allocate feedback buffer.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37884>
2025-10-20 11:00:06 +00:00
David Rosca
86832f7499 radeonsi/vpe: Stop clearing embedded buffer on allocation
If it was needed, it would be needed to clear it before every submission
as well.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37884>
2025-10-20 11:00:05 +00:00
Martin Roukala (né Peres)
33232223f6 zink/ci: update the expectations of RADV-based pre-merge jobs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37934>
2025-10-20 10:30:51 +00:00
Martin Roukala (né Peres)
da0f495428 radv/ci: update the expectations of pre-merge jobs
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37934>
2025-10-20 10:30:51 +00:00
Samuel Pitoiset
8e2bb3da5c radv/ci: set RADV_DEBUG=novideo for NAVI31 too
There are random VCN hangs with a repro rate around 20%.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37934>
2025-10-20 10:30:50 +00:00
Samuel Pitoiset
9b774963fe radv/ci: set RADV_DEBUG=novideo for NAVI21
Otherwise, the jobs just hang.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37934>
2025-10-20 10:30:50 +00:00
Samuel Pitoiset
82cd2df7b0 radv/ci: bump number of deqp-runner jobs to 32 for GFX1201
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37934>
2025-10-20 10:30:50 +00:00
Samuel Pitoiset
6fd1b9b397 radv/ci: drop RADV_PERFTEST=video_decode,video_encode for NAVI31
With up-to-date video firmwares, these flags are no longer needed.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37934>
2025-10-20 10:30:50 +00:00
Samuel Pitoiset
49d780db93 radv/ci: use the custom 6.17.3 kernel for POLARIS10
Looks like the SDMA regression is no longer reproducible.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37934>
2025-10-20 10:30:49 +00:00
Samuel Pitoiset
07d1461c53 radv/ci: use the custom 6.17.3 kernel for NAVI21/NAVI31
Now that the zerovram performance regression is fixed, everything
should be fine.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37934>
2025-10-20 10:30:49 +00:00