Commit graph

6437 commits

Author SHA1 Message Date
Caterina Shablia
b81359ec84 panvk: bump maxPushConstantSize to 256
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Vulkan 1.4 raises the minimum for maxPushConstantSize to 256, and given
that we intend on supporting 1.4 eventually and the change is very simple
might as well do it now.

Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35191>
2025-06-02 16:21:34 +00:00
Caterina Shablia
c6f19e87ac panvk: ensure we don't go over the hardware FAU limit
All the Malis in existence out there support at most 64 user-supplied FAUs.

Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35191>
2025-06-02 16:21:34 +00:00
Guilherme Gallo
0a63e324a5 ci/panfrost: Reuse file list YAML anchors
Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35251>
2025-05-30 21:05:45 +00:00
Eric R. Smith
548f652d10 panfrost, panvk: spread hierarchy mask bits out when max_levels < 8
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We create hierarchy masks based on the number of levels available,
creating a bitmask with `max_levels` bits set. Originally these bits
all came together. Modify this to spread the bits out, which improves
performance on chips like the G31 with only 2 levels of hierarchy.

Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34744>
2025-05-29 21:50:54 +00:00
Eric R. Smith
13b35a3c9c panfrost, panvk: fix G31 use of SHADER_MODE_EARLY_ZS_ALWAYS
PRE_POST_FRAME_SHADER_MODE_EARLY_ZS_ALWAYS was introduced in
architecture version 7.2, not 7.0 as we assumed. Using it on
G31 (a 7.0 device) caused some CTS failures.

Cc: mesa-stable
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34744>
2025-05-29 21:50:52 +00:00
Olivia Lee
97e54511a5 panvk: advertise VK_EXT_shader_subgroup_vote and VK_EXT_shader_subgroup_ballot
These are already supported in the compiler.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35218>
2025-05-28 23:20:09 +00:00
Olivia Lee
6f5f5ca4b2 pan/va: allow using both FAU and small constants in the same instruction
Normally we aren't able to mix FAU srcs from different pages. We
consider small constants (BIR_FAU_IMMEDIATE) to be page 0, and so were
previously always pulling small constants out with a MOV in instructions
that also use FAUs. This is not necessary. Message unit instructions
have no restrictions on small constant use and execution unit
instructions allow mixing small constants with FAU srcs as long as we
don't use more than 64 bits.

shader-db results on G610:

total instrs in shared programs: 673595 -> 672719 (-0.13%)
instrs in affected programs: 111294 -> 110418 (-0.79%)
helped: 293
HURT: 9
helped stats (abs) min: 1.0 max: 27.0 x̄: 3.12 x̃: 2
helped stats (rel) min: 0.08% max: 10.53% x̄: 1.71% x̃: 1.02%
HURT stats (abs)   min: 1.0 max: 15.0 x̄: 4.33 x̃: 3
HURT stats (rel)   min: 0.06% max: 12.20% x̄: 2.07% x̃: 0.49%
95% mean confidence interval for instrs value: -3.38 -2.42
95% mean confidence interval for instrs %-change: -1.80% -1.39%
Instrs are helped.

total cycles in shared programs: 34260.22 -> 34257.44 (<.01%)
cycles in affected programs: 143.53 -> 140.75 (-1.94%)
helped: 78
HURT: 1
helped stats (abs) min: 0.015625 max: 0.296875 x̄: 0.04 x̃: 0
helped stats (rel) min: 0.32% max: 5.71% x̄: 1.78% x̃: 1.32%
HURT stats (abs)   min: 0.046875 max: 0.046875 x̄: 0.05 x̃: 0
HURT stats (rel)   min: 1.90% max: 1.90% x̄: 1.90% x̃: 1.90%
95% mean confidence interval for cycles value: -0.05 -0.02
95% mean confidence interval for cycles %-change: -1.98% -1.49%
Cycles are helped.

