drm/amdgpu: disable MGCG/MGLS also on gfx CG ungate
Subsystems (2)
PATCH 1/3 drm/amdgpu: disable MGCG/MGLS also on gfx CG ungate
Otherwise, MGCG/MGLS will be left enabled.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
@@ -7027,7 +7027,7 @@ static int gfx_v10_0_update_gfx_clock_gating(struct amdgpu_device *adev,/* === CGCG /CGLS for GFX 3D Only === */ gfx_v10_0_update_3d_clock_gating (adev, enable);/* === MGCG + MGLS === */ -/* gfx_v10_0_update_medium_grain_clock_gating(adev, enable); */ +gfx_v10_0_update_medium_grain_clock_gating (adev, enable); } if (adev->cg_flags &
Signature · 6 lines
2.26.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/3 drm/amdgpu: drop unnecessary cancel_delayed_work_sync on PG ungate
As this is already properly handled in amdgpu_gfx_off_ctrl(). In fact, this unnecessary cancel_delayed_work_sync may leave a small time window for race condition and is dangerous.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 +----- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++--------- 2 files changed, 4 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -5
@@ -7108,11 +7108,7 @@ static int gfx_v10_0_set_powergating_state(void *handle,case CHIP_NAVI10 :case CHIP_NAVI12 :case CHIP_NAVI14 : -if (!enable) { -amdgpu_gfx_off_ctrl (adev, false); -cancel_delayed_work_sync (&adev->gfx.gfx_off_delay_work); - }else -amdgpu_gfx_off_ctrl (adev, true); +amdgpu_gfx_off_ctrl (adev, enable);break ;default :break ;
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -9
@@ -5031,10 +5031,9 @@ static int gfx_v9_0_set_powergating_state(void *handle,switch (adev->asic_type) {case CHIP_RAVEN :case CHIP_RENOIR : -if (!enable) { +if (!enable)amdgpu_gfx_off_ctrl (adev, false); -cancel_delayed_work_sync (&adev->gfx.gfx_off_delay_work); - } +if (adev->pg_flags &AMD_PG_SUPPORT_RLC_SMU_HS ) {gfx_v9_0_enable_sck_slow_down_on_power_up (adev, true);gfx_v9_0_enable_sck_slow_down_on_power_down (adev, true);
@@ -5058,12 +5057,7 @@ static int gfx_v9_0_set_powergating_state(void *handle,amdgpu_gfx_off_ctrl (adev, true);break ;case CHIP_VEGA12 : -if (!enable) { -amdgpu_gfx_off_ctrl (adev, false); -cancel_delayed_work_sync (&adev->gfx.gfx_off_delay_work); - }else { -amdgpu_gfx_off_ctrl (adev, true); - } +amdgpu_gfx_off_ctrl (adev, enable);break ;default :break ;
Signature · 6 lines
2.26.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/3 drm/amd/powerplay: perform PG ungate prior to CG ungate
In reply to Evan QuanSince gfxoff should be disabled first before trying to access those GC registers.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 6 +++--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3 -3
@@ -322,12 +322,12 @@ static void pp_dpm_en_umd_pstate(struct pp_hwmgr *hwmgr,if (*level & profile_mode_mask) { hwmgr->saved_dpm_level = hwmgr->dpm_level; hwmgr->en_umd_pstate = true; -amdgpu_device_ip_set_clockgating_state (hwmgr->adev, -AMD_IP_BLOCK_TYPE_GFX , -AMD_CG_STATE_UNGATE );amdgpu_device_ip_set_powergating_state (hwmgr->adev,AMD_IP_BLOCK_TYPE_GFX ,AMD_PG_STATE_UNGATE ); +amdgpu_device_ip_set_clockgating_state (hwmgr->adev, +AMD_IP_BLOCK_TYPE_GFX , +AMD_CG_STATE_UNGATE ); } }else {/* exit umd pstate, restore level, enable gfx cg*/
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -3
@@ -1780,12 +1780,12 @@ static int smu_enable_umd_pstate(void *handle,if (*level & profile_mode_mask) { smu_dpm_ctx->saved_dpm_level = smu_dpm_ctx->dpm_level; smu_dpm_ctx->enable_umd_pstate = true; -amdgpu_device_ip_set_clockgating_state (smu->adev, -AMD_IP_BLOCK_TYPE_GFX , -AMD_CG_STATE_UNGATE );amdgpu_device_ip_set_powergating_state (smu->adev,AMD_IP_BLOCK_TYPE_GFX ,AMD_PG_STATE_UNGATE ); +amdgpu_device_ip_set_clockgating_state (smu->adev, +AMD_IP_BLOCK_TYPE_GFX , +AMD_CG_STATE_UNGATE ); } }else {/* exit umd pstate, restore level, enable gfx cg*/
Signature · 6 lines
2.26.2 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 3/3] drm/amd/powerplay: perform PG ungate prior to CG ungate
Quoted 6 lines · Evan Quan
Since gfxoff should be disabled first before trying to access those GC registers.
Change-Id I5bf0fbe01fa05c89bbb392ef40e11c07edfee039Signed-off-by Evan Quan <[email protected]>
Series is:
Quoted 48 lines
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 6 +++--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3
-3@@ -322,12 +322,12 @@ static void pp_dpm_en_umd_pstate(struct pp_hwmgr *hwmgr,if (*level & profile_mode_mask) { hwmgr->saved_dpm_level = hwmgr->dpm_level; hwmgr->en_umd_pstate = true; -amdgpu_device_ip_set_clockgating_state (hwmgr->adev, -AMD_IP_BLOCK_TYPE_GFX , -AMD_CG_STATE_UNGATE );amdgpu_device_ip_set_powergating_state (hwmgr->adev,AMD_IP_BLOCK_TYPE_GFX ,AMD_PG_STATE_UNGATE ); +amdgpu_device_ip_set_clockgating_state (hwmgr->adev, +AMD_IP_BLOCK_TYPE_GFX , +AMD_CG_STATE_UNGATE ); } }else {/* exit umd pstate, restore level, enable gfx cg*/ drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3
-4@@ -1780,12 +1780,12 @@ static int smu_enable_umd_pstate(void *handle,if (*level & profile_mode_mask) { smu_dpm_ctx->saved_dpm_level = smu_dpm_ctx->dpm_level; smu_dpm_ctx->enable_umd_pstate = true; -amdgpu_device_ip_set_clockgating_state (smu->adev, -AMD_IP_BLOCK_TYPE_GFX , -AMD_CG_STATE_UNGATE );amdgpu_device_ip_set_powergating_state (smu->adev,AMD_IP_BLOCK_TYPE_GFX ,AMD_PG_STATE_UNGATE ); +amdgpu_device_ip_set_clockgating_state (smu->adev, +AMD_IP_BLOCK_TYPE_GFX , +AMD_CG_STATE_UNGATE ); } }else {/* exit umd pstate, restore level, enable gfx cg*/ --2.26.2
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx