Commit graph

6685 commits

Author SHA1 Message Date
Eric R. Smith
65bcae096a panfrost: fix SSA register allocation
We were allocating a fixed number of temporary registers; this isn't
always enough, and in fact we should have calculated the number of
temporaries required.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 6c64ad934f ("panfrost: spill registers in SSA form")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36135>
2025-07-16 12:16:50 +00:00
Olivia Lee
5ee3c10d1e panvk: advertise vulkan 1.4 on v10+
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
VK_EXT_host_image_copy was the last extension needed.

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/35910>
2025-07-16 10:56:03 +00:00
Olivia Lee
3894f58914 panvk: implement VK_EXT_host_image_copy for depth/stencil images
Copy between memory and a depth/stencil image requires copying the depth
and stencil aspects in separate calls. For D32S8, this needs to be
special cased in order to handle (de)interleaving.

For image->image copies, deinterleaving is not supported. Aspects must
match between src and dest for non-planar images.

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/35910>
2025-07-16 10:56:03 +00:00
Olivia Lee
91c037f228 panfrost: add support for (de)interleaving Z24S8 in pan_tiling
This is needed for VK_EXT_host_image_copy which, like the buffer<->image
copy commands, treats depth/stencil like separate image planes and
requires copying each separately.

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/35910>
2025-07-16 10:56:03 +00:00
Olivia Lee
93c5d1be94 pan/shared: refactor pan_tiling
We don't need to use fixed-size pixel_t types and put the tiling loop in
a macro in order to get good codegen for this. Replacing the fixed-size
types with memcpy/__builtin_assume_aligned, the compiler is still able
to generate multi-word load/store instructions. Without the fixed-size
types, the only advantage of putting this in a macro is to ensure the
code is specialized on size/is_store/shift, but we can get the same
specialization by making the functions ALWAYS_INLINE.

Measured performance in VK_EXT_host_image_copy benchmraks is unchanged,
and generated assembly looks effectively identical to the previous version.

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/35910>
2025-07-16 10:56:02 +00:00
Olivia Lee
476fb5c5cf panvk: implement VK_EXT_host_image_copy for tiled images
Since we don't have a CPU implementation of AFBC compression, host copy
is only implemented for u-interleaved tiling.

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/35910>
2025-07-16 10:56:02 +00:00
Olivia Lee
0f6a06bbba pan/shared: add function to copy between two tiled images
This is needed for VK_EXT_host_image_copy.

Most other mesa drivers use a similar approach to implement tiled->tiled
copy, with a few differences. They use a temp buffer sized for only one
tile, don't attempt to tile-align the copies in either the src or dest,
and they don't have the memcpy fast path. I measured performance of a
variety of implementations on a rock5b, and found:

 - The fast path for when the copy region is tile-aligned is a 167%
   improvement.
 - Aligning the temp buffer chunks to src tiles is a 20% improvement.
 - Using a 64k buffer instead of a tile-sized buffer is a 14%
   improvement. This buffer size appears optimal in my benchmark,
   smaller and larger buffers are both slower. Skipping the chunk
   approach and just (de)tiling to a temp buffer that fits the whole
   image (what NVK does) is also slower.
 - I had no luck with attempts at a direct tiled->tiled copy algorithm
   that didn't need a temp buffer. The fastest I got was ~1/4 the speed
   of the temp buffer implementation.

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/35910>
2025-07-16 10:56:01 +00:00
Olivia Lee
d3150006be panvk: split out helper function for checking AFBC support
For supporting VK_EXT_host_image_copy for tiled images, we need to be
to determine whether AFBC may be supported in
vkGetPhysicalDeviceImageFormatProperties2.

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/35910>
2025-07-16 10:56:01 +00:00
Olivia Lee
1cd61ee948 panvk: implement VK_EXT_host_image_copy for linear color images
Depth/stencil and tiled images require some additional complexity, so
will be implemented in later commits.

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/35910>
2025-07-16 10:56:01 +00:00
Olivia Lee
adb85dc307 panvk: store BO offset in panvk_image_plane
For VK_EXT_host_image_copy, we need to access image memory from the CPU
after mapping the BO. The existing base field in pan_image_plane doesn't
work for this because it's a GPU address and we don't have a mechanism
to recover the GPU base address of an image's BO to calculate the offset.

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/35910>
2025-07-16 10:56:00 +00:00
Olivia Lee
4f8d0e81c4 panvk: don't report features for image formats that are only usable as vertex buffers
Advertising SAMPLED_IMAGE_DEPTH_COMPARISON is a no-op for images that
don't have SAMPLED_IMAGE_BIT, but it's confusing and results in us
advertising a lot of formats that with only the
SAMPLE_IMAGE_DEPTH_COMPARISON feature that aren't usable for anything.

