Commit 2875125c authored by Tom St Denis's avatar Tom St Denis Committed by Alex Deucher
Browse files

drm/amd/amdgpu: don't track state in UVD clockgating



There's no need to track CG state anymore.

Signed-off-by: default avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 7acc83d4
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -959,21 +959,15 @@ static int uvd_v6_0_set_clockgating_state(void *handle,
					  enum amd_clockgating_state state)
{
	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
	bool enable = (state == AMD_CG_STATE_GATE) ? true : false;
	static int curstate = -1;

	if (adev->asic_type == CHIP_FIJI ||
			adev->asic_type == CHIP_POLARIS10)
		uvd_v6_set_bypass_mode(adev, enable);

	if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG))
		return 0;

	if (curstate == state)
		return 0;
	if (adev->asic_type == CHIP_FIJI ||
	    adev->asic_type == CHIP_POLARIS10)
		uvd_v6_set_bypass_mode(adev, state == AMD_CG_STATE_GATE ? true : false);

	curstate = state;
	if (enable) {
	if (state == AMD_CG_STATE_GATE) {
		/* disable HW gating and enable Sw gating */
		uvd_v6_0_set_sw_clock_gating(adev);
	} else {