aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
diff options
context:
space:
mode:
authorJames Zhu <jzhums@gmail.com>2018-09-13 16:55:44 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-09-26 22:09:12 -0400
commitc95f75f4e86c1c0d867b76f2a134dbeac099cf89 (patch)
tree8142d5a542f2b005e4b9110bef4a892ea638287c /drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
parent2faec55c4d972a87a420301ec9e4556c79ee8b54 (diff)
drm/amdgpu:No action when VCN PG state is unchanged
When VCN PG state is unchanged, it is unnecessary to reset power gate state Signed-off-by: James Zhu <James.Zhu@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 2664bb2c47c3..2cde0b4046db 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
@@ -1633,12 +1633,20 @@ static int vcn_v1_0_set_powergating_state(void *handle,
1633 * revisit this when there is a cleaner line between 1633 * revisit this when there is a cleaner line between
1634 * the smc and the hw blocks 1634 * the smc and the hw blocks
1635 */ 1635 */
1636 int ret;
1636 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 1637 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1637 1638
1639 if(state == adev->vcn.cur_state)
1640 return 0;
1641
1638 if (state == AMD_PG_STATE_GATE) 1642 if (state == AMD_PG_STATE_GATE)
1639 return vcn_v1_0_stop(adev); 1643 ret = vcn_v1_0_stop(adev);
1640 else 1644 else
1641 return vcn_v1_0_start(adev); 1645 ret = vcn_v1_0_start(adev);
1646
1647 if(!ret)
1648 adev->vcn.cur_state = state;
1649 return ret;
1642} 1650}
1643 1651
1644static const struct amd_ip_funcs vcn_v1_0_ip_funcs = { 1652static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {