Commit graph

221680 commits

Author SHA1 Message Date
Benjamin Cheng
922d04c9a5 ac/vcn: Rename VCN5 swizzle mode to GFX12
The original naming is inaccurate, it depends on the GFX version, not
VCN.

Signed-off-by: Suresh Guttula <suresh.guttula@amd.com>
Reviewed-by: David Rosca <david.rosca@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41202>
2026-04-27 17:13:18 +00:00
Matt Turner
acba4c9fd8 radv: expose VK_KHR_performance_query on GFX11
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Enable VK_KHR_performance_query on GFX11 (RDNA3 / RDNA3.5) now that the
selector tables and packet emission are in place.

Tested on Strix Halo with dEQP-VK.query_pool.performance_query.* (6 pass,
6 not-supported for the allowCommandBufferQueryCopies cases).

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41157>
2026-04-27 16:16:00 +00:00
Matt Turner
8499d86b94 radv/perfcounter: add GFX11 performance counter selectors
GFX11 reorganizes the shader perfcounter blocks: wave counts move from
SQ to the SQG registers (still mapped as the SQ block in ac/), while
per-instruction counters move from SQ to the new SQ_WGP block.

Add GFX11-specific selector enums using the new block assignments and
branch radv_query_perfcounter_descs to select them on GFX11+. GL2C,
GL1C, and TCP selectors are unchanged between GFX10.3 and GFX11.

The "Instructions" (total count) counter is dropped on GFX11 as there
is no direct SQ_WGP equivalent for INSTS_ALL.

Selector indices verified against gpu_performance_api's
gpa_hw_counter_gfx11.cc.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41157>
2026-04-27 16:15:59 +00:00
Matt Turner
703de21af8 radv/perfcounter: guard select1 access in radv_emit_select
Some perfcounter blocks (e.g. SQ_WGP on GFX11) define num_spm_modules
but have no select1 register array. Skip the select1 loop when the
array is NULL.

This is a prerequisite for enabling performance queries on GFX11.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41157>
2026-04-27 16:15:59 +00:00
Matt Turner
2595940b0d radv: fix UB in radv_format_pack_clear_color for snorm formats
Casting a negative float to uint64_t is undefined behavior. GCC 15 with
-O2 produces 0xFFFFFFFFFFFFFFFF for (uint64_t)(-32767.5f), causing snorm
clear values to be packed incorrectly (e.g. 0xFFFF instead of 0x8001 for
snorm16 -1.0). This results in wrong DCC comp-to-single clear colors and
~966 CTS snorm multisample_resolve test failures.

Fix by casting through int64_t first, which is well-defined (truncation
toward zero) and preserves the two's complement bit pattern.

Fixes: 585c25be1e ("radv: fix color conversions for normalized uint/sint formats")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41164>
2026-04-27 15:44:09 +00:00
Jaishankar Rajendran
12f43d048e anv: tune parameters of the ASTC software decoding
Signed-off-by: Prakhar Vishwakarma <prakhar.vishwakarma@intel.com>
Signed-off-by: Jaishankar Rajendran <jaishankar.rajendran@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41205>
2026-04-27 15:17:04 +00:00
Jaishankar Rajendran
cd941d3970 vulkan/runtime: enable parametrization of ASTC software decode
Enable the driver to select :
  - LUT allocation alignment
  - LUT memory flags selection

Signed-off-by: Prakhar Vishwakarma <prakhar.vishwakarma@intel.com>
Signed-off-by: Jaishankar Rajendran <jaishankar.rajendran@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41205>
2026-04-27 15:17:04 +00:00
Yiwei Zhang
0f2a42afcf lvp/android: use common ANB implementations
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This has been unblocked by
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40211.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41138>
2026-04-27 14:58:18 +00:00
David Rosca
7b5277ce5c frontends/va: Fix out of bounds write in AV1 decode tile info
For invalid streams tile cols and rows may be higher than 64.
This would overwrite data after the height_in_sbs array, but since
the maximum amount of bytes overwritten is bound by the maximum
supported decode resolution, this can't overwrite any important
fields and thus won't cause any observable issue.
As this can only happen with invalid streams, it still won't decode
correctly with this fixed.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15290
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41016>
2026-04-27 14:29:34 +00:00
David Rosca
c2a4fa33b8 frontends/va: Fix finding LTRs from POCs in HEVC decode
This should only consider valid entries, not loop over the entire array.
In addition the array size was wrong before.

