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

drm/amdgpu/gfx7: switch to using the existing rlc callbacks

gfx8 already uses them. Remove the direct exports and
use the callbacks fpr gfx7.

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

+14 -10
+3 -3
drivers/gpu/drm/amd/amdgpu/ci_dpm.c
··· 738 738 739 739 if (pi->caps_sq_ramping || pi->caps_db_ramping || 740 740 pi->caps_td_ramping || pi->caps_tcp_ramping) { 741 - gfx_v7_0_enter_rlc_safe_mode(adev); 741 + adev->gfx.rlc.funcs->enter_safe_mode(adev); 742 742 743 743 if (enable) { 744 744 ret = ci_program_pt_config_registers(adev, didt_config_ci); 745 745 if (ret) { 746 - gfx_v7_0_exit_rlc_safe_mode(adev); 746 + adev->gfx.rlc.funcs->exit_safe_mode(adev); 747 747 return ret; 748 748 } 749 749 } 750 750 751 751 ci_do_enable_didt(adev, enable); 752 752 753 - gfx_v7_0_exit_rlc_safe_mode(adev); 753 + adev->gfx.rlc.funcs->exit_safe_mode(adev); 754 754 } 755 755 756 756 return 0;
+8 -2
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
··· 3436 3436 return orig; 3437 3437 } 3438 3438 3439 - void gfx_v7_0_enter_rlc_safe_mode(struct amdgpu_device *adev) 3439 + static void gfx_v7_0_enter_rlc_safe_mode(struct amdgpu_device *adev) 3440 3440 { 3441 3441 u32 tmp, i, mask; 3442 3442 ··· 3458 3458 } 3459 3459 } 3460 3460 3461 - void gfx_v7_0_exit_rlc_safe_mode(struct amdgpu_device *adev) 3461 + static void gfx_v7_0_exit_rlc_safe_mode(struct amdgpu_device *adev) 3462 3462 { 3463 3463 u32 tmp; 3464 3464 ··· 4204 4204 .select_se_sh = &gfx_v7_0_select_se_sh, 4205 4205 }; 4206 4206 4207 + static const struct amdgpu_rlc_funcs gfx_v7_0_rlc_funcs = { 4208 + .enter_safe_mode = gfx_v7_0_enter_rlc_safe_mode, 4209 + .exit_safe_mode = gfx_v7_0_exit_rlc_safe_mode 4210 + }; 4211 + 4207 4212 static int gfx_v7_0_early_init(void *handle) 4208 4213 { 4209 4214 struct amdgpu_device *adev = (struct amdgpu_device *)handle; ··· 4216 4211 adev->gfx.num_gfx_rings = GFX7_NUM_GFX_RINGS; 4217 4212 adev->gfx.num_compute_rings = GFX7_NUM_COMPUTE_RINGS; 4218 4213 adev->gfx.funcs = &gfx_v7_0_gfx_funcs; 4214 + adev->gfx.rlc.funcs = &gfx_v7_0_rlc_funcs; 4219 4215 gfx_v7_0_set_ring_funcs(adev); 4220 4216 gfx_v7_0_set_irq_funcs(adev); 4221 4217 gfx_v7_0_set_gds_init(adev);
-2
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.h
··· 27 27 extern const struct amd_ip_funcs gfx_v7_0_ip_funcs; 28 28 29 29 /* XXX these shouldn't be exported */ 30 - void gfx_v7_0_enter_rlc_safe_mode(struct amdgpu_device *adev); 31 - void gfx_v7_0_exit_rlc_safe_mode(struct amdgpu_device *adev); 32 30 void gfx_v7_0_rlc_stop(struct amdgpu_device *adev); 33 31 34 32 #endif
+3 -3
drivers/gpu/drm/amd/amdgpu/kv_dpm.c
··· 507 507 pi->caps_db_ramping || 508 508 pi->caps_td_ramping || 509 509 pi->caps_tcp_ramping) { 510 - gfx_v7_0_enter_rlc_safe_mode(adev); 510 + adev->gfx.rlc.funcs->enter_safe_mode(adev); 511 511 512 512 if (enable) { 513 513 ret = kv_program_pt_config_registers(adev, didt_config_kv); 514 514 if (ret) { 515 - gfx_v7_0_exit_rlc_safe_mode(adev); 515 + adev->gfx.rlc.funcs->exit_safe_mode(adev); 516 516 return ret; 517 517 } 518 518 } 519 519 520 520 kv_do_enable_didt(adev, enable); 521 521 522 - gfx_v7_0_exit_rlc_safe_mode(adev); 522 + adev->gfx.rlc.funcs->exit_safe_mode(adev); 523 523 } 524 524 525 525 return 0;