Browse Source

drm/amdgpu: handle vce pg flags properly

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>
Alex Deucher 9 years ago
parent
commit
808a934fd4
2 changed files with 6 additions and 0 deletions
  1. 3 0
      drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
  2. 3 0
      drivers/gpu/drm/amd/amdgpu/vce_v3_0.c

+ 3 - 0
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c

@@ -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;

+ 3 - 0
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c

@@ -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;