Commit graph

7437 commits

Author SHA1 Message Date
Connor Abbott
9ee6a23b8f tu: Support VK_KHR_maintenance9
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40552>
2026-05-01 11:47:18 +00:00
Connor Abbott
789e765161 turnip, ir3: Use shader for vertex input count
Maintenance9 will require us to make unbound vertex inputs (that is,
attributes in the VS without a corresponding binding at the same
location) be defined. In order for this to work, VFD_FETCH_INSTR_INSTR
must be defined for all attributes used in the shader. Imagine we do
something like:

CmdSetVertexInputs(only 1 input at location 0)
CmdBindPipeline(VS reads only location 0)
CmdDraw()
CmdBindPipeline(VS reads locations 0 and 1)
CmdDraw()

For the first draw we only need to emit VFD_FETCH_INSTR_INSTR[0], for the
second draw we need to emit VFD_FETCH_INSTR_INSTR[1] as well in the VI
draw state. This unfortunately means we have to do draw-time validation
for vertex input state.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40552>
2026-05-01 11:47:18 +00:00
Connor Abbott
b8a5aeee48 tu: Don't zero-initialize query pool
The kernel already does this for us by zeroing new BOs. It's also
unnecessary, unless the newly-introduced
VK_QUERY_POOL_CREATE_RESET_BIT_KHR flags is used. If we ever start
suballocating query pools, we may have to zero based on that flag, but
for now we don't have to do anything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40552>
2026-05-01 11:47:18 +00:00
Connor Abbott
7171c3dd71 tu: Optimize sync2 event handling in the non-asymmetric case
Before we were falling back to always emitting a pipeline barrier, which
effectively kills any point of having the event. But with sync2 and the
guarantee that src/dst dependency infos match, we can instead emit the
flushes before writing the event and actually use the event as intended.
As a bonus, this also allows the BV to run ahead of the BR.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40552>
2026-05-01 11:47:18 +00:00
Emma Anholt
d8b525466c ir3: Fix shared IMAD24 lowering.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Caught by
dEQP-VK.spirv_assembly.instruction.compute.opsdotkhr.all_us_v2i16_out32
and friends in !41178

Fixes: b4874aa5cf ("ir3: Use scalar ALU instructions when possible")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41278>
2026-04-30 22:39:29 +00:00
Samuel Pitoiset
f2ce2868c5 ci: uprev vkd3d
This contains new tests for DGC+multiview which are valid in DX12
but invalid in Vulkan, unless RADV allows support for it. Important
to have coverage for us because it's used for Crimson Desert.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41193>
2026-04-30 15:00:02 +00:00
Danylo Piliaiev
59f626ac81 tu/u_trace: Fix explicit toggle_name not being used
Fixes: 889f71f71a ("tu: Add tracepoints for clear/copy/blit/lrz ops")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41102>
2026-04-29 20:17:35 +00:00
Danylo Piliaiev
6e8ec44287 tu/u_trace: Correct the order of tracepoints clonning for binning
Otherwise we'd get tracepoints out of logical order, which doesn't
matter for perfetto at the moment, but would matter with future
perf warnings.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41102>
2026-04-29 20:17:35 +00:00
Danylo Piliaiev
50cc9c723c tu/u_trace: Prevent cloning stale RB_DONE_TS results
Otherwise, at best, we get results for the previous tile.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41102>
2026-04-29 20:17:35 +00:00
Danylo Piliaiev
6ac25aac23 tu/u_trace: Use correct u_trace destination in tu_clone_trace_range
This fixes in-RP tracepoints not being duplicated for secondary
command buffers.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41102>
2026-04-29 20:17:35 +00:00
Emma Anholt
06ebe40ca1 tu: Set HALF_PRECISION on blits to R11G11B10.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes many new image_to_image tests copying to this format as of CTS
1.4.5.3.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41231>
2026-04-29 18:58:45 +00:00
Danylo Piliaiev
c2e78f1b22 tu: Fix CP_CCHE_INVALIDATE not being applied at the right point
Apparently CP_CCHE_INVALIDATE is just a plain register write underneath,
so it needs WFI before it, in order to invalidate at the right point.

```
CP_CCHE_INVALIDATE:
mov $addr, 0x9881
mov $data, 0x1
waitin
mov $01, $data
```

Fixes misrendering in Doom Eternal on A750.

Fixes: fb1c3f7f5d ("tu: Implement CCHE invalidation")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41266>
2026-04-29 16:25:16 +00:00
Job Noorman
aaf4d77f43 ir3/shared_ra: fix live-out reload after src reload
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When reloading live-out values along loop back-edges, we make sure to
reuse the original register. However, we failed to detect cases where
the spilled value got reloaded earlier for a src in a different
register. Fix this by reloading the value again in the original
register.

