drm/amdgpu: handle vce pg flags properly
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Feb 2016 04:29:45 +0000 (23:29 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Feb 2016 15:37:43 +0000 (10:37 -0500)
Don't attempt to start/stop the vce block if pg is disabled.

Reviewed-by: Eric Huang <JinHuiEric.Huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c

index 52ac7a8f1e58b91f3ad0c441b6a175062bddad29..d3ce6085ccd232fd2268936605371b374014716e 100644 (file)
@@ -608,6 +608,9 @@ static int vce_v2_0_set_powergating_state(void *handle,
         */
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       if (!(adev->pg_flags & AMDGPU_PG_SUPPORT_VCE))
+               return 0;
+
        if (state == AMD_PG_STATE_GATE)
                /* XXX do we need a vce_v2_0_stop()? */
                return 0;
index e99af81e4aec3543278c681418138b12feae4c94..797d12c31475189cbd21e057056353ac3e39ca8b 100644 (file)
@@ -728,6 +728,9 @@ static int vce_v3_0_set_powergating_state(void *handle,
         */
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       if (!(adev->pg_flags & AMDGPU_PG_SUPPORT_VCE))
+               return 0;
+
        if (state == AMD_PG_STATE_GATE)
                /* XXX do we need a vce_v3_0_stop()? */
                return 0;
This page took 0.027685 seconds and 5 git commands to generate.