Commit 3e50b1d6 authored by Arvind Yadav's avatar Arvind Yadav Committed by Alex Deucher
Browse files

drm/amdgpu: only keep most recent fence for each context



Keep only the latest fences to reduce the number of values
given back to userspace

v2: - Export this code from dma-fence-unwrap.c(by Christian).
v3: - To split this in a dma_buf patch and amd userq patch(by Sunil).
    - No need to add a new function just re-use existing(by Christian).
v4: Export dma_fence_dedub_array function and used it(by Christian).

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Reviewed-by: default avatarSunil Khatri <sunil.khatri@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarArvind Yadav <Arvind.Yadav@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 68071eb0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -852,6 +852,12 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
			fences[num_fences++] = fence;
		}

		/*
		 * Keep only the latest fences to reduce the number of values
		 * given back to userspace.
		 */
		num_fences = dma_fence_dedup_array(fences, num_fences);

		waitq = idr_find(&userq_mgr->userq_idr, wait_info->waitq_id);
		if (!waitq)
			goto free_fences;