Fixes a RA validation failure in Windrose.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: fa22b0901a ("ir3/ra: Add specialized shared register RA/spilling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41262>
2026-04-29 14:40:48 +00:00
Valentine Burley
7f6cd7f9aa tu: Fix D16 depth clear rounding mismatch in sysmem mode
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Different HW units (R2D blit engine, 3D pipeline, etc.) apply subtly
different F32->UNORM16 rounding to the same float clear value, causing
cleared pixels to fail subsequent depth comparisons.

Pre-quantize D16 clear values to exact UNORM16 precision before passing
to any HW path. The GMEM path is unaffected as it already converts to
integer in pack_blit_event_clear_value().

Fixes dEQP-EGL.functional.image.modify.renderbuffer_depth16_renderbuffer_clear_depth
with zink and ANGLE when sysmem is used.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41196>
2026-04-28 13:56:36 +00:00
Danylo Piliaiev
5b5bc956df tu/perfetto: Move away from single timeline for all apps
This moves from deprecated stage_id/hw_queue_id to per-context
stage_iid/hw_queue_iid, which leads to separate timelines per app.
There are several benefits to this:
- Different driver versions could be used by different apps and perfetto
  won't confuse tracepoints.
- Tracepoints from different apps may not align perfectly, so previously
  we got a fair amount of weird vertical ordering of tracepoints.

The downside is that info is spread across several timelines multiplied
by queues, but I think that's better since it is easier to understand
which tracepoints correspond to which app.

The changes are mostly copied from radeon/intel perfetto integration.

This also fixes app_event emission along the way, previously
debug_marker_stage was called _before_ SEQ_INCREMENTAL_STATE_CLEARED.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41105>
2026-04-27 19:45:42 +00:00
Job Noorman
5bfbb7b1a7 ir3/ra: fix killed src detection while spilling
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
For a src to be killed, not only does its SSA value need to be killed,
it also shouldn't be part of or contain an interval that isn't killed
yet.

Fixes a RA assert in Windrose: "reg pressure calculation was wrong!".

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41154>
2026-04-25 14:11:10 +00:00
Rob Clark
d2c4653ee9 freedreno/registers: Add gen8 perfcntrs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
BV_RB and BV_CCU are supported on some devices (knp, but not glymur or
pakala, for ex).. we don't have a way to deal with that yet.

This doesn't yet _expose_ gen8 perfcntrs.  That small patch will come
after PERFCNTR_CONFIG ioctl is supported to ensure that everything gen8
and later supports the new kernel based counter collection/reservation
(so that backwards compat of old userspace on new kernel is limited to
a7xx and earlier).

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:33 +00:00
Rob Clark
ff41a00fab freedreno/registers: Correct register name
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:32 +00:00
Rob Clark
1fd18a9734 freedreno/registers: Add gen8 perfcntr support
A few gen8 perfcntr groups have additional slice related SEL regs to
program.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:32 +00:00
Rob Clark
2093153ba4 freedreno/registers: Add pipe to perfcntr group
With concurrent binning, some counter reads or SEL reg programming needs
to happen explicitly on the BR or BV ring.  For the most part if there
is a "BV_FOO" counter group that should be on the BV ring and the
corresponding "FOO" group on the BR ring.  There are a few exceptions
like "CP" vs "BV_CP" which have different SEL reg offsets for BR vs BV,
rather than the same offsets that should be accessed via the appropriate
aperture.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:32 +00:00
Rob Clark
90d3c48326 freedreno/registers: Sync back xml changes from kernel
Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:32 +00:00
Rob Clark
fc3cf60188 freedreno/registers: Small reg32 vs reg64 fixes
1) only use "ull" for reg64, which avoids some compiler warnings on the
   kernel side.
2) use "ull" for booleans as well, if reg64

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:32 +00:00
Rob Clark
2f503fe3f0 freedreno/perfcntrs: Switch to generated perfcntr tables
Basically emptys out the existing files, other than fd7_perfcntr.c which
also has derived counters.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:31 +00:00
Rob Clark
546d4daa6d freedreno/registers: Generate perfcntr tables
Use the register xml in combination with the json describing the
different perfcntr groups to generate perfcntr tables.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:31 +00:00
Rob Clark
2b81514c3e freedreno/registers: Add json to describe perfctr groups
To generate the perfctr tables we need a bit more information than what
is in the .xml, such as which groups of SELECT regs correspond to which
sets of COUNTER regs, the enum type of the countables (ie. possible
SELECT reg values), etc.

It would be awkward to shoehorn this into an xml schema that is based on
describing registers.  But json is easy to consume.

