drm/amdgpu: refine vce2.0 dpm sequence
Subsystems (2)
PATCH 1/3 drm/amdgpu: refine vce2.0 dpm sequence
first start vce then enable vce dpm.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +3 -3
@@ -1315,11 +1315,11 @@ void amdgpu_dpm_enable_vce(struct amdgpu_device *adev, bool enable)/* XXX select vce level based on ring/task */ adev->pm.dpm.vce_level =AMD_VCE_LEVEL_AC_ALL ;mutex_unlock (&adev->pm.mutex); -amdgpu_pm_compute_clocks (adev); -amdgpu_set_powergating_state (adev,AMD_IP_BLOCK_TYPE_VCE , -AMD_PG_STATE_UNGATE );amdgpu_set_clockgating_state (adev,AMD_IP_BLOCK_TYPE_VCE ,AMD_CG_STATE_UNGATE ); +amdgpu_set_powergating_state (adev,AMD_IP_BLOCK_TYPE_VCE , +AMD_PG_STATE_UNGATE ); +amdgpu_pm_compute_clocks (adev); }else {amdgpu_set_powergating_state (adev,AMD_IP_BLOCK_TYPE_VCE ,AMD_PG_STATE_GATE );
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1489395082-30583-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
PATCH 2/3 drm/amd/powerplay: fix copy error in smu7_clockpoweragting.c
--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +1 -1
@@ -178,7 +178,7 @@ int smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate)if (bgate) {cgs_set_powergating_state (hwmgr->device,AMD_IP_BLOCK_TYPE_VCE , -AMD_PG_STATE_UNGATE ); +AMD_PG_STATE_GATE );cgs_set_clockgating_state (hwmgr->device,AMD_IP_BLOCK_TYPE_VCE ,AMD_CG_STATE_GATE );
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/3 drm/amdgpu: refine vce_3.0 code.
In reply to a message not in the archivefix logic error in hw_fini andset_clockgating_state functions.
--- drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +7 -9
@@ -65,7 +65,8 @@static void vce_v3_0_set_ring_funcs (struct amdgpu_device *adev);static void vce_v3_0_set_irq_funcs (struct amdgpu_device *adev);static int vce_v3_0_wait_for_idle (void *handle); - +static int vce_v3_0_set_clockgating_state (void *handle, +enum amd_clockgating_state state);/** * vce_v3_0_ring_get_rptr - get read pointer *
@@ -305,12 +306,8 @@ static int vce_v3_0_stop(struct amdgpu_device *adev)/* hold on ECPU */ WREG32_FIELD (VCE_SOFT_RESET ,ECPU_SOFT_RESET ,1 ); -/* clear BUSY flag */ -WREG32_FIELD (VCE_STATUS ,JOB_BUSY ,0 ); - -/* Set Clock-Gating off */ -if (adev->cg_flags &AMD_CG_SUPPORT_VCE_MGCG ) -vce_v3_0_set_vce_sw_clock_gating (adev, false); +/* clear VCE STATUS */ +WREG32 (mmVCE_STATUS,0 ); }WREG32 (mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT);
@@ -461,7 +458,8 @@ static int vce_v3_0_hw_fini(void *handle)if (r)return r; -return vce_v3_0_stop (adev); +vce_v3_0_stop (adev); +return vce_v3_0_set_clockgating_state (adev,AMD_CG_STATE_GATE ); }static int vce_v3_0_suspend (void *handle)
@@ -728,7 +726,7 @@ static int vce_v3_0_set_clockgating_state(void *handle,WREG32 (mmGRBM_GFX_INDEX,GET_VCE_INSTANCE (i)); -if (enable) { +if (!enable) {/* initialize VCE_CLOCK_GATING_A: Clock ON/OFF delay */ uint32_t data =RREG32 (mmVCE_CLOCK_GATING_A); data &= ~(0xf |0xff0 );
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1489395082-30583-3-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Reviewed-byRe: [PATCH 3/3] drm/amdgpu: refine vce_3.0 code.
Quoted 5 lines · Rex Zhu
fix logic error in
hw_finiandset_clockgating_statefunctions.Change-Id I1e3f241f300b3c561df695b38b19c7a89160db25Signed-off-by Rex Zhu <[email protected]>
Series is:
Quoted 55 lines
--- drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +7
-10@@ -65,7 +65,8 @@static void vce_v3_0_set_ring_funcs (struct amdgpu_device *adev);static void vce_v3_0_set_irq_funcs (struct amdgpu_device *adev);static int vce_v3_0_wait_for_idle (void *handle); - +static int vce_v3_0_set_clockgating_state (void *handle, +enum amd_clockgating_state state);/** * vce_v3_0_ring_get_rptr - get read pointer * @@ -305,12 +306,8 @@ static int vce_v3_0_stop(struct amdgpu_device *adev)/* hold on ECPU */ WREG32_FIELD (VCE_SOFT_RESET ,ECPU_SOFT_RESET ,1 ); -/* clear BUSY flag */ -WREG32_FIELD (VCE_STATUS ,JOB_BUSY ,0 ); - -/* Set Clock-Gating off */ -if (adev->cg_flags &AMD_CG_SUPPORT_VCE_MGCG ) -vce_v3_0_set_vce_sw_clock_gating (adev, false); +/* clear VCE STATUS */ +WREG32 (mmVCE_STATUS,0 ); }WREG32 (mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT);@@ -461,7 +458,8 @@ static int vce_v3_0_hw_fini(void *handle)if (r)return r; -return vce_v3_0_stop (adev); +vce_v3_0_stop (adev); +return vce_v3_0_set_clockgating_state (adev,AMD_CG_STATE_GATE ); }static int vce_v3_0_suspend (void *handle)@@ -728,7 +726,7 @@ static int vce_v3_0_set_clockgating_state(void *handle,WREG32 (mmGRBM_GFX_INDEX,GET_VCE_INSTANCE (i)); -if (enable) { +if (!enable) {/* initialize VCE_CLOCK_GATING_A: Clock ON/OFF delay */ uint32_t data =RREG32 (mmVCE_CLOCK_GATING_A); data &= ~(0xf |0xff0 ); --1.9.1
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