aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c87
1 files changed, 29 insertions, 58 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index dfc10b1baea0..147e92b3a959 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -4132,18 +4132,12 @@ static int gfx_v8_0_rlc_resume(struct amdgpu_device *adev)
4132 gfx_v8_0_rlc_reset(adev); 4132 gfx_v8_0_rlc_reset(adev);
4133 gfx_v8_0_init_pg(adev); 4133 gfx_v8_0_init_pg(adev);
4134 4134
4135 if (!adev->pp_enabled) { 4135
4136 if (adev->firmware.load_type != AMDGPU_FW_LOAD_SMU) { 4136 if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
4137 /* legacy rlc firmware loading */ 4137 /* legacy rlc firmware loading */
4138 r = gfx_v8_0_rlc_load_microcode(adev); 4138 r = gfx_v8_0_rlc_load_microcode(adev);
4139 if (r) 4139 if (r)
4140 return r; 4140 return r;
4141 } else {
4142 r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
4143 AMDGPU_UCODE_ID_RLC_G);
4144 if (r)
4145 return -EINVAL;
4146 }
4147 } 4141 }
4148 4142
4149 gfx_v8_0_rlc_start(adev); 4143 gfx_v8_0_rlc_start(adev);
@@ -4959,43 +4953,15 @@ static int gfx_v8_0_cp_resume(struct amdgpu_device *adev)
4959 if (!(adev->flags & AMD_IS_APU)) 4953 if (!(adev->flags & AMD_IS_APU))
4960 gfx_v8_0_enable_gui_idle_interrupt(adev, false); 4954 gfx_v8_0_enable_gui_idle_interrupt(adev, false);
4961 4955
4962 if (!adev->pp_enabled) { 4956 if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) {
4963 if (adev->firmware.load_type != AMDGPU_FW_LOAD_SMU) {
4964 /* legacy firmware loading */ 4957 /* legacy firmware loading */
4965 r = gfx_v8_0_cp_gfx_load_microcode(adev); 4958 r = gfx_v8_0_cp_gfx_load_microcode(adev);
4966 if (r) 4959 if (r)
4967 return r; 4960 return r;
4968 4961
4969 r = gfx_v8_0_cp_compute_load_microcode(adev); 4962 r = gfx_v8_0_cp_compute_load_microcode(adev);
4970 if (r) 4963 if (r)
4971 return r; 4964 return r;
4972 } else {
4973 r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
4974 AMDGPU_UCODE_ID_CP_CE);
4975 if (r)
4976 return -EINVAL;
4977
4978 r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
4979 AMDGPU_UCODE_ID_CP_PFP);
4980 if (r)
4981 return -EINVAL;
4982
4983 r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
4984 AMDGPU_UCODE_ID_CP_ME);
4985 if (r)
4986 return -EINVAL;
4987
4988 if (adev->asic_type == CHIP_TOPAZ) {
4989 r = gfx_v8_0_cp_compute_load_microcode(adev);
4990 if (r)
4991 return r;
4992 } else {
4993 r = adev->smu.smumgr_funcs->check_fw_load_finish(adev,
4994 AMDGPU_UCODE_ID_CP_MEC1);
4995 if (r)
4996 return -EINVAL;
4997 }
4998 }
4999 } 4965 }
5000 4966
5001 r = gfx_v8_0_cp_gfx_resume(adev); 4967 r = gfx_v8_0_cp_gfx_resume(adev);
@@ -6018,7 +5984,6 @@ static int gfx_v8_0_tonga_update_gfx_clock_gating(struct amdgpu_device *adev,
6018{ 5984{
6019 uint32_t msg_id, pp_state = 0; 5985 uint32_t msg_id, pp_state = 0;
6020 uint32_t pp_support_state = 0; 5986 uint32_t pp_support_state = 0;
6021 void *pp_handle = adev->powerplay.pp_handle;
6022 5987
6023 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS)) { 5988 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS)) {
6024 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) { 5989 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) {
@@ -6036,7 +6001,8 @@ static int gfx_v8_0_tonga_update_gfx_clock_gating(struct amdgpu_device *adev,
6036 PP_BLOCK_GFX_CG, 6001 PP_BLOCK_GFX_CG,
6037 pp_support_state, 6002 pp_support_state,
6038 pp_state); 6003 pp_state);
6039 amd_set_clockgating_by_smu(pp_handle, msg_id); 6004 if (adev->powerplay.pp_funcs->set_clockgating_by_smu)
6005 amdgpu_dpm_set_clockgating_by_smu(adev, msg_id);
6040 } 6006 }
6041 6007
6042 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_MGCG | AMD_CG_SUPPORT_GFX_MGLS)) { 6008 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_MGCG | AMD_CG_SUPPORT_GFX_MGLS)) {
@@ -6057,7 +6023,8 @@ static int gfx_v8_0_tonga_update_gfx_clock_gating(struct amdgpu_device *adev,
6057 PP_BLOCK_GFX_MG, 6023 PP_BLOCK_GFX_MG,
6058 pp_support_state, 6024 pp_support_state,
6059 pp_state); 6025 pp_state);
6060 amd_set_clockgating_by_smu(pp_handle, msg_id); 6026 if (adev->powerplay.pp_funcs->set_clockgating_by_smu)
6027 amdgpu_dpm_set_clockgating_by_smu(adev, msg_id);
6061 } 6028 }
6062 6029
6063 return 0; 6030 return 0;
@@ -6069,7 +6036,6 @@ static int gfx_v8_0_polaris_update_gfx_clock_gating(struct amdgpu_device *adev,
6069 6036
6070 uint32_t msg_id, pp_state = 0; 6037 uint32_t msg_id, pp_state = 0;
6071 uint32_t pp_support_state = 0; 6038 uint32_t pp_support_state = 0;
6072 void *pp_handle = adev->powerplay.pp_handle;
6073 6039
6074 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS)) { 6040 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_CGCG | AMD_CG_SUPPORT_GFX_CGLS)) {
6075 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) { 6041 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CGLS) {
@@ -6087,7 +6053,8 @@ static int gfx_v8_0_polaris_update_gfx_clock_gating(struct amdgpu_device *adev,
6087 PP_BLOCK_GFX_CG, 6053 PP_BLOCK_GFX_CG,
6088 pp_support_state, 6054 pp_support_state,
6089 pp_state); 6055 pp_state);
6090 amd_set_clockgating_by_smu(pp_handle, msg_id); 6056 if (adev->powerplay.pp_funcs->set_clockgating_by_smu)
6057 amdgpu_dpm_set_clockgating_by_smu(adev, msg_id);
6091 } 6058 }
6092 6059
6093 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_3D_CGCG | AMD_CG_SUPPORT_GFX_3D_CGLS)) { 6060 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_3D_CGCG | AMD_CG_SUPPORT_GFX_3D_CGLS)) {
@@ -6106,7 +6073,8 @@ static int gfx_v8_0_polaris_update_gfx_clock_gating(struct amdgpu_device *adev,
6106 PP_BLOCK_GFX_3D, 6073 PP_BLOCK_GFX_3D,
6107 pp_support_state, 6074 pp_support_state,
6108 pp_state); 6075 pp_state);
6109 amd_set_clockgating_by_smu(pp_handle, msg_id); 6076 if (adev->powerplay.pp_funcs->set_clockgating_by_smu)
6077 amdgpu_dpm_set_clockgating_by_smu(adev, msg_id);
6110 } 6078 }
6111 6079
6112 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_MGCG | AMD_CG_SUPPORT_GFX_MGLS)) { 6080 if (adev->cg_flags & (AMD_CG_SUPPORT_GFX_MGCG | AMD_CG_SUPPORT_GFX_MGLS)) {
@@ -6127,7 +6095,8 @@ static int gfx_v8_0_polaris_update_gfx_clock_gating(struct amdgpu_device *adev,
6127 PP_BLOCK_GFX_MG, 6095 PP_BLOCK_GFX_MG,
6128 pp_support_state, 6096 pp_support_state,
6129 pp_state); 6097 pp_state);
6130 amd_set_clockgating_by_smu(pp_handle, msg_id); 6098 if (adev->powerplay.pp_funcs->set_clockgating_by_smu)
6099 amdgpu_dpm_set_clockgating_by_smu(adev, msg_id);
6131 } 6100 }
6132 6101
6133 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_RLC_LS) { 6102 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_RLC_LS) {
@@ -6142,7 +6111,8 @@ static int gfx_v8_0_polaris_update_gfx_clock_gating(struct amdgpu_device *adev,
6142 PP_BLOCK_GFX_RLC, 6111 PP_BLOCK_GFX_RLC,
6143 pp_support_state, 6112 pp_support_state,
6144 pp_state); 6113 pp_state);
6145 amd_set_clockgating_by_smu(pp_handle, msg_id); 6114 if (adev->powerplay.pp_funcs->set_clockgating_by_smu)
6115 amdgpu_dpm_set_clockgating_by_smu(adev, msg_id);
6146 } 6116 }
6147 6117
6148 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CP_LS) { 6118 if (adev->cg_flags & AMD_CG_SUPPORT_GFX_CP_LS) {
@@ -6156,7 +6126,8 @@ static int gfx_v8_0_polaris_update_gfx_clock_gating(struct amdgpu_device *adev,
6156 PP_BLOCK_GFX_CP, 6126 PP_BLOCK_GFX_CP,
6157 pp_support_state, 6127 pp_support_state,
6158 pp_state); 6128 pp_state);
6159 amd_set_clockgating_by_smu(pp_handle, msg_id); 6129 if (adev->powerplay.pp_funcs->set_clockgating_by_smu)
6130 amdgpu_dpm_set_clockgating_by_smu(adev, msg_id);
6160 } 6131 }
6161 6132
6162 return 0; 6133 return 0;
@@ -7076,7 +7047,7 @@ static void gfx_v8_0_ring_emit_ce_meta(struct amdgpu_ring *ring)
7076{ 7047{
7077 uint64_t ce_payload_addr; 7048 uint64_t ce_payload_addr;
7078 int cnt_ce; 7049 int cnt_ce;
7079 static union { 7050 union {
7080 struct vi_ce_ib_state regular; 7051 struct vi_ce_ib_state regular;
7081 struct vi_ce_ib_state_chained_ib chained; 7052 struct vi_ce_ib_state_chained_ib chained;
7082 } ce_payload = {}; 7053 } ce_payload = {};
@@ -7105,7 +7076,7 @@ static void gfx_v8_0_ring_emit_de_meta(struct amdgpu_ring *ring)
7105{ 7076{
7106 uint64_t de_payload_addr, gds_addr, csa_addr; 7077 uint64_t de_payload_addr, gds_addr, csa_addr;
7107 int cnt_de; 7078 int cnt_de;
7108 static union { 7079 union {
7109 struct vi_de_ib_state regular; 7080 struct vi_de_ib_state regular;
7110 struct vi_de_ib_state_chained_ib chained; 7081 struct vi_de_ib_state_chained_ib chained;
7111 } de_payload = {}; 7082 } de_payload = {};