From 5de20ebf39e5875d04cbdb890f5651975b8082c5 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Tue, 24 Nov 2026 14:25:16 -0500 Subject: [PATCH] drm/asahi: m3: define extended recovery layout constants locally PR #2676 moved the G16 recovery offsets per-ABI into FirmwareData and removed the fixed SNAPSHOT, SNAPSHOT_ENTRIES, GENERATION and PHASE constants from g16/recovery/logic.rs. m3_recovery.rs imports that shared logic module via #[path] and used those four 26.6.2 extended baseline constants to compute its shifted RecoveryOffsets, breaking the M3 Rust build and m3-recovery-tests.py with E0425. Define the four 26.6.2 extended baseline constants directly in m3_recovery.rs so M3 no longer depends on G16 layout constants. Fixes: 0c4e19dfdde7 ("Merge pull request #2676 from aurora-silicon/djdev/g16-272") Signed-off-by: Diljit Singh --- drivers/gpu/drm/asahi/m3/m3_recovery.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/asahi/m3/m3_recovery.rs b/drivers/gpu/drm/asahi/m3/m3_recovery.rs index 64eb09a6453eb..1bb6eb84beeda 100644 --- a/drivers/gpu/drm/asahi/m3/m3_recovery.rs +++ b/drivers/gpu/drm/asahi/m3/m3_recovery.rs @@ -37,15 +37,21 @@ pub(crate) struct RecoveryOffsets { pub(crate) control_bytes: usize, } +/// 26.6.2 extended FirmwareData recovery offsets and affected-work snapshot geometry. +const EXTENDED_SNAPSHOT: usize = 0x40b8; +const EXTENDED_SNAPSHOT_ENTRIES: usize = 448; +const EXTENDED_GENERATION: usize = 0x4fa0; +const EXTENDED_PHASE: usize = 0x4fb0; + impl RecoveryOffsets { /// Extended control region offsets shifted by the profile's `m3_init_26` /// control-table delta (`0` on 26.6.2 / `0xeaf0`, `0x1e0` on 27.2 / `0xedd0`). pub(crate) const fn extended(shift: usize, control_bytes: usize) -> Self { Self { - snapshot: logic::SNAPSHOT + shift, - snapshot_entries: logic::SNAPSHOT_ENTRIES, - generation: logic::GENERATION + shift, - phase: logic::PHASE + shift, + snapshot: EXTENDED_SNAPSHOT + shift, + snapshot_entries: EXTENDED_SNAPSHOT_ENTRIES, + generation: EXTENDED_GENERATION + shift, + phase: EXTENDED_PHASE + shift, control_bytes, } }