Commit graph

208563 commits

Author SHA1 Message Date
Yogesh Mohan Marimuthu
b55ee5f335 radeonsi: rename sctx->has_graphics to sctx->is_gfx_queue
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:26 +00:00
Yogesh Mohan Marimuthu
761496b49e radeonsi: has_kernelq_reg_shadowing failure means driver failed
If register shadowing enabling failed, then driver ctx init will
fail instead of disabling register shadowing.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:26 +00:00
Yogesh Mohan Marimuthu
0068dbd76b ac: enable kernelq reg shadowing only when userq is disabled
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:25 +00:00
Yogesh Mohan Marimuthu
1000ee3d2f ac,radeonsi,radv: rename register_shadowing_required
rename register_shadowing_required to has_kernelq_reg_shadowing

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35106>
2025-07-13 20:05:25 +00:00
Asahi Lina
067d820c9d asahi: Mark KMS exported resource BOs as shared
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes: #13524

Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36097>
2025-07-13 17:43:06 +00:00
Asahi Lina
a8f33c35f9 asahi: Add BO handles to resource debug
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36097>
2025-07-13 17:43:06 +00:00
Asahi Lina
c6e959c871 asahi: Add refcnt assert to agx_bo_unreference()
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36097>
2025-07-13 17:43:06 +00:00
Rob Clark
09936883a4 freedreno: dump layout in import path as well
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:54 +00:00
Rob Clark
65931bfc7f freedreno: Move layout to layout_resource_for_handle()
This is already done for a6xx.  For everyone else move it out of the
common code path and into fd_layout_resource_for_handle().

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:54 +00:00
Rob Clark
329a022894 freedreno/a6xx: Use metadata to resolve INVALID modifier
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:53 +00:00
Rob Clark
b4b1573258 freedreno/a6xx: Refactor handle import
Explicitly layout the resource in all cases, rather than depending on
the partial/incomplete layout that is done in fd_resource_from_handle()
(which will be going away).

Now that we are not YOLOing the layout, it turns up some questionable
assumptions in piglit.  Just mark those xfails for now.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:53 +00:00
Rob Clark
27b0f64b3e freedreno/a6xx: Use handle for explicit layout
Use the winsys_handle to get the fdl_explicit_layout params rather than
relying on pre-populated layout params.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:53 +00:00
Rob Clark
eb7e6a567e freedreno: Pass handle down to layout_resource_for_modifier
And rename it to layout_resource_for_handle.  The handle contains
additional information such as the pitch/offset for the imported
buffer.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:53 +00:00
Rob Clark
091313c558 freedreno/layout: Remove unneeded shims
Now that everything is migrated, we can drop the backwards-compat shims.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:52 +00:00
Rob Clark
e55c6c5f25 freedreno/a6xx: Convert to fdl6_layout_image
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:52 +00:00
Rob Clark
b6e27a9f57 freedreno/a5xx: Convert to fdl5_layout_image
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:52 +00:00
Rob Clark
617969d8a2 freedreno: Move layout init to backends
Export the existing helper, and call it from the legacy backends which
are not using fdl.

This moves all the layout initialization to the backends (and eventually
to fdl for the backends using that).

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:52 +00:00
Rob Clark
4d4745764c freedreno: Pass layout type to backend
Pass the layout type to setup_slices, renamed to layout_resource, to
move some of the partial layout initialization to the gen specific
backend.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:51 +00:00
Rob Clark
34153d92b5 freedreno: Add helper to initialize layout params
No point in duplicating this in many places.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:51 +00:00
Rob Clark
43bd9082fa freedreno: Don't call setup_slices for buffers
We already use fdl_layout_buffer() when the resource is allocated.  But
it was missed to convert fd_resource_resize().  Convert it so there is
no path into ->setup_slices() with something that is a buffer.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:51 +00:00
Rob Clark
d485c7b446 turnip: convert to fdl6_layout_image
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:50 +00:00
Rob Clark
15bccc29bd freedreno/layout: Introduce fdl_image_params
fdl6_layout() (and to a lesser degree) fdl5_layout() is growing an
unwieldly argument list, and it isn't obvious at first glance what
fdl_layout fields should be initialized before calling it.  So split
out a fdl_image_params struct to clean this up.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:50 +00:00
Rob Clark
52f79561e3 freedreno: Misc whitespace cleanups
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36075>
2025-07-13 17:16:50 +00:00
M Henning
ee3d6aa87d nv50_ir: Remove dead variable
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Nothing ever read from fixedReg, so drop it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24541>
2025-07-13 15:27:33 +00:00
M Henning
e573440a5d nv50_ir_ra: Don't coalesce mixed constraints
It's difficult to handle nodes that have both fixed reg constraints and
compMasks. We may be able to handle some of these in the future, but
skip them for now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24541>
2025-07-13 15:27:33 +00:00
M Henning
b920ff26ee nv50_ir_ra: Use propagated compMask for reg offset
Previously, we would only offset register ids for LValues that are
directly used in a merge/split instruction, but this is incorrect.
We instead need to apply the offset to all LValues that compMask
has been propagated to. By calcuating this from compMask instead
of figuring it out a second time, we fix that issue and also manage
to simplify the code a bit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24541>
2025-07-13 15:27:32 +00:00
M Henning
a46942ce04 nv50_ir_ra: Add constraint movs for split-of-split
This handles this case similarly to the merge-of-merge fix from c86563c2

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24541>
2025-07-13 15:27:32 +00:00
M Henning
7e653b2eb1 nv50_ir_ra: Remove an assign to lval->compMask
This code previously stored two rather different masks in compMask:
 1. from merge/splits (calculated in makeCompound), and
 2. in the join root for whatever register was assigned

