Commit 50237287 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amdgpu: various cleanups for uvd/vce.

Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e6707218
...@@ -135,12 +135,9 @@ static int uvd_v4_2_sw_fini(void *handle) ...@@ -135,12 +135,9 @@ static int uvd_v4_2_sw_fini(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_uvd_sw_fini(adev); return amdgpu_uvd_sw_fini(adev);
if (r)
return r;
return r;
} }
static void uvd_v4_2_enable_mgcg(struct amdgpu_device *adev, static void uvd_v4_2_enable_mgcg(struct amdgpu_device *adev,
bool enable); bool enable);
/** /**
...@@ -230,11 +227,7 @@ static int uvd_v4_2_suspend(void *handle) ...@@ -230,11 +227,7 @@ static int uvd_v4_2_suspend(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_uvd_suspend(adev); return amdgpu_uvd_suspend(adev);
if (r)
return r;
return r;
} }
static int uvd_v4_2_resume(void *handle) static int uvd_v4_2_resume(void *handle)
...@@ -246,11 +239,7 @@ static int uvd_v4_2_resume(void *handle) ...@@ -246,11 +239,7 @@ static int uvd_v4_2_resume(void *handle)
if (r) if (r)
return r; return r;
r = uvd_v4_2_hw_init(adev); return uvd_v4_2_hw_init(adev);
if (r)
return r;
return r;
} }
/** /**
......
...@@ -131,11 +131,7 @@ static int uvd_v5_0_sw_fini(void *handle) ...@@ -131,11 +131,7 @@ static int uvd_v5_0_sw_fini(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_uvd_sw_fini(adev); return amdgpu_uvd_sw_fini(adev);
if (r)
return r;
return r;
} }
/** /**
...@@ -228,11 +224,7 @@ static int uvd_v5_0_suspend(void *handle) ...@@ -228,11 +224,7 @@ static int uvd_v5_0_suspend(void *handle)
return r; return r;
uvd_v5_0_set_clockgating_state(adev, AMD_CG_STATE_GATE); uvd_v5_0_set_clockgating_state(adev, AMD_CG_STATE_GATE);
r = amdgpu_uvd_suspend(adev); return amdgpu_uvd_suspend(adev);
if (r)
return r;
return r;
} }
static int uvd_v5_0_resume(void *handle) static int uvd_v5_0_resume(void *handle)
...@@ -244,11 +236,7 @@ static int uvd_v5_0_resume(void *handle) ...@@ -244,11 +236,7 @@ static int uvd_v5_0_resume(void *handle)
if (r) if (r)
return r; return r;
r = uvd_v5_0_hw_init(adev); return uvd_v5_0_hw_init(adev);
if (r)
return r;
return r;
} }
/** /**
......
...@@ -134,11 +134,7 @@ static int uvd_v6_0_sw_fini(void *handle) ...@@ -134,11 +134,7 @@ static int uvd_v6_0_sw_fini(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_uvd_sw_fini(adev); return amdgpu_uvd_sw_fini(adev);
if (r)
return r;
return r;
} }
/** /**
...@@ -230,11 +226,8 @@ static int uvd_v6_0_suspend(void *handle) ...@@ -230,11 +226,8 @@ static int uvd_v6_0_suspend(void *handle)
return r; return r;
/* Skip this for APU for now */ /* Skip this for APU for now */
if (!(adev->flags & AMD_IS_APU)) { if (!(adev->flags & AMD_IS_APU))
r = amdgpu_uvd_suspend(adev); r = amdgpu_uvd_suspend(adev);
if (r)
return r;
}
return r; return r;
} }
...@@ -250,11 +243,7 @@ static int uvd_v6_0_resume(void *handle) ...@@ -250,11 +243,7 @@ static int uvd_v6_0_resume(void *handle)
if (r) if (r)
return r; return r;
} }
r = uvd_v6_0_hw_init(adev); return uvd_v6_0_hw_init(adev);
if (r)
return r;
return r;
} }
/** /**
......
...@@ -438,11 +438,7 @@ static int uvd_v7_0_sw_fini(void *handle) ...@@ -438,11 +438,7 @@ static int uvd_v7_0_sw_fini(void *handle)
for (i = 0; i < adev->uvd.num_enc_rings; ++i) for (i = 0; i < adev->uvd.num_enc_rings; ++i)
amdgpu_ring_fini(&adev->uvd.ring_enc[i]); amdgpu_ring_fini(&adev->uvd.ring_enc[i]);
r = amdgpu_uvd_sw_fini(adev); return amdgpu_uvd_sw_fini(adev);
if (r)
return r;
return r;
} }
/** /**
...@@ -547,11 +543,8 @@ static int uvd_v7_0_suspend(void *handle) ...@@ -547,11 +543,8 @@ static int uvd_v7_0_suspend(void *handle)
return r; return r;
/* Skip this for APU for now */ /* Skip this for APU for now */
if (!(adev->flags & AMD_IS_APU)) { if (!(adev->flags & AMD_IS_APU))
r = amdgpu_uvd_suspend(adev); r = amdgpu_uvd_suspend(adev);
if (r)
return r;
}
return r; return r;
} }
...@@ -567,11 +560,7 @@ static int uvd_v7_0_resume(void *handle) ...@@ -567,11 +560,7 @@ static int uvd_v7_0_resume(void *handle)
if (r) if (r)
return r; return r;
} }
r = uvd_v7_0_hw_init(adev); return uvd_v7_0_hw_init(adev);
if (r)
return r;
return r;
} }
/** /**
......
...@@ -451,11 +451,7 @@ static int vce_v2_0_sw_fini(void *handle) ...@@ -451,11 +451,7 @@ static int vce_v2_0_sw_fini(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_vce_sw_fini(adev); return amdgpu_vce_sw_fini(adev);
if (r)
return r;
return r;
} }
static int vce_v2_0_hw_init(void *handle) static int vce_v2_0_hw_init(void *handle)
...@@ -495,11 +491,7 @@ static int vce_v2_0_suspend(void *handle) ...@@ -495,11 +491,7 @@ static int vce_v2_0_suspend(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_vce_suspend(adev); return amdgpu_vce_suspend(adev);
if (r)
return r;
return r;
} }
static int vce_v2_0_resume(void *handle) static int vce_v2_0_resume(void *handle)
...@@ -511,11 +503,7 @@ static int vce_v2_0_resume(void *handle) ...@@ -511,11 +503,7 @@ static int vce_v2_0_resume(void *handle)
if (r) if (r)
return r; return r;
r = vce_v2_0_hw_init(adev); return vce_v2_0_hw_init(adev);
if (r)
return r;
return r;
} }
static int vce_v2_0_soft_reset(void *handle) static int vce_v2_0_soft_reset(void *handle)
......
...@@ -417,11 +417,7 @@ static int vce_v3_0_sw_fini(void *handle) ...@@ -417,11 +417,7 @@ static int vce_v3_0_sw_fini(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_vce_sw_fini(adev); return amdgpu_vce_sw_fini(adev);
if (r)
return r;
return r;
} }
static int vce_v3_0_hw_init(void *handle) static int vce_v3_0_hw_init(void *handle)
...@@ -471,11 +467,7 @@ static int vce_v3_0_suspend(void *handle) ...@@ -471,11 +467,7 @@ static int vce_v3_0_suspend(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_vce_suspend(adev); return amdgpu_vce_suspend(adev);
if (r)
return r;
return r;
} }
static int vce_v3_0_resume(void *handle) static int vce_v3_0_resume(void *handle)
...@@ -487,11 +479,7 @@ static int vce_v3_0_resume(void *handle) ...@@ -487,11 +479,7 @@ static int vce_v3_0_resume(void *handle)
if (r) if (r)
return r; return r;
r = vce_v3_0_hw_init(adev); return vce_v3_0_hw_init(adev);
if (r)
return r;
return r;
} }
static void vce_v3_0_mc_resume(struct amdgpu_device *adev, int idx) static void vce_v3_0_mc_resume(struct amdgpu_device *adev, int idx)
......
...@@ -527,11 +527,7 @@ static int vce_v4_0_sw_fini(void *handle) ...@@ -527,11 +527,7 @@ static int vce_v4_0_sw_fini(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_vce_sw_fini(adev); return amdgpu_vce_sw_fini(adev);
if (r)
return r;
return r;
} }
static int vce_v4_0_hw_init(void *handle) static int vce_v4_0_hw_init(void *handle)
...@@ -584,11 +580,7 @@ static int vce_v4_0_suspend(void *handle) ...@@ -584,11 +580,7 @@ static int vce_v4_0_suspend(void *handle)
if (r) if (r)
return r; return r;
r = amdgpu_vce_suspend(adev); return amdgpu_vce_suspend(adev);
if (r)
return r;
return r;
} }
static int vce_v4_0_resume(void *handle) static int vce_v4_0_resume(void *handle)
...@@ -600,11 +592,7 @@ static int vce_v4_0_resume(void *handle) ...@@ -600,11 +592,7 @@ static int vce_v4_0_resume(void *handle)
if (r) if (r)
return r; return r;
r = vce_v4_0_hw_init(adev); return vce_v4_0_hw_init(adev);
if (r)
return r;
return r;
} }
static void vce_v4_0_mc_resume(struct amdgpu_device *adev) static void vce_v4_0_mc_resume(struct amdgpu_device *adev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment