Commit graph

6771 commits

Author SHA1 Message Date
Olivia Lee
e278a89fdd panvk/perfetto: improve clock synchronization using CLOCK_MONOTONIC_RAW
On Mali, GPU timestamp cycle counts are mapped to the arch counter, and
so advance at the same rate as CNTVCT (with a fixed offset). The kernel
applies gradual NTP adjustments to CLOCK_BOOTTIME by modifying the rate
of the cycle->ns conversion slightly from the nominal frequency of the
clock, which causes it to drift from the GPU clock's ns values (which
just use the nominal frequency). On a rock5b, I measured this drift in
the 25-30µs/s range.

Perfetto's clock synchronization applies a fixed offset between each
clock snapshot, and so does not handle clocks with significantly
different rates and infrequent snapshots well. For panvk, we emit
snapshots once per second, and so the drift results in an error of
~25µs right before the next snapshot. This is significant for measuring
the latency of CPU<->GPU operations, and shows up as a sawtooth pattern
on the measured latency distribution over time.

CLOCK_MONOTONIC_RAW does not have the NTP adjustment, and so the only
source of drift is error in the shift/mult approximation that the kernel
uses for cycle->ns. This error is very small, and so by emitting CPU
trace events against CLOCK_MONOTONIC_RAW instead of CLOCK_BOOTTIME, we
can get much more accurate synchronization.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34390>
2025-08-19 09:50:36 +00:00
Olivia Lee
78d3b9cd0a perfetto: allow specifying clock domain for cpu timestamps
Everything is currently using CLOCK_BOOTTIME, which is perfetto's
default, and matches the previous behavior. On some hardware, different
clocks may be better synchronized with the gpu clock.

Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34390>
2025-08-19 09:50:36 +00:00
Christoph Pillmayer
992fbee7be panvk: Fix preserved metadata in lower_input_attachment_load
lower_input_attachment_load inserts control flow so we should not claim
we preserve nir_metadata_control_flow.

Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36789>
2025-08-18 07:46:34 +00:00
Emma Anholt
9e61e72e9f vk/runtime: Set GPU_MULTI_WAIT on the drm syncobj type.
DRM syncobjs always let you wait repeatedly on them, so we can set the
flag in the core instead of having each driver override it once they try
to enable the emulated timeline semaphores.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36563>
2025-08-13 18:57:42 +00:00
Mike Blumenkrantz
c7045e3e63 perfetto: unify init
util_perfetto_init() was called in some places, util_cpu_trace_init()
was called in other places, and some places used tracing without ever
calling either of them

util_cpu_trace_init() is now guaranteed to be called:
* on gallium screen create
* on VK instance create

thus no driver/frontend/etc should ever need to call this manually

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36628>
2025-08-12 13:17:43 +00:00
Caterina Shablia
f53bf77d47 panvk/csf: plop the stage and access masks into panvk_sync_scope
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Stage and access masks often go together. Representing the two
with a single value lets us have neater code.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36176>
2025-08-12 12:43:10 +00:00
Caterina Shablia
1f7af54da9 panvk: do not zero AFBC when an image is being bound
Binding an image must not write anything into the memory it's
being bound to.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36176>
2025-08-12 12:43:10 +00:00
Caterina Shablia
ed6f6c723f panvk: call cmd_transition_image_layout for each image memory barrier
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36176>
2025-08-12 12:43:10 +00:00
Caterina Shablia
c95f899305 panvk: add a meta command for transitioning image layout
Currently the only thing this function ever does is clear AFBC
metadata when transitioning away from UNDEFINED.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36176>
2025-08-12 12:43:10 +00:00
Caterina Shablia
8e3fb838ac panvk/csf: change get_cs_deps to be add_cs_deps
Make get_cs_deps accumulate the dependencies. This is useful when
implementing layout transitions. Layout transitions away from
UNDEFINED are implemented with a compute dispatch sandwiched
in-between src and dst, specified in the image barrier. When
implementing device event wait and the event dependency needs a
layout transition, we can defer emitting the barrier that syncs
layout transition dispatches with dst until after we have emitted
all dispatches, avoiding sync between the said transition
dispatches.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36176>
2025-08-12 12:43:10 +00:00
Mary Guillemard
c5c196e6d5 pan/bi: Revamp bi_optimize_nir
This reorder things a bit, ensure we attempt more agressive vectorisation,
attempt to optimize cf and more.

Inspiration from NAK's optimize_nir function.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:57 +00:00
Mary Guillemard
ef7095c85b pan/bi: Handle needless conversions in nir_lower_bool_to_bitsize
We can end up with conversion instructions to the same type of integer
with nir_lower_bool_to_bitsize so let's make
bifrost_nir_lower_algebraic_late handle those cases.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:57 +00:00
Mary Guillemard
9ec1bb0111 pan/bi: Vectorize UBOs load/store
We can benifit from it, let's allow it when we aren't forced to follow
robustness2.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:57 +00:00
Mary Guillemard
b4ce8998d7 pan/bi: Switch to nir_lower_alu_width
Embrace modernity and consistency between alu and vectorization passes.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:57 +00:00
Mary Guillemard
0c7aaa7aad panvk: Call nir_opt_access
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36629>
2025-08-11 11:38:56 +00:00
Lars-Ivar Hesselberg Simonsen
efab2205fa panvk: Add utrace tracepoints in queue_submit
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:30 +00:00
Lars-Ivar Hesselberg Simonsen
856daf4ce2 panvk/utrace: Add flush_cache support
Also pulls flush_cache information out of the barrier tracepoint.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:30 +00:00
Lars-Ivar Hesselberg Simonsen
2c8d77b94a panvk/utrace: Add sync32/64_add support
Add the ability to capture sync32/64_add during tracing.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:30 +00:00
Lars-Ivar Hesselberg Simonsen
4709dcaf52 panvk/utrace: Add sync32/64_wait support
Add support for capturing sync32/64_wait including the addresses and
values they wait for.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:30 +00:00
Lars-Ivar Hesselberg Simonsen
5d71bf46a7 panvk/utrace: Add support for storing registers
Add the ability to store specific register values during tracing by
using the indirect capture capability.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:29 +00:00
Lars-Ivar Hesselberg Simonsen
c2e0ce16fb panvk/utrace: Make indirect capture wait optional
Unless the command we're tracing produces the data we want to capture,
there is no need to wait for its timestamp write.

Currently, there is no such case, so make it the responsibility of the
caller instead of implicitly adding the wait.

Also remove and unnecessary wait for the LS scoreboard after the copy
buffer store.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:29 +00:00
Lars-Ivar Hesselberg Simonsen
abffb96c46 panvk/utrace: Pass async_op instead of mask
This is needed to trace cs_defer_indirect.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:29 +00:00
Lars-Ivar Hesselberg Simonsen
db4bcd48d7 panvk: Fix IUB decode
The buffer is only an IUB if it's within the size of the resource entry.
Otherwise, it might just be a buffer that landed just after the
descriptor allocation.

Fixes: fb38f10240 ("panvk: Handle IUBs in decoder")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:29 +00:00
Lars-Ivar Hesselberg Simonsen
e5b828e808 panvk: Fix instrumentation on v12+
Ensure we stay within the maximum tuple size when copying.

Fixes: 172dead3df ("panvk: Increase CSF scratch limits on v12+")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36519>
2025-08-11 10:12:29 +00:00
Olivia Lee
c11f47481a panvk: stop CPU mapping all index buffers on JM
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This can be removed now that we do compute shader minmax. Fixes failed
mmap errors on PPSSPP and some other vulkan applications:

MESA: error: mmap(..., size=4194304, prot=2, flags=0x1) failed: Invalid argument

Fixes: e25064c026 ("panvk: Use indirect path for indexed draw on JM")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36695>
2025-08-09 01:21:43 -07:00
Romaric Jodin
7dc4f28507 pan/bi: schedule simple iterators to avoid extra move
Try to move iterator as close to the end of the block as possible. The
goal is to avoid the iterator being used after being updated, to
prevent the need for an extra move instruction.

