Skip to content

Commit cfa61b8

Browse files
Hawking Zhangalexdeucher
authored andcommitted
drm/amdgpu: switch to select_se_sh wrapper for gfx v9_0
To allow invoking ip specific callbacks Acked-by: Felix Kuehling <[email protected]> Signed-off-by: Hawking Zhang <[email protected]> Reviewed-by: Le Ma <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e4d0ef7 commit cfa61b8

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ void kgd_gfx_v9_get_cu_occupancy(struct amdgpu_device *adev, int pasid,
787787
for (se_idx = 0; se_idx < se_cnt; se_idx++) {
788788
for (sh_idx = 0; sh_idx < sh_cnt; sh_idx++) {
789789

790-
gfx_v9_0_select_se_sh(adev, se_idx, sh_idx, 0xffffffff);
790+
amdgpu_gfx_select_se_sh(adev, se_idx, sh_idx, 0xffffffff);
791791
queue_map = RREG32_SOC15(GC, 0, mmSPI_CSQ_WF_ACTIVE_STATUS);
792792

793793
/*
@@ -820,7 +820,7 @@ void kgd_gfx_v9_get_cu_occupancy(struct amdgpu_device *adev, int pasid,
820820
}
821821
}
822822

823-
gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
823+
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
824824
soc15_grbm_select(adev, 0, 0, 0, 0);
825825
unlock_spi_csq_mutexes(adev);
826826

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ static void gfx_v9_0_init_always_on_cu_mask(struct amdgpu_device *adev)
15641564
mask = 1;
15651565
cu_bitmap = 0;
15661566
counter = 0;
1567-
gfx_v9_0_select_se_sh(adev, i, j, 0xffffffff);
1567+
amdgpu_gfx_select_se_sh(adev, i, j, 0xffffffff);
15681568

15691569
for (k = 0; k < adev->gfx.config.max_cu_per_sh; k ++) {
15701570
if (cu_info->bitmap[i][j] & mask) {
@@ -1583,7 +1583,7 @@ static void gfx_v9_0_init_always_on_cu_mask(struct amdgpu_device *adev)
15831583
cu_info->ao_cu_bitmap[i][j] = cu_bitmap;
15841584
}
15851585
}
1586-
gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
1586+
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
15871587
mutex_unlock(&adev->grbm_idx_mutex);
15881588
}
15891589

@@ -1605,7 +1605,7 @@ static void gfx_v9_0_init_lbpw(struct amdgpu_device *adev)
16051605

16061606
mutex_lock(&adev->grbm_idx_mutex);
16071607
/* set mmRLC_LB_INIT_CU_MASK thru broadcast mode to enable all SE/SH*/
1608-
gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
1608+
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
16091609
WREG32_SOC15(GC, 0, mmRLC_LB_INIT_CU_MASK, 0xffffffff);
16101610

16111611
/* set mmRLC_LB_PARAMS = 0x003F_1006 */
@@ -1654,7 +1654,7 @@ static void gfx_v9_4_init_lbpw(struct amdgpu_device *adev)
16541654

16551655
mutex_lock(&adev->grbm_idx_mutex);
16561656
/* set mmRLC_LB_INIT_CU_MASK thru broadcast mode to enable all SE/SH*/
1657-
gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
1657+
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
16581658
WREG32_SOC15(GC, 0, mmRLC_LB_INIT_CU_MASK, 0xffffffff);
16591659

16601660
/* set mmRLC_LB_PARAMS = 0x003F_1006 */
@@ -2322,13 +2322,13 @@ static void gfx_v9_0_setup_rb(struct amdgpu_device *adev)
23222322
mutex_lock(&adev->grbm_idx_mutex);
23232323
for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
23242324
for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
2325-
gfx_v9_0_select_se_sh(adev, i, j, 0xffffffff);
2325+
amdgpu_gfx_select_se_sh(adev, i, j, 0xffffffff);
23262326
data = gfx_v9_0_get_rb_active_bitmap(adev);
23272327
active_rbs |= data << ((i * adev->gfx.config.max_sh_per_se + j) *
23282328
rb_bitmap_width_per_sh);
23292329
}
23302330
}
2331-
gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
2331+
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
23322332
mutex_unlock(&adev->grbm_idx_mutex);
23332333

23342334
adev->gfx.config.backend_enable_mask = active_rbs;
@@ -2465,14 +2465,14 @@ static void gfx_v9_0_wait_for_rlc_serdes(struct amdgpu_device *adev)
24652465
mutex_lock(&adev->grbm_idx_mutex);
24662466
for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
24672467
for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
2468-
gfx_v9_0_select_se_sh(adev, i, j, 0xffffffff);
2468+
amdgpu_gfx_select_se_sh(adev, i, j, 0xffffffff);
24692469
for (k = 0; k < adev->usec_timeout; k++) {
24702470
if (RREG32_SOC15(GC, 0, mmRLC_SERDES_CU_MASTER_BUSY) == 0)
24712471
break;
24722472
udelay(1);
24732473
}
24742474
if (k == adev->usec_timeout) {
2475-
gfx_v9_0_select_se_sh(adev, 0xffffffff,
2475+
amdgpu_gfx_select_se_sh(adev, 0xffffffff,
24762476
0xffffffff, 0xffffffff);
24772477
mutex_unlock(&adev->grbm_idx_mutex);
24782478
DRM_INFO("Timeout wait for RLC serdes %u,%u\n",
@@ -2481,7 +2481,7 @@ static void gfx_v9_0_wait_for_rlc_serdes(struct amdgpu_device *adev)
24812481
}
24822482
}
24832483
}
2484-
gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
2484+
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
24852485
mutex_unlock(&adev->grbm_idx_mutex);
24862486

24872487
mask = RLC_SERDES_NONCU_MASTER_BUSY__SE_MASTER_BUSY_MASK |
@@ -6482,7 +6482,7 @@ static void gfx_v9_0_reset_ras_error_count(struct amdgpu_device *adev)
64826482
for (i = 0; i < ARRAY_SIZE(gfx_v9_0_edc_counter_regs); i++) {
64836483
for (j = 0; j < gfx_v9_0_edc_counter_regs[i].se_num; j++) {
64846484
for (k = 0; k < gfx_v9_0_edc_counter_regs[i].instance; k++) {
6485-
gfx_v9_0_select_se_sh(adev, j, 0x0, k);
6485+
amdgpu_gfx_select_se_sh(adev, j, 0x0, k);
64866486
RREG32(SOC15_REG_ENTRY_OFFSET(gfx_v9_0_edc_counter_regs[i]));
64876487
}
64886488
}
@@ -6544,7 +6544,7 @@ static void gfx_v9_0_query_ras_error_count(struct amdgpu_device *adev,
65446544
for (i = 0; i < ARRAY_SIZE(gfx_v9_0_edc_counter_regs); i++) {
65456545
for (j = 0; j < gfx_v9_0_edc_counter_regs[i].se_num; j++) {
65466546
for (k = 0; k < gfx_v9_0_edc_counter_regs[i].instance; k++) {
6547-
gfx_v9_0_select_se_sh(adev, j, 0, k);
6547+
amdgpu_gfx_select_se_sh(adev, j, 0, k);
65486548
reg_value =
65496549
RREG32(SOC15_REG_ENTRY_OFFSET(gfx_v9_0_edc_counter_regs[i]));
65506550
if (reg_value)
@@ -6559,7 +6559,7 @@ static void gfx_v9_0_query_ras_error_count(struct amdgpu_device *adev,
65596559
err_data->ce_count += sec_count;
65606560
err_data->ue_count += ded_count;
65616561

6562-
gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
6562+
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
65636563
mutex_unlock(&adev->grbm_idx_mutex);
65646564

65656565
gfx_v9_0_query_utc_edc_status(adev, err_data);
@@ -6963,7 +6963,7 @@ static int gfx_v9_0_get_cu_info(struct amdgpu_device *adev,
69636963
mask = 1;
69646964
ao_bitmap = 0;
69656965
counter = 0;
6966-
gfx_v9_0_select_se_sh(adev, i, j, 0xffffffff);
6966+
amdgpu_gfx_select_se_sh(adev, i, j, 0xffffffff);
69676967
gfx_v9_0_set_user_cu_inactive_bitmap(
69686968
adev, disable_masks[i * adev->gfx.config.max_sh_per_se + j]);
69696969
bitmap = gfx_v9_0_get_cu_active_bitmap(adev);
@@ -6996,7 +6996,7 @@ static int gfx_v9_0_get_cu_info(struct amdgpu_device *adev,
69966996
cu_info->ao_cu_bitmap[i % 4][j + i / 4] = ao_bitmap;
69976997
}
69986998
}
6999-
gfx_v9_0_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
6999+
amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff);
70007000
mutex_unlock(&adev->grbm_idx_mutex);
70017001

70027002
cu_info->number = active_cu_number;

0 commit comments

Comments
 (0)