summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-02-05 05:26:56 +0100
committerAlex Deucher <alexander.deucher@amd.com>2016-02-08 16:37:42 +0100
commitb6df77fc5c42041a11ff094e5595d1e7379c917f (patch)
treedf63099a0b0fe78f2c499333b219b4118131d7b0 /drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
parentdrm/amdgpu/dpm/ci: switch over to the common pcie caps interface (diff)
downloadlinux-b6df77fc5c42041a11ff094e5595d1e7379c917f.tar.xz
linux-b6df77fc5c42041a11ff094e5595d1e7379c917f.zip
drm/amdgpu: handle uvd pg flags properly
Don't attempt to start/stop the uvd block if pg is disabled. Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
index 5e9f73af83a8..9cb528740473 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
@@ -848,7 +848,10 @@ static int uvd_v4_2_set_powergating_state(void *handle,
* revisit this when there is a cleaner line between
* the smc and the hw blocks
*/
- 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) {
uvd_v4_2_stop(adev);