Skip to content

Commit 89651c2

Browse files
committed
drm/asahi: render: Fix meta1_blocks calculation for MSAA
Block count needs to be computed with an extra factor of the sample count. Signed-off-by: Asahi Lina <[email protected]>
1 parent 185978b commit 89651c2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/gpu/drm/asahi/hw/t600x.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub(crate) const HWCONFIG_T6002: super::HwConfig = HwConfig {
6262
preempt3_size: 0x20,
6363
clustering: Some(HwClusteringConfig {
6464
meta1_blocksize: 0x44,
65-
meta2_size: 0x190 * 8, // CHECK
65+
meta2_size: 0xc0 * 8,
6666
meta3_size: 0x280 * 8,
6767
meta4_size: 0x30 * 16,
6868
max_splits: 16,

drivers/gpu/drm/asahi/queue/render.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,11 @@ impl super::Queue::ver {
134134
let tpc_size = (num_clusters * (4 * tpc_mtile_stride * mtiles) * layers) as usize;
135135

136136
// No idea where this comes from, but it fits what macOS does...
137-
// TODO: layers?
137+
// GUESS: Number of 32K heap blocks to fit a 5-byte region header/pointer per tile?
138+
// That would make a ton of sense...
139+
// TODO: Layers? Why the sample count factor here?
138140
let meta1_blocks = if num_clusters > 1 {
139-
div_ceil(align(tiles_x, 2) * align(tiles_y, 4), 0x1980)
141+
div_ceil(align(tiles_x, 2) * align(tiles_y, 4) * cmdbuf.samples, 0x1980)
140142
} else {
141143
0
142144
};

0 commit comments

Comments
 (0)