For R32_UINT and R32_SINT, the change is just a cleanup, because we
always support these for storage images.

Whe we implement VK_EXT_host_image_copy, advertising unusable formats
triggers failures in dEQP-VK.api.image_clearing.*, so it's convenient to
have features==0 for all unusable formats.

Fixes: 70b8056df1 ("panvk: Enable KHR_format_feature_flags2 and use them")
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/35910>
2025-07-16 10:56:00 +00:00
Olivia Lee
77f7147cea pan/kmod: fix propagation of MAP_FAILED in pan_kmod_bo_mmap
All current callers check for MAP_FAILED, not NULL, and we are returning
MAP_FAILED already on the other error paths.

Fixes: d5f4f918f3 ("panfrost: clean up mmap-diagnostics")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-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/36122>
2025-07-16 03:48:02 +00:00
Olivia Lee
7dcac3d55b panvk: add error checking for dump/trace mmap call
Fixes: c257bf5142 ("panvk: Conditionally register an host address when tracking user memory")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-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/36122>
2025-07-16 03:48:02 +00:00
Valentine Burley
13d9570ec9 panfrost/ci: Update expectations
Update the expectations from the latest nightly.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36132>
2025-07-15 14:11:18 +00:00
Olivia Lee
a59e3c6a8b pan/shared: fix typo in pan_tiling doc comments
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: 944049dedc ("panfrost: Document arguments to tiling routines")
Signed-off-by: Olivia Lee <olivia.lee@collabora.com>
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36102>
2025-07-14 19:54:45 +00:00
Christoph Pillmayer
b530692529 panvk: Allow invalid enum values in get_image_format_properties
This is allowed with VK_KHR_maintenance5 which we support for v10+.

Fixes: 85b6bd989e ("panvk: Advertise support for VK_KHR_maintenance5")

Reviewed-by: Olivia Lee <olivia.lee@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36065>
2025-07-14 11:21:48 +00:00
Loïc Molinari
ee555e9f75 panfrost: Test pan_afbc_payload_layout_packed()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35001>
2025-07-12 11:58:14 +00:00
Loïc Molinari
49efe0e6c0 panfrost: Optimize pan_afbc_payload_layout_packed() for AArch32
This commit proposes an optimized version using Arm A32 NEON
intrinsics.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35001>
2025-07-12 11:58:14 +00:00
Loïc Molinari
5f5b8b1db3 panfrost: Optimize pan_afbc_payload_layout_packed() for AArch64
Payload size retrieval can greatly benefit from using SIMD to sum up
the 16 6-bit packed sizes. This commit proposes an optimized version
using Arm A64 NEON intrinsics. This was measured on a Rock 5B to be ~2
times faster than the original.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35001>
2025-07-12 11:58:14 +00:00
Loïc Molinari
a9a3ee3719 panfrost: Get AFBC-P payload layout on the CPU
The AFBC-P payload layout is currently retrieved in 2 steps starting
with the payload sizes retrieval using a CS job on the GPU followed by
a CPU pass to set the payload offsets. This commit proposes to do both
steps on the CPU at once using a new utility function
pan_afbc_payload_layout_packed().

