Commit graph

5577 commits

Author SHA1 Message Date
Marek Olšák
65ace5649b nir: reject unsupported component counts from all vectorize callbacks
If you allow an unsupported component count in the callback for loads,
nir_opt_load_store_vectorize will align num_components to the next supported
vector size, essentially overfetching.

This changes all callbacks to reject it. AMD will enable it in a later commit.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29398>
2024-10-15 05:50:24 +00:00
Marek Olšák
02923e237d nir: add hole_size parameter into the vectorize callback
It will be used to allow merging loads with a hole between them.

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29398>
2024-10-15 05:50:24 +00:00
Zan Dobersek
61ad069a21 freedreno: sanitize device names for config name usage
Names used in libconfig's configuration files only allow alphanumerics,
underscores, dashes and asterisks. Freedreno device names, used as names
in fdperf.cfg, can also contain other characters, currently spaces and
plus characters. Not accounting for those makes it impossible to store
fdperf configuration across separate runs.

Once the Freedreno device name is retrieved, it's now sanitized for use
in fdperf.cfg. Unsupported characters are converted to underscores.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31577>
2024-10-10 11:48:45 +00:00
Guilherme Gallo
59d909eb56 ci/lava: Make perf jobs use pyutils artifact
Following the merge of Merge Request #31151, we encountered an issue
where the performance jobs were failing silently. Although these
failures did not cause the pipeline to fail, they resulted in warnings
for all merge requests that ran the .*-traces-performance jobs, putting
critical performance data for the [Mesa Performance Driver
dashboard](https://ci-stats-grafana.freedesktop.org/goto/G3xkvykHg?orgId=1)
at risk.

To resolve this issue, this commit updates the LAVA performance jobs to
utilize the Pyutils artifact package, which is now the only required
artifact for the jobs that run the LAVA job submitter.

Fixes: dd5d737e6c ("ci/lava: Use new pyutils container")

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31553>
2024-10-10 01:33:16 +00:00
Rob Clark
f54748ea38 freedreno/drm: Add preemption support
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott
c7a7f6dad8 tu: Add TU_DEBUG=hiprio
The same as FD_MESA_DEBUG=hiprio in freedreno.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott
1d2b479a3b tu: Allow being preempted on a7xx
This is only tested on a7xx so far, although it should work on a6xx too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott
3631f9ad62 tu/virtio: Make virtio_simple_ioctl take a vdrm_device
We need to do an ioctl in order to try to create a queue before the
tu_device is created.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott
700e26a448 tu: Emit CP_SET_AMBLE packets
Make sure skipsaverestore works.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott
db86c4c496 tu: Simplify device startup CS creation
We have a few different command streams we create at startup. Simplify
the initialization by creating a single sub_cs to allocate all of the
cs's out of and inlining structures where appropriate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:46 +00:00
Connor Abbott
acdbfe9812 tu: Re-emit LRZ state before each bin
Similar to the bin size register, even though this is the same for each
bin it needs to be re-emitted to make skipsaverestore work.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Connor Abbott
b9d9fdb6d1 tu: Write bin size for each bin
While the register is constant for all bins in the render pass, it is
not saved and restored with level 1 preemption with skipsaverestore=1 so
it needs to be restored. Follow what the blob does and set it before
each bin.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Connor Abbott
4d75a4ac4b tu: Split out register setting from tu6_init_hw()
Split out the parts that will also have to be done in the bin restore
IB.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Connor Abbott
a9f88ff2af tu: Don't WFI after initializing RB_CCU_CNTL on a7xx
There's no reason to do this and the blob doesn't.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Jonathan Marek
b6432a6c66 freedreno/a6xx: add missing USES_GMEM flag and BIN_RENDER_END markers
Add USES_GMEM flag to indicate that GMEM is in use, so that preemption can
know it needs save and restore GMEM contents.

The missing BIN_RENDER_END markers are also added, their purpose is to
clear the USES_GMEM flag once GMEM is no longer in use.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Jonathan Marek
72900e1aac freedreno: improve a6xx CP_SET_MARKER xml definition
Use real names for most of a6xx_marker enum, add USES_GMEM, remove
overlapping bitfields.

Note the actual "real names" start with PM4_RENDER_MODE_ instead of RM6_

This is a small change to adreno_pm4.xml, with the corresponding
find/replace and updated ci references

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30544>
2024-10-10 00:50:45 +00:00
Connor Abbott
022fb8e4c7 ir3, turnip: Support VK_*_compute_shader_derivatives on a7xx
Quad derivative groups are supported since a7xx using the tiling mode
bit. Linear derivative groups may also work on a6xx but I haven't tested
it yet.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31130>
2024-10-10 00:14:04 +00:00
Danylo Piliaiev
b31a4037de tu/a750: Workaround GPU fault when fast-clearing R8G8 formats
Clearing VK_FORMAT_R8G8_* with fast-clear value and certain
dimensions (e.g. 960x540), and having GMEM renderpass afterwards
may lead to a GPU fault on A7XX.

Prop driver directly clears UBWC layers for R8G8_UNORM, and
doesn't use UBWC for R8G8_UINT. It uses generic clear for R8G8 only
for renderpass, where doesn't cause issues in Turnip.

Fixes GPU fault in Limbo game running via Zink.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31258>
2024-10-09 22:01:10 +00:00
Rob Clark
85d7826afa freedreno/ir3: Add more cat1 float-immed cases
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31446>
2024-10-08 13:50:05 +00:00
Rob Clark
8ddfe9cfc8 freedreno/ir3: Fix cat1 parser ambiguity vs FLUTs
The lexer can't really tell the difference.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31446>
2024-10-08 13:50:05 +00:00
Rob Clark
0633a23dc9 freedreno/ir3: Add half-FLUT cases
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31446>
2024-10-08 13:50:05 +00:00
Rob Clark
771fe03787 freedreno/ir3: Fix GPU name in disasm test
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31446>
2024-10-08 13:50:05 +00:00
Alyssa Rosenzweig
f7d45cb362 tu/virtio: silence startup spam on asahi
quiet a big pile of:

TU: error: ../src/freedreno/vulkan/tu_knl_drm_virtio.cc:1299: could not get connect vdrm: No such file or directory (VK_ERROR_INCOMPATIBLE_DRIVER)

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31243>
2024-10-04 16:30:17 +00:00
Karmjit Mahil
581c99b30c ir3: Use foreach_instr_safe in ir3_shared_folding
When processing the last instruction prior to the block terminator,
ir3_shader_folding can append a new instruction prior to the
terminator, so the `current_instruction->next == new_instruciton`
instead of `current_instruction->next == terminator` which leads
to the assert in `foreach_instr` being hit, so use
`foreach_instr_safe`.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31478>
2024-10-04 13:49:57 +00:00
Danylo Piliaiev
e5d3eba096 u_trace: Fix trace_payload_as_extra_func desync between drivers
Buffer with indirect args wasn't passed to the function which
adds extra event args. Since function definition depends on the
common code, the definition is moved to a single place.

Fixes: 0a17035b5c
("u_trace: add support for indirect data")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31090>
2024-10-03 20:25:48 +00:00
Eric Engestrom
50f04a8e99 turnip/ci: mark vkd3d test_planar_video_formats as fixed
Fixed by a commit in the 765d1c47...366f63fd range, likely !31304

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31483>
2024-10-02 15:03:56 +00:00
Mark Collins
30dc71b060 tu: Improve 2D buffer-to-image copies for A7XX
A7XX supports buffer-to-images copies with a lower alignment requirement
for the pitch and start VA, this makes it unnecessary to loop over every
row and copy them individually for any previously unaligned images. The
new alignment requirements match Vulkan requirements and should cover
all cases that aren't handled by 3D copies.

This can result in a significant performance improvement, up to 10x or
more in some cases.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31401>
2024-10-02 12:56:40 +00:00
Mark Collins
73e7ba8f14 freedreno/registers: Document TPL1_2D_SRC_CNTL register
This A7XX register is used for defining properties of the source buffer
for the 2D copies.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31401>
2024-10-02 12:56:40 +00:00
Job Noorman
f73d2eedfd tu: advertise shaderInt64
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31455>
2024-10-02 06:35:49 +00:00
Job Noorman
38604485be ir3: add support for 64b reductions
The existing scan/reduce macros (OPC_SCAN_MACRO/OPC_SCAN_CLUSTERS_MACRO)
hard code the reduction operations in ir3. Adding support for 64b
operations will blow up these already complicated macros. Implement a
simple scan loop in NIR for the few (hopefully rare) cases where the
generic passes cannot lower the reduction to 32b.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31455>
2024-10-02 06:35:49 +00:00
Job Noorman
52c456c641 tu: lower 64b push constants before lowering IO
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31455>
2024-10-02 06:35:49 +00:00
Job Noorman
8a17eb5377 ir3: make ir3_mem_access_size_align publically available
We want to reuse it from tu_shader.cc.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31455>
2024-10-02 06:35:49 +00:00
Job Noorman
aa9b8316ae ir3: lower 64b SSBO accesses
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31455>
2024-10-02 06:35:49 +00:00
Job Noorman
c515d4bd81 ir3: run 64b phi lowering together with other 64b lowerings
nir_lower_64bit_phis was run in ir3_optimize_loop where it would fight
with nir_opt_if, causing shader compilation hangs. There's no point in
running this pass in the optimization loop as 64b phis should be lowered
together with the other 64b operations and then never appear again.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10355
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31455>
2024-10-02 06:35:49 +00:00
Job Noorman
ad12886775 ir3: lower 64b intrinsics after generic 64b lowering
ir3_nir_lower_64b_intrinsics will blindly set the def bit size to 32 for
unknown intrinsics. Give the generic passes a chance to lower them
first.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31455>
2024-10-02 06:35:49 +00:00
Craig Stout
e2388350f2 tu: add OS guards to drm_format_mod
vk_image.h has these guards, and any non-{Linux}/{BSD}
compile would hit this issue.

The alternative is just to remove the OS-specific guards
in vk_image.h, since the modifier is just 64-bit opaque
number and theoretically can work on any OS, though the
non-Linux spec language is lacking.

Acked-by: Rob Clark <robdclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31453>
2024-10-01 19:17:25 +00:00
Valentine Burley
38ba3ea469 tu: Add an assert to tu6_plane_index
Like hk_image_aspects_to_plane in Honeykrisp, assert that non-depth/stencil formats have one aspect.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
9aaf115316 tu: Update comments about the blob driver
Newer versions of the blob don't seem to expose linear features for VK_FORMAT_D32_SFLOAT_S8_UINT,
but they advertise VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT for more formats now.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
087679343f tu: Use v2 format feature flags
Turnip supports VK_KHR_format_feature_flags2 but has been using a mixture of VK_FORMAT_FEATURE and
VK_FORMAT_FEATURE_2 flags. Always use the new 64-bit flags.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
296ea45bc9 tu: Set some feature bits earlier
Assign the feature bits for depth formats and VK_FORMAT_*_PACK16 earlier.
If we configure their optimalTilingFeatures before we copy those over to linearTilingFeatures
we don't have repeat them.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
c3dd62840b tu: Unify zeroing bufferFeatures
We have to disable bufferFeatures for a format for various reasons. Do this in one place for comprehensibility.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
03c75d32fd tu: Introduce tu_aspects_to_plane helper function
Add and use a new helper function, tu_aspects_to_plane, that combines tu6_plane_index and tu6_plane_format.

This allowed for spotting and fixing a copy-paste mistake in tu6_blit_image, in dst_format for D32_S8.
The existing code wouldn't return the right dst_format if you blitted an S8 image to the stencil aspect
of a D32_S8 image, which should be a legal thing to do.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
21181fb4f2 tu: Use existing helpers in tu_clear_blit
Use existing helpers for deciding the VK format to treat our data as for memcpy-style blits.
No need to special case these a second time when it's already done in our helpers.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
827e9bc0f4 tu: Use vk_format_get_plane_format
Use vk_format_get_plane_format for determining the plane format of multi-plane YCbCr formats where possible.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
39d943874e tu: Fix conditional check in tu_image_view_init
Only call tu6_plane_format for VK_FORMAT_D32_SFLOAT_S8_UINT in tu_image_view_init.
vk_format is always a single plane format here but checking the aspect mask wasn't enough.
It was possible for e.g. R8_UNORM to not have VK_IMAGE_ASPECT_COLOR_BIT apsect mask but a
PLANE aspect mask in formats like G8_B8_R8_3PLANE_420_UNORM.

This was masked by the default case in tu6_plane_format, which just returned vk_format_to_pipe_format
anyway without checking the plane index.

We need to fix this for when we switch tu6_plane_format to using vk_format_get_plane_format, where we
would otherwise trip an assert.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
7bd97313e5 tu: Use vk_format_get_plane_count instead of special casing
Use the vk_format_get_plane_count helper in tu_image_view_init instead of
checking the formats directly.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
913d452dc5 tu: Be more consistent with using vk_format helpers
We've been using a mixture of util_format and vk_format helpers.
Always use the vk_format ones when available.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:01 +00:00
Valentine Burley
c5d180a0bb tu: Streamline setting YCbCr feature bits
Use ycbcr_info instead of checking the layout or the format directly.
Swap the order of the if statement for clarity.
These should make the code significanntly easier to read.

Also document Chia-I's findings on SEPARATE_RECONSTRUCTION_FILTER_BIT.

Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31304>
2024-10-01 18:44:00 +00:00
Connor Abbott
5a42df669b ir3: Ban conversions with mismatching sizes
This prevents folding something like this:

add.u hrA, hrB, hrC
mov.u8u32 rD, hrA

When I wrote this I assumed that because the conversion source and ALU
destination were the same register that meant the types must have the
same size, but that's not the case with u8 which is an 8-bit type in a
16-bit register, so this could've been broken with 8-bit types.

Fixes: f58e1ef7ec ("tu: enable shaderInt8 support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31399>
2024-10-01 15:17:11 +00:00
Job Noorman
211616cc98 ir3: disallow immediates for shfl src1
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: d43f39678c ("ir3: make backend aware of shfl:")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31457>
2024-10-01 13:48:40 +00:00