Since we were already calculating the second type as intfMask where it
is used in checkInterference(), change that function to unconditionally
use intfMask and only use compMask for the first type.

This is functionally equavalent and keeps the types of masks separate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24541>
2025-07-13 15:27:31 +00:00
Karol Herbst
facb048cdb nouveau: move util_framebuffer_init into the driver
It will get cleaned up later. Maybe.

Also stop setting the context or the reference. It's all dead code now.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35806>
2025-07-13 15:12:48 +00:00
Karol Herbst
5a91e04fa4 nvc0: remove dead surface tracking code
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35806>
2025-07-13 15:12:48 +00:00
Karol Herbst
2a8779f06f nv50,nvc0: Set the texture for 3D blitter surfaces
This fixes accesses to unitialized data inside pipe_surface_width.

Fixes: 2eb45daa9c ("gallium: de-pointerize pipe_surface")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35806>
2025-07-13 15:12:48 +00:00
Karol Herbst
c96003305e nak: keep phis vectorized if they fit into a register
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Totals:
CodeSize: 936990448 -> 936472720 (-0.06%); split: -0.07%, +0.01%
Number of GPRs: 3539184 -> 3539100 (-0.00%); split: -0.00%, +0.00%
SLM Size: 870756 -> 864200 (-0.75%); split: -0.82%, +0.07%
Static cycle count: 224606486 -> 224173176 (-0.19%); split: -0.21%, +0.02%
Spills to memory: 66542 -> 60425 (-9.19%); split: -9.90%, +0.71%
Fills from memory: 66542 -> 60425 (-9.19%); split: -9.90%, +0.71%
Spills to reg: 68126 -> 68173 (+0.07%)
Fills from reg: 80583 -> 80659 (+0.09%)
Max warps/SM: 3666280 -> 3666276 (-0.00%); split: +0.00%, -0.00%

Totals from 200 (0.23% of 87622) affected shaders:
CodeSize: 5705936 -> 5188208 (-9.07%); split: -10.75%, +1.67%
Number of GPRs: 8160 -> 8076 (-1.03%); split: -1.78%, +0.75%
SLM Size: 40432 -> 33876 (-16.21%); split: -17.76%, +1.54%
Static cycle count: 2163142 -> 1729832 (-20.03%); split: -21.97%, +1.94%
Spills to memory: 30113 -> 23996 (-20.31%); split: -21.88%, +1.57%
Fills from memory: 30113 -> 23996 (-20.31%); split: -21.88%, +1.57%
Spills to reg: 3438 -> 3485 (+1.37%)
Fills from reg: 3836 -> 3912 (+1.98%)
Max warps/SM: 9064 -> 9060 (-0.04%); split: +0.26%, -0.31%

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35604>
2025-07-13 10:39:53 +00:00
Karol Herbst
cd79b8f798 nak: stop lowering all phis to 32 bits.
We don't support anything than 32 bit registers, so consuming 8 or 16 bit
phis caused NAK to insert a bunch of prmt instructions to/from 32 bit
registers per phi component. This effectively increased GPR usage in
shaders making heavy use of 16 bit vectors across phis.

Totals:
CodeSize: 938024464 -> 936990448 (-0.11%)
Number of GPRs: 3539320 -> 3539184 (-0.00%); split: -0.00%, +0.00%
SLM Size: 876376 -> 870756 (-0.64%)
Static cycle count: 224999103 -> 224606486 (-0.17%); split: -0.17%, +0.00%
Spills to memory: 77413 -> 66542 (-14.04%)
Fills from memory: 77413 -> 66542 (-14.04%)
Spills to reg: 68211 -> 68126 (-0.12%)
Fills from reg: 80596 -> 80583 (-0.02%)
Max warps/SM: 3666268 -> 3666280 (+0.00%); split: +0.00%, -0.00%

Totals from 550 (0.63% of 87622) affected shaders:
CodeSize: 17505040 -> 16471024 (-5.91%)
Number of GPRs: 32938 -> 32802 (-0.41%); split: -0.45%, +0.04%
SLM Size: 55456 -> 49836 (-10.13%)
Static cycle count: 5032394 -> 4639777 (-7.80%); split: -7.81%, +0.01%
Spills to memory: 42584 -> 31713 (-25.53%)
Fills from memory: 42584 -> 31713 (-25.53%)
Spills to reg: 4285 -> 4200 (-1.98%)
Fills from reg: 4279 -> 4266 (-0.30%)
Max warps/SM: 19492 -> 19504 (+0.06%); split: +0.08%, -0.02%

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35604>
2025-07-13 10:39:53 +00:00
Karol Herbst
7e1d1e2caa nak: Provide our own callback to nir_lower_phis_to_scalar
The default callback of nir_lower_phis_to_scalar internally uses
is_phi_src_scalarizable to determine wether to scalarize a phi vector,
however not doing that helps NAK.

