Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions drivers/gpu/drm/asahi/g17/fw/m5/render_registers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/asahi/g17/queue/render/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
Loading