Field description:
 - chip:   variant enum used for generating correct reg offsets
 - groups: array of entries for each group of counters/countables:
   - name:     group name
   - num:      the number of counters
   - reserved: array of counter indices reserved for KMD use
   - select_offset: Offset of the first selector reg, used in cases
               where same bank of selectors is used for both BR and
               BV
   - select:   the selector reg name
   - counter:  counter name if <reg64>, otherwise use counter_lo and
               counter_hi
   - countable_type: name of <enum> that defines selector reg values

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:30 +00:00
Rob Clark
46791d4c52 freedreno/perfcntr: Remove type and result_type
We could generate the rest of the tables, other than these fields.  But
they are all "UINT64, AVERAGE" (for the non-derived counters), so just
drop them.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:30 +00:00
Rob Clark
7ceb8dcef4 tu: Remove use of fd_perfcntr_type
At some point everything became "UINT64, AVERAGE".  So no need to get
this from the table.

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40522>
2026-04-24 21:28:30 +00:00
Karmjit Mahil
4d4eb027d5 freedreno: Don't set UCHE_CLIENT_PF
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The kernel sets this up, and it's also read by the kernel for GPU
fault, so don't write this in Mesa.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41131>
2026-04-24 08:58:27 +00:00
Valentine Burley
c22e4022a8 tu: Implement deferred image creation for ANB and AHB
Based on 075d78115e ("panvk: implement deferred image creation"),
8aa2f1a94f ("panvk: add panvk_android_get_wsi_memory for AHB spec v8+"),
and 66bbd9eec8 ("panvk: implement AHB image deferred init and memory alloc").

Defer image initialization for both ANB alias images (gralloc v8+)
and AHB-backed images using vk_android_init_deferred_image() to
deep-copy the VkImageCreateInfo at vkCreateImage time.

For ANB alias images, tu_image_init() and tu_image_update_layout()
run at vkBindImageMemory2 time via tu_android_get_wsi_memory() when
the native buffer arrives.

For AHB images, tu_image_init() and tu_image_update_layout() run at
vkAllocateMemory time when the AHardwareBuffer handle is available
via dedicated allocation.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40635>
2026-04-23 21:21:31 +00:00
Danylo Piliaiev
037873b8e1 tu: Fix draw call offset for LRZ warnings in secondaries
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: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41103>
2026-04-23 14:23:25 +00:00
Valentine Burley
97baa27dad freedreno/drm/virtio: Fix wait_fence ret ordering
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
ret was read after the timeout check, so breaking on timeout returned 0
instead of the actual fence status, potentially reporting a signaled
fence when it was still pending.

Fixes: 441f01e778 ("freedreno/drm/virtio: Drop blocking in host")

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41108>
2026-04-23 06:52:14 +00:00
Valentine Burley
dad72b414b tu/drm/virtio: Fix tu_wait_fence timeout handling
Fixes two bugs in the WAIT_FENCE polling loop:
1. Break on timeout returned VK_SUCCESS because ret was read too late.
2. UINT64_MAX timeout_ns overflowed end_time, causing immediate exit.

Fix by reading rsp->ret before the timeout check and using
OS_TIMEOUT_INFINITE (like virtio_pipe_wait in freedreno) to avoid
overflow.

This prevents premature BO teardown during host-side fault recovery.

Fixes: f17c5297d7 ("tu: Add virtgpu support")
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41108>
2026-04-23 06:52:14 +00:00
Valentine Burley
96d17d18be zink/ci: Move Turnip flakes to correct list
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
These belong in the zink directory, not freedreno. Also add 2-sample
variants and document the origin.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41111>
2026-04-22 19:56:11 +00:00
Emma Anholt
3a8ff22336 ci: Delete references to various broken traces.
These are all being removed from the repos, so no need to leave the old
notes around.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:31 +00:00
Emma Anholt
ae510dc35b ci/turnip: add an a660 VK restricted traces job.
This covers the DX8/DX9 single-frame apitrace collection from
traces-db-private, and the job will appear for anyone in the group with
access to restricted traces.  Like other restricted traces jobs, it's set
to allow-failure, so that regressions in the job from changes by
developers not in the group don't block merging by developers with access,
but hopefully the increased visibility lets us catch rendering bugs faster
or avoid merging them in the first place.

The actual runtime for all of our dx8/9 trace collection is about 2:30,
and the whole job is about 7:30.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:31 +00:00
Emma Anholt
e19a7451e5 ci/turnip: Drop two 660 vk jobs and tune down the vk coverage fraction.
We want another runner so we can do trace replay pre-merge.  And the vk
job was pushing our time targets, and oversubscribed by a board, so we
have to drop a bunch of coverage.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40959>
2026-04-22 17:39:31 +00:00
Martin Roukala (né Peres)
a2ac64918b turnip/ci: document recent flakes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41100>
2026-04-22 17:19:22 +00:00
Samuel Pitoiset
9d17a7bdb4 spirv,treewide: rework specialization constant
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With SPV_KHR_constant_data, it's allowed to specialize array of
constants.