shader-db stats on ga102:

Totals:
CodeSize: 938039520 -> 938024464 (-0.00%); split: -0.00%, +0.00%
SLM Size: 878396 -> 876376 (-0.23%)
Static cycle count: 225000863 -> 224999103 (-0.00%); split: -0.00%, +0.00%

Totals from 140 (0.16% of 87622) affected shaders:
CodeSize: 1353760 -> 1338704 (-1.11%); split: -1.42%, +0.31%
SLM Size: 8160 -> 6140 (-24.75%)
Static cycle count: 316178 -> 314418 (-0.56%); split: -0.71%, +0.16%

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35604>
2025-07-13 10:39:52 +00:00
Yiwei Zhang
c16e786c75 vulkan/wsi: drop unused common wsi helpers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Below are dropped:
- wsi_common_get_image
- wsi_common_bind_swapchain_image

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36095>
2025-07-13 07:49:10 +00:00
Yiwei Zhang
b2a880b85e hasvk: adopt wsi_common_get_memory
Similar to anv.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36095>
2025-07-13 07:49:10 +00:00
Yiwei Zhang
c647c422db hasvk: avoid leaking private binding for aliased wsi image
This time for hasvk and is the same with
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35893

Aliased wsi image has to share the same private binding with the
original wsi image for memory consistency. If the private binding
exists, it needs to be released before being overridden.

Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36095>
2025-07-13 07:49:10 +00:00
Yiwei Zhang
002235f64c anv: adopt wsi_common_get_memory
It's non-trivial to drop the private binding or transfer ownership to
the bound memory. So we track the image in the device memory for
dedicated allocation so that wsi image alias can find the original wsi
image from the wsi memory.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36095>
2025-07-13 07:49:09 +00:00
Gert Wollny
5d4f59a3ed r600/sfn: catch remaining indirect inputs when lowering GS input arrays
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Lowering IO to temps leads to problems with RA with piglit
   spec@glsl-1.50@execution@geometry@max-input-component

Not doing so results in an assertion failure with piglit
   spec@glsl-1.50@execution@geometry@dynamic_input_array_index

because not all indirect IO access is lowered. Using
nir_lower_indirect_derefs works around this limitations.

v2: Fix formatting (Patrick Lerda)

Fixes: 1186c73c6 (r600: implement gs indirect load_per_vertex_input)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36051>
2025-07-12 20:58:29 +00:00
Gert Wollny
00b752565c r600/sfn: Add support for indirect VS input read
I've overlooked that unconditionallowering of indirect VS
inputs had been dropped. Since VS inputs are stored in
consecutive registers one can implement the indirect access
without additional lowering, it just needs a proper declararion
of the registers forming the array.

v2: - Fix formatting (Patrick Lerda)
    - Use allocator for std::map to avvoid menory leak
      (Patrick Lerda)

Fixes: a43bfffe1e
    r600: Correct nir_indirect_supported_mask

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36051>
2025-07-12 20:58:29 +00:00
Caio Oliveira
ea9deafff4 spirv: Add more restrictions around Blocks
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
And take advantage of the new restriction to skip the ptr_as_array case
for Blocks.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36049>
2025-07-12 14:46:23 +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
Loïc Molinari
a0bdbcbae6 panfrost: Async AFBC packing debug info
Print the AFBC-P state of a resource along its asynchronous packing
process when PAN_MESA_DEBUG=forcepack. There's no need to prevent
tiling in that case now that packing maintains the tiling state.

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
91aa7c4f8d panfrost: Async AFBC packing
Pack AFBC resources asynchronously in order to prevent stalls at
texture upload waiting for 1) the AFBC staging blit (sparse encoding)
to complete and 2) the AFBC payload sizes retrieval.

After a texture upload, an AFBC resource is now progressively packed
at each read access once consecutively accessed a certain number of
times without a write access. This allows to prevent most stalls by
making AFBC packing a progressive async background process.

A useful side effect is that consecutive glTexSubImage*() calls on the
same texture (for texture atlases for instance) don't uselessly
respawn packing.

A new AFBC-P driconf option "pan_afbcp_reads_threshold" is added to
tweak the consecutive reads threshold.

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>
Reviewed-by: Ashley Smith <ashley.smith@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:13 +00:00
Loïc Molinari
df0e7e964d panfrost: Make panfrost_pack_afbc() static
It isn't used outside of pan_resource.c.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@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/35001>
2025-07-12 11:58:13 +00:00
Loïc Molinari
42c305def3 panfrost: Test mipmap chain validity in panfrost_should_pack_afbc()
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@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/35001>
2025-07-12 11:58:13 +00:00