total cvt in shared programs: 4097.12 -> 4083.44 (-0.33%)
cvt in affected programs: 706.75 -> 693.06 (-1.94%)
helped: 293
HURT: 9
helped stats (abs) min: 0.015625 max: 0.421875 x̄: 0.05 x̃: 0
helped stats (rel) min: 0.19% max: 45.45% x̄: 6.38% x̃: 2.53%
HURT stats (abs)   min: 0.015625 max: 0.234375 x̄: 0.07 x̃: 0
HURT stats (rel)   min: 0.15% max: 50.00% x̄: 7.85% x̃: 1.90%
95% mean confidence interval for cvt value: -0.05 -0.04
95% mean confidence interval for cvt %-change: -7.03% -4.89%
Cvt are helped.

total code size in shared programs: 6205824 -> 6198528 (-0.12%)
code size in affected programs: 395648 -> 388352 (-1.84%)
helped: 57
HURT: 2
helped stats (abs) min: 128.0 max: 256.0 x̄: 132.49 x̃: 128
helped stats (rel) min: 0.08% max: 25.00% x̄: 6.96% x̃: 5.26%
HURT stats (abs)   min: 128.0 max: 128.0 x̄: 128.00 x̃: 128
HURT stats (rel)   min: 1.12% max: 2.86% x̄: 1.99% x̃: 1.99%
95% mean confidence interval for code size value: -137.46 -109.86
95% mean confidence interval for code size %-change: -8.19% -5.12%
Code size are helped.

total threads in shared programs: 22203 -> 22204 (<.01%)
threads in affected programs: 1 -> 2 (100.00%)
helped: 1
HURT: 0

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35154>
2025-05-28 22:21:46 +00:00
Yiwei Zhang
28f051a024 panvk: drop bo refcount from panvk_image
The bound bo validity is blessed by the spec VU. No need to beat VVL in
userspace icd.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35197>
2025-05-28 18:06:57 +00:00
Yiwei Zhang
e9b7c88775 panvk: drop bo tracking from panvk_buffer
No longer needed.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35197>
2025-05-28 18:06:57 +00:00
Yiwei Zhang
7e2fe6d1c1 panvk: fix memory binding for wsi image alias
Fixes: f77fe432c1 ("panvk: support binding swapchain memory")
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35197>
2025-05-28 18:06:57 +00:00
Mary Guillemard
f6f5bee080 pan/genxml: Fix typo for NEXT_SB_ENTRY
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
"NEXT_SB_ENTR" -> "NEXT_SB_ENTRY"

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 811525b543 ("pan/genxml: Build libpanfrost_decode for v12")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35089>
2025-05-28 17:03:30 +00:00
Mary Guillemard
172dead3df panvk: Increase CSF scratch limits on v12+
We have way more registers to work with and we are going to need an
additional register for indirect scoreboard handling so let's increase
our scratch limits.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35089>
2025-05-28 17:03:30 +00:00
Mary Guillemard
50dc885eb2 panvk: Set proper upper limit for IDVS reg blacklist on v12+
This was forgotten when introducing v12+ support.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35089>
2025-05-28 17:03:30 +00:00
Mary Guillemard
bacd87ba3c panfrost: Fix codestyle issue with cs_nop
We never use this kind of form in that header and that was bumping on
clang-format a lot.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35089>
2025-05-28 17:03:30 +00:00
Mary Guillemard
3a5d1d74ec panfrost: Add indirect mode for async operations on v11+
v11 and later allows to indirectly wait on a scoreboard mask and signal
a scoreboard (as set via SET_STATE)

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35089>
2025-05-28 17:03:30 +00:00
Mary Guillemard
a0826ad205 panfrost: Add cs_* helpers for v11 CSF instructions
This adds all bit operations and an helper to indirectly wait on
scorebards.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35089>
2025-05-28 17:03:30 +00:00
Mary Guillemard
d0c76cd2ac panvk: Depends on Panthor scoreboard information
Instead of hardcoding scoreboard count and mask, we now derive those
informations from Panthor CSIF properties.