A new utility function pan_afbc_payload_uncompressed_size() is added
to help retrieve the uncompressed size from a pipe_format and
modifier. Both the CPU and GPU versions use it now.

A new AFBC-P driconf option "pan_afbcp_gpu_payload_sizes" is added to
fallback to the original payload sizes retrieval on the GPU.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35001>
2025-07-12 11:58:14 +00:00
Loïc Molinari
f750620982 panfrost: Improve AFBC header block accesses
Add an AFBC header block structure pan_afbc_headerblock to improve
readability when accessing header blocks. get_superblock_size(), which
will be used for AFBC packing in the next commits, has been moved to
pan_afbc.h and renamed to pan_afbc_payload_size() so that it can be
tested. Other utility functions pan_afbc_header_subblock_size() and
pan_afbc_header_subblock_uncompressed_size() hasve been added to help
retrieve the compressed or uncompressed size of a subblock from a
header. This commit also fixes a few issues like arch handling.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35001>
2025-07-12 11:58:14 +00:00
Christian Gmeiner
ec9a2aa2e4 nir: Unvendor sampler_lod_parameters(_pan)
Will be used by etnaviv too.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35753>
2025-07-12 10:48:03 +00:00
Ashley Smith
e55e63c5a7 panvk: Enable VK_KHR_shader_atomic_int64 on Valhall
Bifrost will require more work

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Signed-off-by: Ashley Smith <ashley.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35789>
2025-07-11 12:42:30 +00:00
Ashley Smith
c88c66754c pan/va: Add support for 64-bit atomic operations
Adds support for 64-bit atomic operations for KHR_shader_atomic_int64
using 64-bit atomic instructions. Valhall is working but Bifrost will
require some more work to implement as it requires two instructions to
execute a 64-bit atomic.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Signed-off-by: Ashley Smith <ashley.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35789>
2025-07-11 12:42:30 +00:00
Ashley Smith
c3a21fb0af bi/va: Add instructions required for KHR_shader_atomic_int64
Add 64-bit atomic instructions for bifrost/valhall

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Signed-off-by: Ashley Smith <ashley.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35789>
2025-07-11 12:42:30 +00:00
Mary Guillemard
d08a21b7a3 panvk: Fix wrong reporting of subgroup size for executable properties
Fixes: 563823c9ca ("panvk: Implement vk_shader")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Caterina Shablia <caterina.shablia@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36006>
2025-07-10 08:01:25 +00:00
Mary Guillemard
db5ad8e3d2 pan/bi: Disallow FAU for CLPER in bi_check_fau_src
Previously this was allowing invalid forms like
"CLPER.i32.subgroup8.zero lane-id, src1" to reach bi_pack.

This fixes the assert that can be seen with
"dEQP-VK.glsl.derivate.dfdxsubgroup.*" but doesn't fix failures.

Fixes: 0acc6b564e ("pan/bi: Rework FAU lowering")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36006>
2025-07-10 08:01:25 +00:00
Mary Guillemard
48d716a05f pan/bi: Do not allow passthrough for instructions disallowing temps
Previously we were allowing passthrough to temps without using
bi_reads_temps.

This was causing instructions like CLPER to create undefined encodings.

We now check if the instruction support temps.

Fixes: 4252fb84f4 ("pan/bi: Add passthrough register rewriting helper")
Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36006>
2025-07-10 08:01:25 +00:00
Yiwei Zhang
187956bd51 panvk: adopt wsi_common_get_memory
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35875>
2025-07-09 23:45:04 +00:00
Gorazd Sumkovski
7bc1c456cb panfrost: Fix incorrect condition in assert
Since commit 8bb46de0, the correct way to check for a compute shader is
with `gl_shader_stage_is_compute()`.

