Repository navigation
drm/asahi: g14_v27_2: admit and encode DRM_ASAHI_RENDER_VERTEX_SCRATCH - #3455
Conversation
Commit 7521672 ("drm/asahi: admit sampler heaps and helper programs on G14 firmware 27.2") admitted vertex and fragment helper programs on G13/G14 firmware 27.2 queues (samplers_and_helpers = true) and wired vertex_helper.{binary,cfg,data} into encode_vertex() and TilingParameters. However, Mesa/Borealis also sets DRM_ASAHI_RENDER_VERTEX_SCRATCH (bit 0) whenever a vertex/geometry/tessellation shader spills to scratch memory (hk_queue.c). validate_render() in m3_submit.rs still rejected bit 0 with ENOTSUPP, causing VK_ERROR_DEVICE_LOST on any render pass using vertex scratch (e.g. Vulkan CTS subgroups.ballot_broadcast, max vertex attributes, and geometry descriptor-buffer tests). Admit DRM_ASAHI_RENDER_VERTEX_SCRATCH in validate_render() when samplers_and_helpers is set (leaving M3 queues unchanged), and write uses_scratch at offset 0x578 (+8 bytes past sync_grow at 0x570, matching the 13.5 RunVertex layout in the +0x10 band before meta at 0x580) in encode_vertex(). Fixes: 7521672 ("drm/asahi: admit sampler heaps and helper programs on G14 firmware 27.2") Signed-off-by: Thomas Glanzmann <[email protected]>
satchlj
left a comment
There was a problem hiding this comment.
Reviewed exact head 57d2e880e2d6 (drm/asahi: g14_v27_2: admit and encode DRM_ASAHI_RENDER_VERTEX_SCRATCH):
- Code audit: Clean, minimal 2-file fix.
m3_submit.rs:validate_render()gatesDRM_ASAHI_RENDER_VERTEX_SCRATCH(1 << 0) strictly onsamplers_and_helpers(G13/G14 fw 27.2 queues only; M3 queues keep rejecting it), andg14_v27_2_render.rs:encode_vertex()writesuses_scratchat0x578with a compile-timeoffset_of!(Rv, uses_scratch) - offset_of!(Rv, sync_grow) == 8assertion. scripts/checkpatch.pl --strict --no-signoff: 0 errors, 1 minor 109-column line-length warning onm3_submit.rs:493.- Scope note: Code-review + checkpatch only (no G13/G14 fw 27.2 hardware on this bench; J313 hardware verification is covered in the PR description).
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Tested |
|
Merging at |
What:
Admit
DRM_ASAHI_RENDER_VERTEX_SCRATCH(1 << 0) inm3_submit.rs:validate_render()whensamplers_and_helpersis set (G13/G14 firmware 27.2 queues; M3 queues remain unchanged), and writeuses_scratchat offset0x578(+8bytes pastsync_growat0x570, verified with a compile-timeoffset_of!assertion againstRunVertexG14V13_5) ing14_v27_2_render.rs:encode_vertex().Commit
7521672bcdc3admittedvertex_helperon G13/G14 firmware 27.2, butvalidate_render()still rejectedDRM_ASAHI_RENDER_VERTEX_SCRATCHwithENOTSUPP, causingVK_ERROR_DEVICE_LOSTon any Vulkan render pass whose vertex/tessellation/geometry shader spills to scratch memory.Tested:
Tested on MacBook Air M1 (J313 / T8103, G13G B1, macOS 27.2.1 firmware, Borealis Mesa
git-2743969512f) with the exactm3_submit.rsandg14_v27_2_render.rscode of57d2e880e2d6(both files are identical toorigin/mainplus this 5-line patch):M3 render rejected ENOTSUPP: flags=0x3->VK_ERROR_DEVICE_LOST.auroraerrors indmesg.dEQP-VK.subgroups.ballot_broadcast.framebuffer.*+dEQP-VK.pipeline.fast_linked_library.vertex_input.max_attributes.*): 534/534 PASS (201 Skip, 0 Fail, 0 Crash) in 6 s, zeroauroraerrors.Risk: two-way door · G13 (M1) and G14 (M2) firmware 27.2 render queues only (
samplers_and_helpers = true); M3 queues keepsamplers_and_helpers = falseand rejectDRM_ASAHI_RENDER_VERTEX_SCRATCHas before.Not yet:
g14_v27_2_render.rsandm3_submit.rs:new_g14_v27_2().