We still limit iters to 5 as we currently don't support more.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35089>
2025-05-28 17:03:30 +00:00
Mary Guillemard
80b06fb82f panfrost: Allow up to 16 for scoreboards on CSF instructions on v11+
The max value on v11+ is 16.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35089>
2025-05-28 17:03:30 +00:00
Erik Faye-Lund
be74e9ffaf pan/lib: wire up ASTC HDR formats
This exposes GL_KHR_texture_compression_astc_hdr, which makes a few
piglit tests go from fail to pass.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35132>
2025-05-28 14:49:06 +00:00
Erik Faye-Lund
d9dbf5cebf panfrost: set decode_hdr when needed
When using the HDR-formats, we need to set decode_hdr to actually get
HDR values.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35132>
2025-05-28 14:49:06 +00:00
Erik Faye-Lund
33ad5d447e panfrost: correct texfeat-bit for ASTC LDR
These formats don't depend on the ASTC HDR texfeat, they depend on the
ASTC HDR texfeat. The ASTC HDR texfeat simply adds support for more
endpoint encodings to these formats.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35132>
2025-05-28 14:49:06 +00:00
Daniel Stone
ae8704fbdb ci/panfrost: Demote T720 to nightly runs only
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We only have two of these boards, and can't get more as they're EOL.
Demote them to nightly until we can source different boards with this
SoC, and more of them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35200>
2025-05-28 12:48:45 +00:00
Mary Guillemard
19531a0162 pan/csf: Fix typo in cs_trace_run_idvs2
This should have been a multiply not an add.
Fix an assertion when running in tracing mode on panvk.

Fixes: 79a1d98e1e ("pan/csf: make cs_builder.h usable from c++")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35176>
2025-05-28 10:12:19 +02:00
Erik Faye-Lund
738b95a35e panfrost: add max_4x_msaa quirk
Turns out, some Midgard GPUs don't support more than 4x MSAA. Add a
quirk for those GPUs, so don't expose it when it doesn't work.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35184>
2025-05-27 17:41:47 +00:00
Erik Faye-Lund
3a78d9213b panfrost: pass quirks through __VA_ARGS__
We can't easily pass multiple initializers here, because a comma in the
initializer list would be treated as a preprocessor argument separator
and not a separator in the initializer lst.

We could also have fixed this with some nested macro ugliness, but let's
instead do what nir_builder does for intrinsic indices and use __VA_ARGS__
to keep this neat.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35184>
2025-05-27 17:41:47 +00:00
Erik Faye-Lund
e77e4d5c17 panfrost: change tie-breaking rule for 16x MSAA
When using 16x MSAA, we have two sample-positions on the negative
boundary of the unit-square covering the pixel. This causes problems
when using the default tie-breaking rule, where we miss some
sample-positions when rasterizing primitives covering the entire
viewport.

This works fine on Bifrost and later, but this setting is ignored on
those GPUs, and they assume the default (e.g MINUS_180_OUT_0_IN).
Because we'd prefer for rasterization to match between Midgard and
Bifrost when we can, we only apply this when we have 16x MSAA.

As an added bonus, this behavior matches what the DDK does.

Fixes these tests when 16x MSAA is enabled:
- dEQP-GLES31.functional.texture.multisample.samples_16.use_texture_*
- dEQP-GLES3.functional.multisample.fbo_max_samples.proportionality_alpha_to_coverage

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35184>
2025-05-27 17:41:47 +00:00
Erik Faye-Lund
cf28edd8bd panfrost: do not calculate max-msaa on v4
The V4 GPUs doesn't have the dynamic allocation logic that V5 and later
has. There's nothing to calculate here; the GPU either supports 8x MSAA,
or 4x MSAA.

Since 8x MSAA is the architectural max, let's have this function report
that. We deal with the 4x limit separately as a quirk, because this
applies to some V5 GPUs as well.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35184>
2025-05-27 17:41:47 +00:00
Erik Faye-Lund
483ce5a1dc panfrost: do not try to use 4x4 tiles on v4 gpus
Mali V4 GPUs only ever use 16x16 tiles, so we need to set the minimum
tile-size to match.

Fixes: 329568b5eb ("panfrost: add color-attachment and msaa helpers")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35184>
2025-05-27 17:41:47 +00:00
Erik Faye-Lund
7de12da5a2 panfrost: v4 does not support 16x msaa
This value isn't valid on V4, so let's make sure we don't try to use it.

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/35184>
2025-05-27 17:41:47 +00:00
Alyssa Rosenzweig
f47de306b8 vulkan: pass enabled features to drivers
for pipelines, we know enabled features. for classic shader objects, we do not.
therefore, we want to plumb this through explicitly for drivers using common
pipelines, rather than making drivers guess whether they can use the device
features.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35169>
2025-05-27 13:23:12 +00:00
Erik Faye-Lund
2ec3b83f99 panvk: expose EXT_texel_buffer_alignment support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This was mostly wired up, but we currently require an alignment of 64
for uniform texel buffers, because we're currently using
plane-descriptors for this.

