drm/amdgpu: use dma_fence_chain_contained
authorChristian König <christian.koenig@amd.com>
Thu, 20 Jan 2022 11:05:40 +0000 (12:05 +0100)
committerChristian König <christian.koenig@amd.com>
Tue, 8 Feb 2022 08:25:40 +0000 (09:25 +0100)
Instead of manually extracting the fence.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220204100429.2049-7-christian.koenig@amd.com
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c

index f7d8487..40e0674 100644 (file)
@@ -261,10 +261,9 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync,
 
        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);
+                       struct dma_fence *tmp = dma_fence_chain_contained(f);
 
-                       if (amdgpu_sync_test_fence(adev, mode, owner, chain ?
-                                                  chain->fence : f)) {
+                       if (amdgpu_sync_test_fence(adev, mode, owner, tmp)) {
                                r = amdgpu_sync_fence(sync, f);
                                dma_fence_put(f);
                                if (r)