Commit graph

207992 commits

Author SHA1 Message Date
Samuel Pitoiset
cb6f2d9409 ac/surface: use align with NPOT for estimating surface size
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
ac_estimate_size() triggers an assertion because the block size isn't
aligned to a power of two for ASTC formats.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35879>
2025-07-03 08:02:17 +00:00
Boris Brezillon
25536c7d4d pan/kmod: Explicitly set the user MMIO offset when the KMD supports it
FEX is a 64-bit process potentially running x86 (32-bit) binary, in
which case the automatic user MMIO offset detection doesn't work, so
let's explicitly set the user MMIO offset when we can.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34573>
2025-07-03 07:34:18 +00:00
Boris Brezillon
465cda8237 panvk: Make imports strict at all times except for AFBC(RGB)
Enforce strictness while we still can. We can't enforce strictness
on AFBC(RGB) because the driver might be used by a compositor that
imports buffers from clients that were relying on the old behavior.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35762>
2025-07-03 09:10:05 +02:00
Boris Brezillon
53e4f4149b panfrost: Force strict import rules for AFBC(YUV)
AFBC(YUV) has been introduced after the stricter import rules. Let's
make them strict by default now, so we don't encourage exporters to pass
funky WSI pitch values.

We add a driconf option to allow relaxing this strictness on a per-app
basis.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35762>
2025-07-03 09:09:31 +02:00
Karol Herbst
ec05d4b1fa rusticl: drop Arc around PipeResource
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/35812>
2025-07-02 22:52:16 +00:00
Karol Herbst
900dacb0ef rusticl/mesa: add PipeResource::new_ref
pipe_resources are already ref counted, so we can simply make use of that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35812>
2025-07-02 22:52:16 +00:00
Karol Herbst
ff0d77d69d rusticl: reset VMA address of resource inside SVMAlloc::drop
If we want to use of the internal refcounting of pipe_resources, we have
to stop setting the resources's SVM address to 0 inside
PipeResource::drop.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35812>
2025-07-02 22:52:16 +00:00
Chia-I Wu
c8cc9e781d panvk/csf: add more utrace tracepoints
Add all newly defined tracepoints, including meta, render,
dispatch/dispatch_indirect, barrier, and sync_wait.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32693>
2025-07-02 22:31:12 +00:00
Chia-I Wu
67da3d3a4c panvk/csf: prepare for indirect dispatch tracing
Implement capture_data and get_data callbacks.  Pass
sizeof(VkDispatchIndirectCommand) for max_indirect_size_bytes.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32693>
2025-07-02 22:31:12 +00:00
Chia-I Wu
a74340d825 panvk/csf: add panvk_cache_flush_is_nop
Minor code cleanup.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32693>
2025-07-02 22:31:11 +00:00
Chia-I Wu
a68dcc5de3 panvk: define more utrace tracepoints
Define tracepoints for these higl-level api calls

 - meta
 - render
 - dispatch and dispatch_indirect
 - barrier

and these low-level cs cmds

 - sync_wait

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32693>
2025-07-02 22:31:11 +00:00
Chia-I Wu
356f08aeab panvk: propagate CS error in barrier sync wait
We don't want barriers to hide CS errors.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35606>
2025-07-02 22:13:57 +00:00
Chia-I Wu
7868a551ff panvk: remove debug_syncobjs
We can rely on panvk_per_arch(queue_check_status) to detect device lost.

Because we no longer emit cs_sync32_add from finish_cs to increment
debug syncobj, if an instr between the last draw/dispatch and
end-of-stream causes a CS error, the CS error is ignored.  This is fine
because the instr should have no side effect and the kernel emits
ERROR_BARRIER to recover from the CS error.

If that is undesirable, we can restore the old behavior by emitting
cs_sync64_add from finish_cs to increment regular syncobj (and fix
cs_progress_seqno_reg) when PANVK_DEBUG is set.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35606>
2025-07-02 22:13:57 +00:00
Chia-I Wu
6f21c4a549 panvk: check for CS error
If panvk_cs_sync64::error is non-zero at the end of a primary cmdbuf,
copy the error to panvk_cs_subqueue_context::last_error.

Update panvk_per_arch(queue_check_status) to check the last_error and
treat it as device lost if non-zero.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35606>
2025-07-02 22:13:56 +00:00
Faith Ekstrand
d433f4e8bf nak: Encode ureg handle sources for surface ops on Blackwell
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
At least I assume this is a handle.  It shows up on SM120 and it looks
very much like the texture thing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35895>
2025-07-02 21:57:35 +00:00
Faith Ekstrand
19bee26056 nak: Surface handles are not allowed to be rZ
The chances of this happening are near zero with the way we do surface
ops today but I have seen it in the wild and this is apparently a rule.
The hardware throws an illegal instruction encoding if it sees 255.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35895>
2025-07-02 21:57:34 +00:00
Karol Herbst
c1ba062a30 rusticl: use image_copy_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35809>
2025-07-02 21:42:28 +00:00
Alejandro Piñeiro
0003e16fc6 nir/lower_clip: update comment
As the lowering mentioned there got renamed twice:

  commit b085016f94
  Author: Rob Clark <robclark@freedesktop.org>
  Date:   Fri Mar 25 13:52:26 2016 -0400

    nir: rename lower_outputs_to_temporaries -> lower_io_to_temporaries

    Since it will gain support to lower inputs, give it a more generic name.

  commit 1754507d49
  Author: Marek Ol¨ák <maraeo@gmail.com>
  Date:   Wed Jun 25 19:05:19 2025 -0400

    nir: rename nir_lower_io_to_temporaries -> nir_lower_io_vars_to_temporaries

    Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
    Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35760>

Reviewed-by: Marek Ol¨ák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35855>
2025-07-02 20:56:53 +00:00
Marek Olšák
028591aead ac/nir: remove kill_pointsize and kill_layer options from lowering passes
The outputs are removed by a separate pass.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:46 +00:00
Marek Olšák
42ad7543b8 ac/nir: switch legacy GS lowering to ac_nir_prerast_out completely
This changes legacy GS outputs to use the same logic as NGG GS.
It enables the same optimizations that NGG has such as forwarding
constant GS output components to the GS copy shader at compile time.

ac_nir_gs_output_info is removed.

GS output info is no longer passed to ac_nir_lower_legacy_gs and
ac_nir_create_gs_copy_shader separately.

ac_nir_lower_legacy_gs now gathers ac_nir_prerast_out, generates GSVS ring
stores, and also generates the GS copy shader with GSVS ring loads.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:45 +00:00
Marek Olšák
723ce13f90 ac/nir: move gs_output_component_mask_with_stream to prerast utils
Legacy GS will use it.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:45 +00:00
Marek Olšák
2c64cdc047 ac/nir: return the GS copy shader from ac_nir_lower_legacy_gs
This way we won't have to pass output info between the two functions.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:44 +00:00
Marek Olšák
98f3fc494e ac/nir: remove no-op loop from ac_nir_create_gs_copy_shader
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:43 +00:00
Marek Olšák
098d33766a ac: add legacy GS subgroup size computation from radeonsi
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:43 +00:00
Marek Olšák
fa8db1ccd3 ac: add NGG subgroup size computation from radeonsi
RADV will use it.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:42 +00:00
Marek Olšák
4263b49778 ac/nir: remove ngg_scratch LDS ABI, allocate it in the lowering pass
This is a cleanup.

Old gs LDS layout: [es outputs][gs outputs][scratch]
Old nogs LDS layout: [xfb/cull][scratch]

New gs LDS layout: [es outputs][scratch|gs outputs]
New nogs LDS layout: [scratch|xfb/cull]

The LDS scratch is moved to the beginning of the preceding buffer in LDS,
while the addresses in that LDS buffer are offset by the scratch size.
It effectively merges the LDS scratch with the preceding buffer in LDS.
Thanks to that, we no longer need the ngg_scratch ABI and the offset
in a user SGPR.

The lowering passes now return the LDS scratch size, which is used
by the drivers to determine the final LDS size.

The ngg_lds_layout SGPR is now unused without GS in RADV.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:41 +00:00
Marek Olšák
b1b581f855 ac/nir/lower_ngg: add an option not to export cull distances if the shader culls them
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:40 +00:00
Marek Olšák
8c04a91d12 ac/nir: rename clip_cull_mask parameter to clearer export_clipdist_mask
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:40 +00:00
Marek Olšák
ed0f393607 ac/nir/lower_ngg: rename clip_cull_dist_mask and use it correctly
We incorrectly used it to determine whether the shader should cull, which
luckily had no effect because it wasn't used everywhere.

cull_clipdist_mask should be used instead, which also reflects whether
clip planes are enabled in GL.

