drm/amdgpu: Take vcn encode rings into account in idle work
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 17 May 2018 18:03:05 +0000 (13:03 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 18 May 2018 21:08:21 +0000 (16:08 -0500)
Take the encode rings into account in the idle work handler.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

index e5d234cf804fca13ef5155eb2301bfb453fa048c..60468385e6b4edbc8adc8641a88833e38c33a4f1 100644 (file)
@@ -205,6 +205,11 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work)
        struct amdgpu_device *adev =
                container_of(work, struct amdgpu_device, vcn.idle_work.work);
        unsigned fences = amdgpu_fence_count_emitted(&adev->vcn.ring_dec);
+       unsigned i;
+
+       for (i = 0; i < adev->vcn.num_enc_rings; ++i) {
+               fences += amdgpu_fence_count_emitted(&adev->vcn.ring_enc[i]);
+       }
 
        if (fences == 0) {
                if (adev->pm.dpm_enabled) {