diff --git a/drivers/gpu/drm/asahi/g17/fw/m5/render_registers.rs b/drivers/gpu/drm/asahi/g17/fw/m5/render_registers.rs index 15e1887cee272..03cbc862b3b19 100644 --- a/drivers/gpu/drm/asahi/g17/fw/m5/render_registers.rs +++ b/drivers/gpu/drm/asahi/g17/fw/m5/render_registers.rs @@ -25,15 +25,19 @@ impl ContextStore { Self { auxiliary, stream, extent: stream + 0x680 * clusters + 0x800 } } - /// `board`'s store: laid out for the G17D's own cluster count with its forms; other boards - /// keep the two-cluster store. + /// The four-cluster Max and G17D use their physical cluster count for the + /// control words and state stream. Other boards keep the two-cluster store. pub(crate) const fn selected(board: &super::initdata::Board) -> Self { - Self::of(if board.g17d_forms() { board.clusters as usize } else { 2 }) + Self::of(if board.g17d_forms() || board.clusters == 4 { + board.clusters as usize + } else { 2 }) } } const _: () = { let two = ContextStore::of(2); assert!(two.auxiliary == 0xc0 && two.stream == 0x980 && two.extent == 0x1e80); + let max = ContextStore::selected(&super::initdata::J716C); + assert!(max.auxiliary == 0x140 && max.stream == 0xfc0 && max.extent == 0x31c0); let eight = ContextStore::of(8); assert!(eight.auxiliary == 0x240 && eight.stream == 0x1c40 && eight.extent == 0x5840); }; diff --git a/drivers/gpu/drm/asahi/g17/queue/render/generation.rs b/drivers/gpu/drm/asahi/g17/queue/render/generation.rs index d03857cc10a56..dcfd7fd7daa95 100644 --- a/drivers/gpu/drm/asahi/g17/queue/render/generation.rs +++ b/drivers/gpu/drm/asahi/g17/queue/render/generation.rs @@ -76,6 +76,9 @@ const _: () = { let two = Layout::m5_for(ContextStore::of(2), true); assert!(two.bytes == 0x10000 && two.status == 0x4000 && two.auxiliary == 0x8000); assert!(matches!(two.viewport, Some(0x9c0))); + let max = Layout::m5(&crate::g17::fw::m5::initdata::J716C); + assert!(max.bytes == 0x10000 && max.status == 0x4000 && max.auxiliary == 0x8000); + assert!(matches!(max.viewport, Some(0x1000))); let eight = Layout::m5_for(ContextStore::of(8), false); assert!(eight.bytes == 0x14000 && eight.status == 0x8000 && eight.auxiliary == 0xc000); };