Fixes: d2838f3c ("pan/bi: handle barriers with SUBGROUP scope")

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35957>
2025-07-09 21:05:54 +00:00
Daniel Stone
94b51503b3 vulkan: Remove build-system remnants of wl_drm support
We don't need to depend on the generated wl_drm files, as wl_drm support
was removed from Vulkan quite some time ago.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: e090316570 ("vulkan/wsi/wayland: drop support for wl_drm")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35885>
2025-07-09 17:49:58 +00:00
Eric Engestrom
563bfa2c17 panfrost/meson: drop invalid C-only -Wno-override-init from C++ args
cc1plus: warning: command-line option '-Wno-override-init' is valid for C/ObjC but not for C++

Missed this one in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35892

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36020>
2025-07-09 15:44:52 +00:00
Simon Perretta
1f1b3cc200 nir/precompiled: add shader stage option to nir_precompiled_build_variant
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36001>
2025-07-09 13:14:41 +01:00
John Anthony
aaf29ade1c panvk: Enable VK_ARM_shader_core_properties
The extension allows returning 0 if a given rate is unknown, which
allows us to support this on all GPUs, but since the extension depends
on Vulkan 1.1, we only expose it on v10+ for now.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35155>
2025-07-09 08:40:12 +00:00
John Anthony
30a2847d39 pan/lib: Add some shader core properties to model table
Adds pixel rate, texel rate, and fma rate to the model table for v9+
GPUs. This will be exposed via VK_ARM_shader_core_properties and
GL_ARM_shader_core_properties later.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35155>
2025-07-09 08:40:12 +00:00
Boris Brezillon
d14f2df85a pan/kmod: Expose the raw GPU ID through pan_kmod_dev_props
Rather than splitting the GPU ID in two, let the GPU ID users do that
when they need.

We also rework the model detection to use a mask so we can customize
the mask if the version major/minor fields are required to differentiate
two GPUs with the same arch major/minor and product major.

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35155>
2025-07-09 08:40:12 +00:00
Daniel Schürmann
2c51a8870d nir: add nir_vectorize_cb callback parameter to nir_lower_phis_to_scalar()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Similar to nir_lower_alu_width(), the callback can return the
desired number of components for a phi, or 0 for no lowering.

The previous behavior of nir_lower_phis_to_scalar() with lower_all=true
can be elicited via nir_lower_all_phis_to_scalar() while the previous
behavior with lower_all=false now corresponds to nir_lower_phis_to_scalar()
with NULL callback.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35783>
2025-07-08 15:33:59 +00:00
Christoph Pillmayer
0dd73981b2 panvk: Fix IUB desc type check
Fixes: 2ec6527c70 ("panvk: Implement VK_EXT_inline_uniform_block")

Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35969>
2025-07-08 10:49:15 +00:00
Marek Olšák
8def3f865d agx,freedreno,intel,lima,panfrost,svga,virgl,zink: fix supports_indirect_inputs
The GLSL compiler always lowers inputs to temps for VS and GS, so exclude
them from driver support because the GLSL compiler will no longer do that
unconditionally. Thus, indirect VS and GS inputs are completely untested
and broken in a lot of drivers.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35945>
2025-07-08 06:11:42 +00:00
Eric R. Smith
6c64ad934f panfrost: spill registers in SSA form
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Before doing register allocation, use information available from
the SSA representation to determine register pressure and to
spill registers. This spilling doesn't have to be perfect (the
register allocator is still allowed to spill) but it will be
much faster to do the SSA spilling than RA spilling. In general
this should vastly improve the performance of register allocation.

Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34446>
2025-07-07 19:49:37 +00:00
Alyssa Rosenzweig
d31cb824df treewide: use VARYING_BIT_*
Some checks failed
macOS-CI / macOS-CI (dri) (push) Has been cancelled
macOS-CI / macOS-CI (xlib) (push) Has been cancelled
Via Coccinelle patch generated by the following Python:

  varys = [ "POS", "COL0", "COL1", "FOGC", "TEX0", "TEX1", "TEX2", "TEX3", "TEX4",
           "TEX5", "TEX6", "TEX7", "PSIZ", "BFC0", "BFC1", "EDGE", "CLIP_VERTEX",
           "CLIP_DIST0", "CLIP_DIST1", "CULL_DIST0", "CULL_DIST1", "PRIMITIVE_ID",
           "PRIMITIVE_COUNT", "LAYER", "VIEWPORT", "FACE",
           "PRIMITIVE_SHADING_RATE", "PNTC", "TESS_LEVEL_OUTER",
           "TESS_LEVEL_INNER", "PRIMITIVE_INDICES", "BOUNDING_BOX0",
           "BOUNDING_BOX1", "VIEWPORT_MASK", "CULL_PRIMITIVE" ]
  t = """
  @@
  @@

  -(1 << VARYING_SLOT_${V})
  +VARYING_BIT_${V}

  @@
  @@

  -BITFIELD_BIT(VARYING_SLOT_${V})
  +VARYING_BIT_${V}

  @@
  @@

  -(1ull << VARYING_SLOT_${V})
  +VARYING_BIT_${V}

  @@
  @@

  -BITFIELD64_BIT(VARYING_SLOT_${V})
  +VARYING_BIT_${V}

  """
  for v in varys:
      from mako.template import Template
      print(Template(t).render(V = v))