RustiCL changes are from Karol Herbst <kherbst@redhat.com>.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41046>
2026-04-22 06:57:55 +00:00
Samuel Pitoiset
ebf2797da2 vulkan,treewide: stop passing vk_device to vk_pipeline_robustness_state_fill()
This will be helpful for RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41029>
2026-04-21 17:29:04 +00:00
Zan Dobersek
9931034dca tu/a8xx: remove enforced TU_DEBUG_FLUSHALL
Remove the TU_DEBUG_FLUSHALL option that was force-enabled for a8xx chips.
The problematic CTS cases that required it were failing due to indirect
draw commands sourcing draw data from buffers whose content was prepared
by compute tasks.

Up until a8xx, firmware was managing an implicit wait before any indirect
draw parameters were read, with a delayed CP_WAIT_FOR_ME emitted only when
necessary or on devices enabling indirect_draw_wfm_quirk due to bugged
firmware. That implicit wait is gone on a8xx, so CP_WAIT_FOR_ME should be
emitted immediately, which also matches behavior of the proprietary driver.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40550>
2026-04-20 16:44:56 +00:00
Karmjit Mahil
c36e3ce934 freedreno/decode: Fix error() in script.c
Previously the error() would just print `f' instead of indicating
the function where the error occurred.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40995>
2026-04-17 09:16:34 +00:00
Karmjit Mahil
ce6ed3da8b freedreno/decode,ir3: Mark decoded dwords as const
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40995>
2026-04-17 09:16:34 +00:00
Dhruv Mark Collins
78e2bbc70f tu/query_pool: Avoid CP counter conflict with autotune
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With autotune allocating counters low-to-high, the conflict with
PERFORMANCE_QUERY_KHR will happen if any CP-based counters are
used. This is a temporary workaround which just drops the first
two CP counters from being usable for performance queries.

Cc: mesa-stable
Signed-off-by: Dhruv Mark Collins <mark@igalia.com>
Assisted-by: OpenAI Codex (GPT-5.4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Dhruv Mark Collins
f78541b765 tu/autotune: Allocate performance counters from low-to-high
This is more consistent with the newly established pattern of the
UMD allocating all locally used performance counters low-to-high
instead of the prior high-to-low order.

Cc: mesa-stable
Signed-off-by: Dhruv Mark Collins <mark@igalia.com>
Assisted-by: OpenAI Codex (GPT-5.4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Dhruv Mark Collins
24849eef9f fd/pps: Allocate performance counters from high-to-low
The UMD will be switching to allocating counters from low-to-high,
so to avoid the chances of conflict with this new policy the PPS
driver now allocates the other way around. Additionally, this will
future proof it for the MSM-DRM uAPI for performance counters which
will similarly allocate from high-to-low.

Cc: mesa-stable
Signed-off-by: Dhruv Mark Collins <mark@igalia.com>
Assisted-by: OpenAI Codex (GPT-5.4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Dhruv Mark Collins
a5ec9b7892 tu/autotune: Fail gracefully when CP counters are unavailable
When preemption optimization is supported then the necessary CP
counters being missing causes a device initialization error which
is unnecessary as support can simply be disabled instead to allow
for a more graceful fail. This also fixes A8XX which doesn't have
performance counters hooked up yet.

Cc: mesa-stable
Signed-off-by: Dhruv Mark Collins <mark@igalia.com>
Assisted-by: OpenAI Codex (GPT-5.4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Zan Dobersek
c2708afbc7 tu: only support userspace-managed perfcounters on a7xx and earlier
Future kernel API for perfcounter management will likely be required for
a8xx and onwards. For a7xx and earlier, cmdstream-based selector and
counter register management is still supported.

Cc: mesa-stable
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Connor Abbott
49d29d4f10 ir3: Use correct immediate size for constlen calculation
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
"size" is the allocated size of the array, not the number of immediates
actually used. We could wind up returning a too-large constlen, larger
than 512, and since the binning variant uses the non-binning variant's
constlen as it's max_const we could make binning variants use c512.x and
crash when encoding.

Fixes: 86f3c0c4c2 ("ir3: simplify constlen calculation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40961>
2026-04-16 05:40:14 +00:00
Connor Abbott
280c64d720 ir3: Don't reset immediate count to 0 after lowering
We need to know the immediate count even after lowering, to compute the
overall const size. Previously we were using the capacity field, but
that's unreliable and won't be available once we switch to a real
dynamic array container instead of (poorly) reinventing one.

Fixes: 86f3c0c4c2 ("ir3: simplify constlen calculation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40961>
2026-04-16 05:40:14 +00:00
Zan Dobersek
4d4a951ac6 fd: add a8xx perfcntr countables
Add the a8xx perfcntr countables lists for each supported perfcntr group,
as collected from the proprietary profiling tools.

Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40971>
2026-04-15 14:09:24 +00:00