Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: move select_se_sh into the gfx struct

It's gfx IP specific, not asic specific, so move to a
gfx callback.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+12 -7
+2
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 1153 1153 struct amdgpu_gfx_funcs { 1154 1154 /* get the gpu clock counter */ 1155 1155 uint64_t (*get_gpu_clock_counter)(struct amdgpu_device *adev); 1156 + void (*select_se_sh)(struct amdgpu_device *adev, u32 se_num, u32 sh_num); 1156 1157 }; 1157 1158 1158 1159 struct amdgpu_gfx { ··· 2283 2282 #define amdgpu_dpm_vblank_too_short(adev) (adev)->pm.funcs->vblank_too_short((adev)) 2284 2283 #define amdgpu_dpm_enable_bapm(adev, e) (adev)->pm.funcs->enable_bapm((adev), (e)) 2285 2284 #define amdgpu_gfx_get_gpu_clock_counter(adev) (adev)->gfx.funcs->get_gpu_clock_counter((adev)) 2285 + #define amdgpu_gfx_select_se_sh(adev, se, sh) (adev)->gfx.funcs->select_se_sh((adev), (se), (sh)) 2286 2286 2287 2287 #define amdgpu_dpm_get_temperature(adev) \ 2288 2288 ((adev)->pp_enabled ? \
+2 -2
drivers/gpu/drm/amd/amdgpu/cik.c
··· 1035 1035 1036 1036 mutex_lock(&adev->grbm_idx_mutex); 1037 1037 if (se_num != 0xffffffff || sh_num != 0xffffffff) 1038 - gfx_v7_0_select_se_sh(adev, se_num, sh_num); 1038 + amdgpu_gfx_select_se_sh(adev, se_num, sh_num); 1039 1039 1040 1040 val = RREG32(reg_offset); 1041 1041 1042 1042 if (se_num != 0xffffffff || sh_num != 0xffffffff) 1043 - gfx_v7_0_select_se_sh(adev, 0xffffffff, 0xffffffff); 1043 + amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff); 1044 1044 mutex_unlock(&adev->grbm_idx_mutex); 1045 1045 return val; 1046 1046 }
+3 -1
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
··· 1583 1583 * registers are instanced per SE or SH. 0xffffffff means 1584 1584 * broadcast to all SEs or SHs (CIK). 1585 1585 */ 1586 - void gfx_v7_0_select_se_sh(struct amdgpu_device *adev, u32 se_num, u32 sh_num) 1586 + static void gfx_v7_0_select_se_sh(struct amdgpu_device *adev, 1587 + u32 se_num, u32 sh_num) 1587 1588 { 1588 1589 u32 data = GRBM_GFX_INDEX__INSTANCE_BROADCAST_WRITES_MASK; 1589 1590 ··· 4201 4200 4202 4201 static const struct amdgpu_gfx_funcs gfx_v7_0_gfx_funcs = { 4203 4202 .get_gpu_clock_counter = &gfx_v7_0_get_gpu_clock_counter, 4203 + .select_se_sh = &gfx_v7_0_select_se_sh, 4204 4204 }; 4205 4205 4206 4206 static int gfx_v7_0_early_init(void *handle)
-1
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.h
··· 30 30 void gfx_v7_0_enter_rlc_safe_mode(struct amdgpu_device *adev); 31 31 void gfx_v7_0_exit_rlc_safe_mode(struct amdgpu_device *adev); 32 32 void gfx_v7_0_rlc_stop(struct amdgpu_device *adev); 33 - void gfx_v7_0_select_se_sh(struct amdgpu_device *adev, u32 se_num, u32 sh_num); 34 33 35 34 #endif
+3 -1
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
··· 3446 3446 } 3447 3447 } 3448 3448 3449 - void gfx_v8_0_select_se_sh(struct amdgpu_device *adev, u32 se_num, u32 sh_num) 3449 + static void gfx_v8_0_select_se_sh(struct amdgpu_device *adev, 3450 + u32 se_num, u32 sh_num) 3450 3451 { 3451 3452 u32 data = REG_SET_FIELD(0, GRBM_GFX_INDEX, INSTANCE_BROADCAST_WRITES, 1); 3452 3453 ··· 5210 5209 5211 5210 static const struct amdgpu_gfx_funcs gfx_v8_0_gfx_funcs = { 5212 5211 .get_gpu_clock_counter = &gfx_v8_0_get_gpu_clock_counter, 5212 + .select_se_sh = &gfx_v8_0_select_se_sh, 5213 5213 }; 5214 5214 5215 5215 static int gfx_v8_0_early_init(void *handle)
+2 -2
drivers/gpu/drm/amd/amdgpu/vi.c
··· 533 533 534 534 mutex_lock(&adev->grbm_idx_mutex); 535 535 if (se_num != 0xffffffff || sh_num != 0xffffffff) 536 - gfx_v8_0_select_se_sh(adev, se_num, sh_num); 536 + amdgpu_gfx_select_se_sh(adev, se_num, sh_num); 537 537 538 538 val = RREG32(reg_offset); 539 539 540 540 if (se_num != 0xffffffff || sh_num != 0xffffffff) 541 - gfx_v8_0_select_se_sh(adev, 0xffffffff, 0xffffffff); 541 + amdgpu_gfx_select_se_sh(adev, 0xffffffff, 0xffffffff); 542 542 mutex_unlock(&adev->grbm_idx_mutex); 543 543 return val; 544 544 }