Closes: #13453
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> [panfrost, common]
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> [broadcom]
Reviewed-by: Corentin Noël <corentin.noel@collabora.com> [virgl]
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> [zink]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35917>
2025-07-04 19:01:04 +00:00
Eric Engestrom
0c641c8170 panfrost/meson: drop invalid C-only -Wno-override-init from C++ args
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
cc1plus: warning: command-line option '-Wno-override-init' is valid for C/ObjC but not for C++

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35892>
2025-07-04 13:03:46 +00:00
Lars-Ivar Hesselberg Simonsen
84fd6b67dd panvk: Advertise VK_KHR_unified_image_layouts
We're currently not using image layouts in PanVK so we can advertise
this extension without additional changes.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35911>
2025-07-04 09:26:34 +00:00
Valentine Burley
486c51db95 panvk/ci: Run full g52-vk job pre-merge
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We have enough DUTs to increase the job parallelism to 8. At this level,
the runtime reported by deqp-runner averages about 8:30, which is below
the 10-minute target recommended by the docs.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35913>
2025-07-04 08:05:42 +00:00
Mary Guillemard
14608f1469 panvk: Do not adjust job offset with base on CSF
The JOB_OFFSET only actually affect the global id and not wg id.

In NIR common, we assume that if base wg isn't supported, it means that
global and wg id already contains it.

To follow the convention around, we remove the offset to assume
global id will need an offset added.

Alone, this doesn't change functionality as we always lower away global
id so far.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35909>
2025-07-03 16:41:51 +00:00
Mary Guillemard
a3272cd0ce pan/genxml: Fix wrong size for compute size workgroup
Fix annoying warnings when decoding CSF.

Signed-off-by: Mary Guillemard <mary.guillemard@collabora.com>
Fixes: 486c341769 ("panfrost: Add architecture description XML for v10")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35909>
2025-07-03 16:41:51 +00:00
Erik Faye-Lund
fcc0585195 panvk: implement VK_EXT_non_seamless_cube_map support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This maps trivially to a sampler-bit, so let's just expose it.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35886>
2025-07-03 10:54:50 +00:00
Erik Faye-Lund
618c137b29 panvk: pass flags to panvk_sampler_fill_desc
This will be useful in the next commit.

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35886>
2025-07-03 10:54:50 +00:00
Erik Faye-Lund
c30de16970 panvk: fixup bad indent
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35886>
2025-07-03 10:54:50 +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