Skip to content

Commit 6b34d03

Browse files
Tim Huangalexdeucher
authored andcommitted
drm/amdgpu: fix incorrect number of active RBs for gfx12
The RB bitmap should be global active RB bitmap & active RB bitmap based on active SA. Signed-off-by: Tim Huang <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 4a60c55 commit 6b34d03

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,7 @@ static u32 gfx_v12_0_get_rb_active_bitmap(struct amdgpu_device *adev)
16231623

16241624
static void gfx_v12_0_setup_rb(struct amdgpu_device *adev)
16251625
{
1626+
u32 rb_bitmap_per_sa;
16261627
u32 rb_bitmap_width_per_sa;
16271628
u32 max_sa;
16281629
u32 active_sa_bitmap;
@@ -1640,12 +1641,14 @@ static void gfx_v12_0_setup_rb(struct amdgpu_device *adev)
16401641
adev->gfx.config.max_sh_per_se;
16411642
rb_bitmap_width_per_sa = adev->gfx.config.max_backends_per_se /
16421643
adev->gfx.config.max_sh_per_se;
1644+
rb_bitmap_per_sa = amdgpu_gfx_create_bitmask(rb_bitmap_width_per_sa);
1645+
16431646
for (i = 0; i < max_sa; i++) {
16441647
if (active_sa_bitmap & (1 << i))
1645-
active_rb_bitmap |= (0x3 << (i * rb_bitmap_width_per_sa));
1648+
active_rb_bitmap |= (rb_bitmap_per_sa << (i * rb_bitmap_width_per_sa));
16461649
}
16471650

1648-
active_rb_bitmap |= global_active_rb_bitmap;
1651+
active_rb_bitmap &= global_active_rb_bitmap;
16491652
adev->gfx.config.backend_enable_mask = active_rb_bitmap;
16501653
adev->gfx.config.num_rbs = hweight32(active_rb_bitmap);
16511654
}

0 commit comments

Comments
 (0)