]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/amdgpu: remove the check for sessions being closed
authorLeo Liu <leo.liu@amd.com>
Wed, 3 Aug 2016 13:25:59 +0000 (09:25 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 8 Aug 2016 15:33:12 +0000 (11:33 -0400)
This will make clock and power gated when no block decoded, for example
when paused during the playback.

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

index c22b64ec4ec145bc9be7f416e3227882cd0c6ac9..bf59354d788a2d3c99ef2b6c7ccfdd84426ea55f 100644 (file)
@@ -1089,15 +1089,9 @@ static void amdgpu_uvd_idle_work_handler(struct work_struct *work)
 {
        struct amdgpu_device *adev =
                container_of(work, struct amdgpu_device, uvd.idle_work.work);
-       unsigned i, fences, handles = 0;
+       unsigned fences = amdgpu_fence_count_emitted(&adev->uvd.ring);
 
-       fences = amdgpu_fence_count_emitted(&adev->uvd.ring);
-
-       for (i = 0; i < adev->uvd.max_handles; ++i)
-               if (atomic_read(&adev->uvd.handles[i]))
-                       ++handles;
-
-       if (fences == 0 && handles == 0) {
+       if (fences == 0) {
                if (adev->pm.dpm_enabled) {
                        amdgpu_dpm_enable_uvd(adev, false);
                } else {