From 1d2067aa8a95f8b09a26d795ced0b15b75d01c52 Mon Sep 17 00:00:00 2001 From: Jonathan Goyvaerts Date: Sun, 25 Oct 2026 22:09:08 -0300 Subject: [PATCH] drm/asahi: g17: add g17_tvb_min_blocks to pre-size the tiler heap On 25G83 an ordinary scene that overflows its tiler parameter buffer makes the firmware ask the host to grow it one small run (10 blocks) at a time, each a synchronous halt/request/reply round trip. A heavy scene needs dozens, and the firmware's forward-progress watchdog fails the render (recovery reason 0) before they finish; partial renders, the firmware's other overflow path, do not complete on this firmware either. So on 25G83 a scene that outgrows its initial heap hangs. Floor the initial TVB block count to 256 on 25G83 so ordinary heavy scenes fit without growing. Other G17 parts grow their TVB reliably, so they keep their computed tile-count size. A new module parameter, g17_tvb_min_blocks (default 0, clamped to TVB_MAX_BLOCKS), raises the floor on any G17 part for debugging or tuning. dEQP memory.pipeline_barrier.graphics.all_device.1048576_vertex_buffer_stride_2 passes 3/3 on 25G83 with the 256 floor and recovers 3/3 (reason 0) without it; also unblocks CS2 map loads under FEX/muvm, which hit the same growth hang. Signed-off-by: Jonathan Goyvaerts Assisted-by: LLM --- drivers/gpu/drm/asahi/asahi_core.rs | 4 ++++ drivers/gpu/drm/asahi/g17/buffer/target.rs | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/gpu/drm/asahi/asahi_core.rs b/drivers/gpu/drm/asahi/asahi_core.rs index 9e2e8f7b7a219..27edb7d0fc0d4 100644 --- a/drivers/gpu/drm/asahi/asahi_core.rs +++ b/drivers/gpu/drm/asahi/asahi_core.rs @@ -130,6 +130,10 @@ module! { default: 1, description: "Count held GPU memory in its creator's RSS for the OOM killer (1 = on)", }, + g17_tvb_min_blocks: usize { + default: 0, + description: "G17: floor on a render target's initial TVB blocks (0: use the computed tile-count size). 25G83 is always floored to at least 256, because its firmware's mid-render TVB growth trips a forward-progress watchdog (reason 0); this parameter overrides the floor on any G17 part", + }, g16_deadline_ms: u32 { default: 5000, description: "G16: administrative completion-stamp deadline, ms (0 disables; long running work can exceed it)", diff --git a/drivers/gpu/drm/asahi/g17/buffer/target.rs b/drivers/gpu/drm/asahi/g17/buffer/target.rs index 64c88da8eca14..9c8e642ef5801 100644 --- a/drivers/gpu/drm/asahi/g17/buffer/target.rs +++ b/drivers/gpu/drm/asahi/g17/buffer/target.rs @@ -105,6 +105,13 @@ impl Layout { ); } tvb_blocks = tvb_blocks.max(cfg::TVB_INITIAL_PAGES.len()); + // 25G83 firmware hangs if asked to grow the TVB mid-render (reason-0 watchdog), so + // pre-size it past ordinary overflow. Other G17 parts grow reliably and keep their + // computed size; the module parameter overrides the floor on any part. + let min_blocks = crate::module_parameters::g17_tvb_min_blocks + .value() + .max(if programs == RegisterPrograms::V25G83 { 256 } else { 0 }); + tvb_blocks = tvb_blocks.max(min_blocks.min(cfg::TVB_MAX_BLOCKS)); let mut gtp = [None; 8]; let mut tpc_end = tpc_size; if programs == RegisterPrograms::V25G83 {