shader-db report on `Mali-G725`:
```
total instrs in shared programs: 720530 -> 716482 (-0.56%)
instrs in affected programs: 231842 -> 227794 (-1.75%)
helped: 3804
HURT: 1
helped stats (abs) min: 1.0 max: 8.0 x̄: 1.06 x̃: 1
helped stats (rel) min: 0.14% max: 6.25% x̄: 2.75% x̃: 2.86%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.05% max: 0.05% x̄: 0.05% x̃: 0.05%
95% mean confidence interval for instrs value: -1.08 -1.04
95% mean confidence interval for instrs %-change: -2.79% -2.71%
Instrs are helped.

total cycles in shared programs: 35295.80 -> 35295.55 (<.01%)
cycles in affected programs: 3.50 -> 3.25 (-7.14%)
helped: 8
HURT: 0
helped stats (abs) min: 0.03125 max: 0.03125 x̄: 0.03 x̃: 0
helped stats (rel) min: 6.90% max: 7.41% x̄: 7.15% x̃: 7.15%
95% mean confidence interval for cycles value: -0.03 -0.03
95% mean confidence interval for cycles %-change: -7.38% -6.92%
Cycles are helped.

total fma in shared programs: 5054.34 -> 5054.34 (0.00%)
fma in affected programs: 0 -> 0
helped: 0
HURT: 0

total cvt in shared programs: 4707.69 -> 4644.44 (-1.34%)
cvt in affected programs: 1471.28 -> 1408.03 (-4.30%)
helped: 3804
HURT: 1
helped stats (abs) min: 0.015625 max: 0.125 x̄: 0.02 x̃: 0
helped stats (rel) min: 0.37% max: 12.50% x̄: 6.01% x̃: 6.67%
HURT stats (abs)   min: 0.015625 max: 0.015625 x̄: 0.02 x̃: 0
HURT stats (rel)   min: 0.13% max: 0.13% x̄: 0.13% x̃: 0.13%
95% mean confidence interval for cvt value: -0.02 -0.02
95% mean confidence interval for cvt %-change: -6.07% -5.94%
Cvt are helped.

total sfu in shared programs: 1878.25 -> 1878.25 (0.00%)
sfu in affected programs: 0 -> 0
helped: 0
HURT: 0

total v in shared programs: 2353 -> 2353 (0.00%)
v in affected programs: 0 -> 0
helped: 0
HURT: 0

total t in shared programs: 5530 -> 5530 (0.00%)
t in affected programs: 0 -> 0
helped: 0
HURT: 0

total ls in shared programs: 27975 -> 27975 (0.00%)
ls in affected programs: 0 -> 0
helped: 0
HURT: 0

total code size in shared programs: 6386560 -> 6289664 (-1.52%)
code size in affected programs: 508544 -> 411648 (-19.05%)
helped: 757
HURT: 0
helped stats (abs) min: 128.0 max: 128.0 x̄: 128.00 x̃: 128
helped stats (rel) min: 0.83% max: 33.33% x̄: 31.09% x̃: 33.33%
95% mean confidence interval for code size value: -128.00 -128.00
95% mean confidence interval for code size %-change: -31.57% -30.60%
Code size are helped.

total threads in shared programs: 14698 -> 14698 (0.00%)
threads in affected programs: 0 -> 0
helped: 0
HURT: 0

total loops in shared programs: 166 -> 166 (0.00%)
loops in affected programs: 0 -> 0
helped: 0
HURT: 0

total spills in shared programs: 37 -> 37 (0.00%)
spills in affected programs: 0 -> 0
helped: 0
HURT: 0

total fills in shared programs: 111 -> 111 (0.00%)
fills in affected programs: 0 -> 0
helped: 0
HURT: 0
```

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36021>
2025-08-07 15:09:56 +00:00
Romaric Jodin
4a53eca97d pan/bi: add pass to simplify control flow
That pass tries to remove blocks that are not needed:
blocks with only 1 predecessor and 1 successor containing no
instruction or only 1 branch instruction.

Also remove unnecessary branch at the end of block with only 1
successor which is the next block

Run this pass at the end of the compiler flow once all optimisations
have been applied.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36021>
2025-08-07 15:09:56 +00:00
Romaric Jodin
6b693e281a pan/va: improve lowering of SWZ_V4I8
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Use bi_make_vec_to to allow to use only 1 MKVEC.v2i8 when possible.

Also add support for all swizzles instead of only mono-byte ones,
using bi_swizzle_to_byte_channels.

Update assert in bi_byte.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35643>
2025-08-07 13:48:33 +00:00
Romaric Jodin
857f29d67b pan/bi: use only 1 MKVEC.v2i8 to generate v4i8 when possible
When making a vector of 4 elements, try to make it with only 1
instruction instead of 2 at the moment, if the last 2 elements respect
the pattern supported by MKVEC.v2i8

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35643>
2025-08-07 13:48:32 +00:00
Eric R. Smith
24c692c981 panvk: fix a NULL pointer dereference in occlusion queries
If a meta operation (like a blit or clear) happens while occlusion
queries are active, we temporarily disable the query. Unfortunately
the code for this did not clear out the `syncobj` field. In rare
combinations of circumstances this could cause an attempt to issue
a write back of the occlusion query values, and since we've zeroed
the `ptr` field it writes to a NULL value, causing a bus fault and
device lost error.

