Commit 930ca2a7 authored by Christian König's avatar Christian König
Browse files

drm/amdgpu: use the new iterator in amdgpu_sync_resv

parent 1d51775c
Loading
Loading
Loading
Loading
+14 −30
Original line number Diff line number Diff line
@@ -252,16 +252,14 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync,
		     struct dma_resv *resv, enum amdgpu_sync_mode mode,
		     void *owner)
{
	struct dma_resv_list *flist;
	struct dma_resv_iter cursor;
	struct dma_fence *f;
	unsigned i;
	int r = 0;
	int r;

	if (resv == NULL)
		return -EINVAL;

	/* always sync to the exclusive fence */
	f = dma_resv_excl_fence(resv);
	dma_resv_for_each_fence(&cursor, resv, true, f) {
		dma_fence_chain_for_each(f, f) {
			struct dma_fence_chain *chain = to_dma_fence_chain(f);

@@ -274,20 +272,6 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync,
				break;
			}
		}

	flist = dma_resv_shared_list(resv);
	if (!flist)
		return 0;

	for (i = 0; i < flist->shared_count; ++i) {
		f = rcu_dereference_protected(flist->shared[i],
					      dma_resv_held(resv));

		if (amdgpu_sync_test_fence(adev, mode, owner, f)) {
			r = amdgpu_sync_fence(sync, f);
			if (r)
				return r;
		}
	}
	return 0;
}