We could lift that limitation by switching to buffer descriptors and use
LD_CVT for the format-conversion, but that's a bigger change.

Let's just fix up the aligntment and enable the extension for now.

Reviewed-by: Olivia Lee <benjamin.lee@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34826>
2025-05-27 11:31:55 +02:00
Olivia Lee
65406cf500 panvk/csf: fix provoking vertex mode in partial secondary cmdbufs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
For partial secondary cmdbufs, we emit FBDs/TDs in the primary cmdbuf
before calling the secondary. In order to set the provoking vertex mode
correctly here, we need to look at the mode set by pipelines bound in
the secondary cmdbuf.

This leaves one edge case: reemitting FBDs/TDs in a secondary cmdbuf
after a flush. If the secondary cmdbuf only contains vk_meta draws,
without ever binding a pipeline, we won't know which provoking vertex
mode to use here. This is actually okay, because in that case the
provoking vertex mode doesn't matter for any of the draws in the
secondary, and the FBDs/TDs will be reemitted on the primary with the
correct mode.

Fixes: 7a9f14d3c2 ("panvk: advertise VK_EXT_provoking_vertex")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:22 +00:00
Olivia Lee
885805560f panvk/csf: fix case where vk_meta is used before PROVOKING_VERTEX_MODE_LAST
In this case, we need to emit the FBDs and TDs for the meta command
before we know what provoking vertex mode the application is going to
use. To handle this, we make a guess for which provoking vertex mode we
need. Then we use cs_maybe to leave space to flip the provoking vertex
bit if the guess was wrong.

This case is still unhandled on JM.

Fixes: 7a9f14d3c2 ("panvk: advertise VK_EXT_provoking_vertex")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:22 +00:00
Olivia Lee
4d99346477 panvk: fix case where vk_meta is used after PROVOKING_VERTEX_MODE_LAST
Because we advertise provokingVertexModePerPipeline=false, the provoking
vertex mode must be set the same for all pipelines used in a renderpass.
vk_meta doesn't care about the provoking vertex mode, but the vulkan api
doesn't provide a way to express this, so it always sets
PROVOKING_VERTEX_MODE_FIRST (the vulkan default). This causes an
assertion failure when vk_meta is used in a renderpass where the
application sets PROVOKING_VERTEX_MODE_LAST.

There are a few different cases here, that need different handling. The
simplest is when vk_meta is used after the first application draw, in
which case we can just ignore the state passed by vk_meta and use the
existing state.

Fixes: 7a9f14d3c2 ("panvk: advertise VK_EXT_provoking_vertex")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:22 +00:00
Olivia Lee
32177b99d5 panvk: track whether we are in a vk_meta command
This is needed to handle the provoking vertex mode correctly. vk_meta
doesn't care which provoking vertex mode is used, but there is no way to
express this directly in the vulkan api.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:21 +00:00
Olivia Lee
d60c688317 panvk/csf: set up shared register dump regions for cs functions
The tiler OOM exception handler allocated a region of memory to dump
save/restored registers. For defining more functions in the future, we
allocate a register dump region for each subqueue, that can hold the
largest number of registers needed by any functions executed on that
subqueue.

