Commit b887ac35 authored by Alex Deucher's avatar Alex Deucher Committed by Tim Gardner

drm/amdgpu: handle uvd pg flags properly

BugLink: http://bugs.launchpad.net/bugs/1546572

Don't attempt to start/stop the uvd block if pg is disabled.
Reviewed-by: default avatarEric Huang <JinHuiEric.Huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b6df77fc)
Signed-off-by: default avatarAlberto Milone <alberto.milone@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 47240ed1
...@@ -850,6 +850,9 @@ static int uvd_v4_2_set_powergating_state(void *handle, ...@@ -850,6 +850,9 @@ static int uvd_v4_2_set_powergating_state(void *handle,
*/ */
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (!(adev->pg_flags & AMDGPU_PG_SUPPORT_UVD))
return 0;
if (state == AMD_PG_STATE_GATE) { if (state == AMD_PG_STATE_GATE) {
uvd_v4_2_stop(adev); uvd_v4_2_stop(adev);
return 0; return 0;
......
...@@ -789,6 +789,9 @@ static int uvd_v5_0_set_powergating_state(void *handle, ...@@ -789,6 +789,9 @@ static int uvd_v5_0_set_powergating_state(void *handle,
*/ */
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (!(adev->pg_flags & AMDGPU_PG_SUPPORT_UVD))
return 0;
if (state == AMD_PG_STATE_GATE) { if (state == AMD_PG_STATE_GATE) {
uvd_v5_0_stop(adev); uvd_v5_0_stop(adev);
return 0; return 0;
......
...@@ -1030,6 +1030,9 @@ static int uvd_v6_0_set_powergating_state(void *handle, ...@@ -1030,6 +1030,9 @@ static int uvd_v6_0_set_powergating_state(void *handle,
*/ */
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (!(adev->pg_flags & AMDGPU_PG_SUPPORT_UVD))
return 0;
if (state == AMD_PG_STATE_GATE) { if (state == AMD_PG_STATE_GATE) {
uvd_v6_0_stop(adev); uvd_v6_0_stop(adev);
return 0; return 0;
......
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