clip_cull_dist_mask is renamed to export_clipdist_mask to make it clear.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:40 +00:00
Marek Olšák
f6af3c0e17 ac/nir/lower_ngg: forward constant GS & XFB output components from stores to loads for LDS
This removes LDS space and loads/stores for constant GS & XFB output
components. Constant output components skip LDS stores, and LDS loads
are replaced with the gathered constants.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:40 +00:00
Marek Olšák
0ba4e3ae83 ac/nir/lower_ngg: add & use new scalar helpers for XFB loads/stores
This simplifies the code and scalarizes the loads/stores.
Scalar loads/stores will allow forwarding constant output components
from stores to loads easily.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:40 +00:00
Marek Olšák
4b6ae11207 ac/nir/lower_ngg: add & use new scalar helpers for GS loads/stores
This simplifies the code and scalarizes the loads/stores.
Scalar loads/stores will allow forwarding constant output components
from stores to loads easily.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:40 +00:00
Marek Olšák
f407129b7f ac/nir/lower_ngg_gs: cull against clip/cull distances & clip planes in GS
This is finally implemented.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35352>
2025-07-02 20:27:40 +00:00
Matt Turner
7da88c76db intel: Add support for BFloat16 as cooperative matrix accumulator
The number of passing tests in ./deqp-vk -n '*cooperative_matrix.khr*'
on PTL increases from 914 -> 1030.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35320>
2025-07-02 20:06:59 +00:00
Matt Turner
e6242fb958 brw: Handle bfloat16 dest and src0 operands for DPAS
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35320>
2025-07-02 20:06:59 +00:00
Caio Oliveira
c006bee22d brw: Don't use simd_select for BS shaders
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Since there's only one possible SIMD, don't need to use
the helpers to decide which one to compile.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35799>
2025-07-02 19:48:04 +00:00
Eric Engestrom
4be493862d meson: only run symbols-check if nm is available
And drop the redundant check from symbols-check.py, which was actually
masking all kinds of issues.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35891>
2025-07-02 19:21:25 +00:00
Eric Engestrom
f350803fb3 bin/symbols-check: document new platform symbols exported since symbols-check was broken
The `pthread_mutexattr_*` symbols probably shouldn't be exported, but
let's fix that later so that we can at least get symbols-check to run
again ASAP.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35891>
2025-07-02 19:21:25 +00:00
Eric Engestrom
f06fff8148 bin/symbols-check: sort platform symbols
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35891>
2025-07-02 19:21:25 +00:00
Eric Engestrom
3d9b76db8e bin/symbols-check: ignore version of platform symbols
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35891>
2025-07-02 19:21:25 +00:00
Eric Engestrom
5672230c19 bin/symbols-check: ignore nm lines that don't have a symbol name
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35891>
2025-07-02 19:21:24 +00:00
Eric Engestrom
e626636e90 bin/symbols-check: fix fields length condition before accessing fields
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35891>
2025-07-02 19:21:24 +00:00
Eric Engestrom
f28cda029c bin/symbols-check: add missing newline before function
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35891>
2025-07-02 19:21:23 +00:00
Adam Jackson
6a28d6707d meson: Require LLVM 8 or newer
This isn't a huge cleanup on its own, but it lets us start assuming
coroutine support, and I would like to unify graphics shader dispatch
to work the same way as compute shader dispatch.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35374>
2025-07-02 18:49:22 +00:00
Mike Blumenkrantz
c459be3795 zink: loosen heuristic for buf2img texture upload barriers
assume that any non-reordered texture upload should prepare it
for use in sampling

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35769>
2025-07-02 18:20:05 +00:00
Mike Blumenkrantz
403a455ae9 tc: replace gpu util_copy_box with single image_copy_buffer call
much nicer

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35769>
2025-07-02 18:20:05 +00:00
Mike Blumenkrantz
52216557e1 tc: use image_copy_buffer for subdata uploads instead of resource_copy_region
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35769>
2025-07-02 18:20:05 +00:00
Mike Blumenkrantz
da16c9ad90 zink: implement image_copy_buffer
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35769>
2025-07-02 18:20:04 +00:00
Mike Blumenkrantz
c25e31392a zink: rework zink_copy_image_buffer()
this now takes less confusing params

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35769>
2025-07-02 18:20:04 +00:00
Mike Blumenkrantz
8b8a06f6c3 gallium: add pipe_context::image_copy_buffer
this is a more explicit version of the copying used in resource_copy_region
which also provides stride info

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35769>
2025-07-02 18:20:03 +00:00