This does mean that we cannot have function calls more than one deep. If
we ever need nested function calls, we will have to consider a real
stack.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:21 +00:00
Olivia Lee
61e7d47270 pan/csf: rename cs_exception_handler to cs_function
The register save/restore machinery is useful for more general callable
functions, not just exception handlers.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:21 +00:00
Olivia Lee
83bb97796b pan/csf: add cs_maybe mechanism to retroactively patch cs contents
We have an edge case with VK_EXT_provoking_vertex where we may need to
emit FBDs and TDs before we know what provoking vertex mode the
application is using for the renderpass. To handle this, we want to
retroactively patch the provoking vertex bit. This commit introduces an
abstraction to do that.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:21 +00:00
Olivia Lee
952703eefe pan/csf: add cs_builder unit test infrastructure
For now, just comparing the raw contents of the output buffer. Possibly
in the future we could hook this up to the disassembly from decode_csf.c
to make it a easier to edit.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:21 +00:00
Olivia Lee
79a1d98e1e pan/csf: make cs_builder.h usable from c++
We need to do this in order to test it with gtest. Most of the changes
are just fixing integer truncation warnings.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Tested-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Ryan Mckeever <ryan.mckeever@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34974>
2025-05-26 04:15:21 +00:00
Mike Blumenkrantz
c78d6bc4c3 ci: disable panfrost-t720-gles2
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/34054>
2025-05-23 13:21:29 +00:00
Mike Blumenkrantz
2eb45daa9c gallium: de-pointerize pipe_surface
this allows eliminating surface refcounting and objects
which, relatively speaking, don't serve much purpose

see MR for details

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34054>
2025-05-23 13:21:29 +00:00
Lars-Ivar Hesselberg Simonsen
e6e406de0e panvk/jm: Apply direct dispatch WLS instance limit
Apply the direct dispatch WLS instance limit to PanVK/JM as well to keep
compute jobs with large workgroup counts from hitting
VK_ERROR_OUT_OF_DEVICE_MEMORY.

Fixes: 005703e5b5 ("panvk: Move TLS preparation logic to cmd_dispatch_prepare_tls"
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34979>
2025-05-22 15:39:10 +00:00
Lars-Ivar Hesselberg Simonsen
0a47a1cb6d panvk/v10+: Limit direct dispatch WLS allocation
During direct dispatch, we calculate the size of the WLS allocation
based on the number of WLS instances which is an unbounded calculation
on number of workgroups.

This leads to extreme allocation sizes and potentially
VK_ERROR_OUT_OF_DEVICE_MEMORY for direct dispatches with a high amount
of workgroups.

This change adds an upper bound to the number of WLS instances, using
the same value we assume for indirect dispatches.

Additionally, this commit fixes the WLS max instance calculation (which
should be per core).

Fixes: 5544d39f44 ("panvk: Add a CSF backend for panvk_queue/cmd_buffer")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34979>
2025-05-22 15:39:10 +00:00
Lars-Ivar Hesselberg Simonsen
a6c7a774ab panvk/v10+: Remove unnecessary alloc in dispatch_precomp
The CSF version of dispatch_precomp allocates TLS/WLS prior to calling
cmd_dispatch_prepare_tls, which will do the same.

This commit removes this unnecessary allocation.

Fixes: cc02c5deb4 ("panvk: Implement precomp dispatch")
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34979>
2025-05-22 15:39:10 +00:00
Romaric Jodin
ffdc08dfb6 panvk: add support for {s,u}dot_4x8_{sat}
Generate IDPADD instruction to support integer dot product
Support is added for both signed/unsigned dot product as well as
saturated dot product.
Support is only for v9+.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34812>
2025-05-22 14:39:32 +00:00
Romaric Jodin
dc1c701489 panfrost: Update bifrost_isa.py to support saturate for valhall
Add support for <saturate/> as valhall ISA.xml uses it instead of <mod
name="saturate"/>.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34812>
2025-05-22 14:39:32 +00:00
Romaric Jodin
67ca56d7ad panfrost: bi_builder.h.py: stop generating unneeded parentheses
Generate typecheck condition later to be able to know whether extra
parentheses are needed.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34812>
2025-05-22 14:39:32 +00:00
Erik Faye-Lund
80f6b5b483 pan/ci: remove no longer failing test
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
No idea why this was failing on CI in the first place, as I can't
reproduce it failing locally at any point. But at some point recently,
this also stopped failing on CI as well. It's not clear what caused
this, but I can't find anything in the history around the time it
changed that seems particularly suspicious either.

Let's just accept the new behavior, and investegate further if it
reappears.

Acked-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35085>
2025-05-21 20:47:09 +00:00
Boris Brezillon
7164208efb pan/texture: Don't mix image and buffer views
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Specialize the texture emission logic for buffer views, which are much
simpler to deal with than image views.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34767>
2025-05-21 15:03:37 +02:00