Fixes: 61534faf4e ("panvk: Wire occlusion queries to internals")
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/36525>
2025-08-07 11:58:53 +00:00
Alyssa Rosenzweig
94a2740cab panvk: rewrite pan_nir_lower_static_noperspective
Really this should be using the common code I added in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36501 but one thing at
a time.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36600>
2025-08-07 10:33:36 +00:00
John Anthony
dff1d91c64 panvk: Enable VK_ARM_shader_core_builtins
While the shaderCoreBuiltins feature is only supported on v9+, the
extension itself provides some useful physical device properties and is
supported on all GPUs.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36019>
2025-08-07 11:46:33 +02:00
John Anthony
c46407de88 pan/va: Add support for SPV_ARM_core_builtins
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36019>
2025-08-07 11:46:33 +02:00
Erik Faye-Lund
fed9bca207 panvk: fix EXT_texture_compression_astc_support
We can't mix pipe_format and VkFormat values, whoops!

Fixes: ad6e1afe74 ("panvk: add EXT_texture_compression_astc_hdr support")
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36601>
2025-08-06 13:14:24 +00:00
Qiang Yu
c135ed1eb9 all: rename gl_shader_stage_name to mesa_shader_stage_name
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36569>
2025-08-06 10:28:41 +08:00
Qiang Yu
4847e0b380 all: rename gl_shader_stage_uses_workgroup to mesa_shader_stage_uses_workgroup
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36569>
2025-08-06 10:28:41 +08:00
Qiang Yu
7a91473192 all: rename gl_shader_stage_is_compute to mesa_shader_stage_is_compute
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36569>
2025-08-06 10:28:41 +08:00
Qiang Yu
196569b1a4 all: rename gl_shader_stage to mesa_shader_stage
It's not only for GL, change to a generic name.

Use command:
  find . -type f -not -path '*/.git/*' -exec sed -i 's/\bgl_shader_stage\b/mesa_shader_stage/g' {} +

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36569>
2025-08-06 10:28:40 +08:00
Samuel Pitoiset
07fe297a3e vulkan: fix missing presentId2/presentWait2 enable features
Fixes recent VKCTS changes for dEQP-VK.info.device_mandatory_features.

Fixes: 07881b085e ("vulkan: Enable PresentWait2 on many physical devices")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36547>
2025-08-05 08:06:43 +00:00
Mary Guillemard
f729bedf89 panvk: Parallelize min max index search on JM
This parallelize min max index search and avoid running that logic per
layer.

This should speed up indexed draw a bit.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:56 +00:00
Mary Guillemard
d936bb496c panvk: Make indexed draw use indirect indexed draw
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:56 +00:00
Mary Guillemard
e25064c026 panvk: Use indirect path for indexed draw on JM
Now that we know that indirect draw works, we can switch to the new
indexed draw codepath.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:55 +00:00
Mary Guillemard
a382e97339 panvk: Implement indirect draw for Bifrost on JM
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:55 +00:00
Mary Guillemard
3be34989e0 panvk: Prepare tiler and vertex dcd for JM indirect
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:54 +00:00
Mary Guillemard
e74372c1c4 panvk: Prepare panvk_draw_prepare_varyings for JM indirect
On JM hardware, we need to allocate a buffer depending on vertex count.

As a result, for indirect and indexed draw we allocate a large buffer with
alloc on fault set.

The size of that buffer is calculated assuming a max of 2 millions vertices
and 18 attributes per vertex (16 user attributes, 2 specials)

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:54 +00:00
Mary Guillemard
de41eaf2d8 panvk: Move JM draw preparation logic to prepare_draw
Most of cmd_draw logic could be shared, let's move what we can.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:53 +00:00
Mary Guillemard
897cc5db1c panvk: Prepare draw_emit_attrib_buf and draw_emit_attrib for indirect
We are going to integrate the helper CL shader.
This shader requires certain extra infos that we need to provide, this
patch adds logic to allocate and fill those infos.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:52 +00:00
Mary Guillemard
a152187f5d libpan: Add draw indexed and indirect helper for Bifrost
Will be used by panvk.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:52 +00:00
Mary Guillemard
b27cb444f2 panfrost: Allow to pass job dependencies in grid for precomp JM
For indirect draws, we need to depends on some previous job in the chain
so we use the grid info to pass this.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:51 +00:00
Mary Guillemard
641ad49ab2 panvk: Directly use index buffer tracked value in JM
Let's not be confusing here.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35724>
2025-08-04 12:12:51 +00:00