Fixes: 779edc0759 ("frontends/va: Correctly derive HEVC StCurrBefore, StCurrAfter and LtCurr")
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41016>
2026-04-27 14:29:34 +00:00
David Rosca
630a4d2249 radeonsi: Always use 2D tiling for video dpb
Fixes decode on VCN5 with AMD_DEBUG=notiling

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41201>
2026-04-27 14:10:11 +00:00
Pavel Ondračka
cc7be8433a r300: dirty VS state when switching variants
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
When r300_pick_vertex_shader switches to a WPOS variant, it only dirtied
rs_block_state, leaving vs_state with a stale code size. This caused
cs_count warnings (offset of -4 for one extra VS instruction) but was
mostly harmless since the emitted packet stream still used the current
shader.

Factor the VS code dirtying out of r300_bind_vs_state into a helper and
call it when selecting a new variant too.

Fixes: 806dcf9db7 ("r300: only output wpos in vertex shaders when needed")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41200>
2026-04-27 12:48:34 +00:00
Jesse Natalie
3f35e65253 wgl: Use an hwnd xor hdc for framebuffers
It seems maybe hdcs can get recycled?

Fixes: 28058221 ("wgl: Support contexts created from non-window DCs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41174>
2026-04-27 12:26:54 +00:00
Pavel Ondračka
416da54cce r300: fix MSAA resolve COLORPITCH tiling after pipe_surface de-pointerization
r300_simple_msaa_resolve used to patch srcsurf->pitch with the resolve
destination's tiling bits before passing the surface to the blitter.
That worked when set_framebuffer_state kept the same pipe_surface
pointer, so r300_get_nonnull_cb returned the patched object.

After the de-pointerization, r300_framebuffer_init creates a fresh
r300_surface from the pipe_surface template, discarding the pitch
modification. The hardware then uses the MSAA source tiling for
R300_RB3D_COLORPITCH0, leading to corruption.

Move the tiling override into r300_emit_fb_state and override the tiling
bits of COLORPITCH from the destination surface at emit time.

Fixes: 2eb45daa9c ("gallium: de-pointerize pipe_surface")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15303
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41092>
2026-04-27 12:05:44 +00:00
Simon Perretta
af1669d9e2 pco: reserve additional outputs for trilinear sampled coeffs
Sampling coeffs with trilinear filtering will output 2x sets of data.
Whether bilinear or trilinear filtering is in use can't be determined
without checking state words, so unconditionally reserve 2x to avoid
clobbering output regs.

Fixes: 7df32ba09d ("pco: initial texture/sampler compiler support")
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Frank Binns <frank.binns@imgtec.com>
Tested-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41051>
2026-04-27 11:32:29 +00:00
squidbus
f13bec7934 kk: Add support for VK_EXT_depth_clip_control.
Uses dynamic lowering pass pulled from asahi.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41088>
2026-04-27 11:01:00 +00:00
squidbus
a41f0e62bb asahi,nir: Move asahi dynamic clipz pass to common.
Acked-by: Alyssa Rosenzweig <alyssa@rosenz.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41088>
2026-04-27 11:00:59 +00:00
Samuel Pitoiset
bd62c72223 radv: cleanup invalidating vertex draw state
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: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41159>
2026-04-27 10:32:10 +00:00
Samuel Pitoiset
8c425351e9 radv: stop dirtying some states after DGC execute
The Vulkan spec says:
    "After a call to vkCmdExecuteGeneratedCommandsEXT, command buffer
     state will become undefined according to the tokens executed. This
     table specifies the relationship between tokens used and state
     invalidation."

The application must re-bind the states that are updated using DGC.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41159>
2026-04-27 10:32:10 +00:00
Samuel Pitoiset
4996cd82f6 radv: only emit the "normal" index buffer when needed with DGC
Only if DGC emits an indexed draw without providing the index buffer
as part of the tokens. This avoids emitting useless packets.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41159>
2026-04-27 10:32:10 +00:00
Samuel Pitoiset
dc816ce4ac radv: remove an useless check when emitting the index buffer
index_type is uint32_t, so this checks is always FALSE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41159>
2026-04-27 10:32:09 +00:00
Erik Faye-Lund
4f2de63a27 pan/ci: add a flake from nightly
This failed here:
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/98061409

Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41121>
2026-04-27 09:27:02 +00:00
Trigger Huang
8d60001d69 radv: enable protected memory
Advertise protectedMemory feature for application when TMZ is available

Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:34 +00:00
Julia Zhang
1f9d1366f8 radv: save protected queue and non-protected queue seperately
Save protected radv_queue in device->queues_protected so it can be
relased in radv_destroy_device.

Without this, device->queues[] will point to a new queues to record
the queue created according to the queueCreateInfo. When queueCreateInfo
include both protected and unprotected queue info, the device->queues[]
will be created twice and record one queue at each time. So we will lose
either protected queue or unprotected queue which created first.

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:34 +00:00
Julia Zhang
0e36d7112c radv: set TMZ bit in sdma_copy packet
Pass secure and set TMZ bit in sdma_copy packet for protected image

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:34 +00:00
Julia Zhang
bfc54d444d radv: enable surface protected capability
Pass protected support flag to wsi_device to enable surface protected
capability when radv_physical_device::has_tmz_support.

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:34 +00:00
Julia Zhang
60bd766299 radv: create encrypted BOs for protected cmd_buffers
Create encrypted fence_bo and eop_bug_bo when the radv_cmd_buffer is
created from a protected pool which is marked with flag
VK_COMMAND_POOL_CREATE_PROTECTED_BIT

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:34 +00:00
Julia Zhang
501f72bc89 radv: allocate encrypted rings BOs
Pass secure flag to radv_update_preamble_cs() if this queue is created
with vk flag VK_QUEUE_PROTECTED_BIT and create encrypted tess/ge ring
BOs and compute_scratch_bo according to this secure flag.

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:34 +00:00
Trigger Huang
68db27f0b4 radv: add protected type bits for memory requirements
Add protected type bits for memory requirements of protected resources

Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:34 +00:00
Trigger Huang
540864685d radv: support secure submission
Set AMDGPU_IB_FLAGS_SECURE on IBs to support secure submission

Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:33 +00:00
Trigger Huang
535207a075 radv: allow creation of protected queues
Advertise VK_QUEUE_PROTECTED_BIT on gfx and transfer queues to allow
creation of protected queues.

Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:33 +00:00
Trigger Huang
af35a99435 radv: supports protected memory allocation
Add memory type for protected memory to support TMZ encrypted memory
allocation

Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:33 +00:00
Julia Zhang
6496f9d123 radv: add new option RADV_DEBUG=notmz
Used for enable/disable TMZ support of radv.

Signed-off-by: Julia Zhang <Julia.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40619>
2026-04-27 09:03:32 +00:00
Faith Ekstrand
9c8e8ed655 panvk/csf: Emit INDEX_BUFFER[_SIZE] even for non-indexed draws
The index buffer and index buffer size don't affect whether or not we're
actually doing indexed rendering so we should just emit them whenever
they change.  Otherwise, if someone sets an index buffer and then does a
non-indexed draw and then an indexed draw, the first draw will clear the
dirty bits without setting the index buffer registers and the second
draw won't know to re-emit them.

Fixes: 5544d39f44 ("panvk: Add a CSF backend for panvk_queue/cmd_buffer")
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Marc Alcala Prieto <marc.alcalaprieto@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40997>
2026-04-27 08:40:43 +00:00
Christian Gmeiner
3d7d2115f8 panvk: Implement vkCmdFillBuffer with panlib kernels
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Replace the vk_meta_fill_buffer call with direct panlib precomp
dispatches: a KERNEL(32) uint4 bulk path for 16-byte-aligned fills and a
KERNEL(32) uint32 path otherwise, each with a KERNEL(1) scalar tail for
sub-workgroup remainders.

gpu-ratemeter vk.bufbw on Mali-G610 MC4 shows a 1.15-1.18x median
speedup across alignment classes and roughly 5x on fills <= 512 B,
thanks to the removed pipeline bind / descriptor-set setup that
vk_meta_fill_buffer pays per call.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41079>
2026-04-27 08:19:20 +00:00
Samuel Pitoiset
ac52fb569a radv: fix a potential NULL pointer dereference when emitting VBOs
vkCmdBindVertexBuffers() -> draw with mesh shaders will just segfault.
This sequence doesn't make real sense but it's possible.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41161>
2026-04-27 07:40:14 +00:00
Samuel Pitoiset
782254b820 radv: re-introduce DGC+multiview support and enable it for vkd3d-proton only
The Vulkan spec says:
    "VUID-vkCmdExecuteGeneratedCommandsEXT-None-11062
     If a rendering pass is currently active, the view mask must be 0."

So, it's invalid with VK_EXT_device_generated_commands but it's allowed
in DX12, it seems we missed this during the spec review.

Crimson Desert uses this and emulating in vkd3d-proton would be complex,
so let's re-introduce this support only for vkd3d-proton.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41153>
2026-04-27 07:08:23 +00:00
Samuel Pitoiset
2d78546d59 radv: store the number of PS params heuristic to radv_compiler_info
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This improves compatibility between eg. NAVI33 and PHOENIX because
NGG culling is disabled by default on GFX11+.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41137>
2026-04-27 06:26:25 +00:00
Samuel Pitoiset
48db5c0378 radv: pass radv_compiler_info to radv_pipeline_get_shader_key()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41137>
2026-04-27 06:26:25 +00:00
Peyton Lee
9225ba47d5 amd/vpelib: Support vpe 2.0
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Support vpe 2.0
Update vpelib to support vpe 2.0 includes new color formats,
blending, and 3dlut fast loading.

Signed-off-by: Peyton Lee <peytolee@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41073>
2026-04-27 03:06:42 +00:00
Peyton Lee
85a5d6233b amd/vpelib: add alpha fill support check
Add helper functions check_alpha_fill_support()
Also fix incorrect color format naming.

Signed-off-by: Peyton Lee <peytolee@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41073>
2026-04-27 03:06:42 +00:00
squidbus
642bed9eba kk: Fix VK_CULL_MODE_FRONT_AND_BACK with points and lines.
Some checks failed
macOS-CI / macOS-CI (dri) (push) Has been cancelled
macOS-CI / macOS-CI (xlib) (push) Has been cancelled
Only triangles are culled, so we can't always disable rasterization here.

Fixes:
dEQP-VK.glsl.builtin_var.frontfacing.add_ubo_load.point_list.front_and_back
dEQP-VK.glsl.builtin_var.frontfacing.add_ubo_load.line_list.front_and_back

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41176>
2026-04-25 17:33:52 +00:00
squidbus
cc23376ff5 kk: Add type inference for additional built-in intrinsics.
Fixes dEQP-VK.api.copy_and_blit.core.use_after_copy.*_msaa

These tests set both a varying and gl_Layer to gl_InstanceID. Without proper
type inference for gl_InstanceID, it would end up stored in a float temporary,
then bit-cast back to uint when stored into the gl_Layer, resulting in an
invalid destination when outputting to layer 1.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41177>
2026-04-25 17:13:20 +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
Marek Olšák
bfb6c41b64 amd: remove unnecessary and transitive #includes
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reported by clang tools.
See: https://clangd.llvm.org/guides/include-cleaner

struct ac_cmdbuf had to be moved to ac_cmdbuf_base.h because we can't
include ac_cmdbuf.h->sid.h->amdgfxregs.h in radeon_winsys.h for r300.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41091>
2026-04-24 21:53:07 +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