From: Alex Deucher Date: Thu, 17 May 2018 17:33:34 +0000 (-0500) Subject: drm/amdgpu: count fences from all uvd instances in idle handler X-Git-Tag: v5.15~8594^2~6^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f0fd919471cf2477e86e2be9b53ecae37b0e815;p=platform%2Fkernel%2Flinux-starfive.git drm/amdgpu: count fences from all uvd instances in idle handler Current multi-UVD hardware uses a single clock and power source so handle all instances in the idle handler. Reviewed-by: James Zhu Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index 0772680..be2917c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -1146,7 +1146,11 @@ static void amdgpu_uvd_idle_work_handler(struct work_struct *work) { struct amdgpu_device *adev = container_of(work, struct amdgpu_device, uvd.inst->idle_work.work); - unsigned fences = amdgpu_fence_count_emitted(&adev->uvd.inst->ring); + unsigned fences = 0, i; + + for (i = 0; i < adev->uvd.num_uvd_inst; ++i) { + fences += amdgpu_fence_count_emitted(&adev->uvd.inst[i].ring); + } if (fences == 0) { if (adev->pm.dpm_enabled) {