]> Git Repo - J-linux.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
Merge tag 'arm-defconfig-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[J-linux.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_sync.c
index f7d8487799b281cfd0bedc52c363fe7938a4eed5..504af1b93bfa84e728127b7e1ee6afc035fe4156 100644 (file)
@@ -51,7 +51,6 @@ static struct kmem_cache *amdgpu_sync_slab;
 void amdgpu_sync_create(struct amdgpu_sync *sync)
 {
        hash_init(sync->fences);
-       sync->last_vm_update = NULL;
 }
 
 /**
@@ -171,23 +170,6 @@ int amdgpu_sync_fence(struct amdgpu_sync *sync, struct dma_fence *f)
        return 0;
 }
 
-/**
- * amdgpu_sync_vm_fence - remember to sync to this VM fence
- *
- * @sync: sync object to add fence to
- * @fence: the VM fence to add
- *
- * Add the fence to the sync object and remember it as VM update.
- */
-int amdgpu_sync_vm_fence(struct amdgpu_sync *sync, struct dma_fence *fence)
-{
-       if (!fence)
-               return 0;
-
-       amdgpu_sync_keep_later(&sync->last_vm_update, fence);
-       return amdgpu_sync_fence(sync, fence);
-}
-
 /* Determine based on the owner and mode if we should sync to a fence or not */
 static bool amdgpu_sync_test_fence(struct amdgpu_device *adev,
                                   enum amdgpu_sync_mode mode,
@@ -259,12 +241,12 @@ int amdgpu_sync_resv(struct amdgpu_device *adev, struct amdgpu_sync *sync,
        if (resv == NULL)
                return -EINVAL;
 
-       dma_resv_for_each_fence(&cursor, resv, true, f) {
+       /* TODO: Use DMA_RESV_USAGE_READ here */
+       dma_resv_for_each_fence(&cursor, resv, DMA_RESV_USAGE_BOOKKEEP, 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)
@@ -377,9 +359,6 @@ int amdgpu_sync_clone(struct amdgpu_sync *source, struct amdgpu_sync *clone)
                }
        }
 
-       dma_fence_put(clone->last_vm_update);
-       clone->last_vm_update = dma_fence_get(source->last_vm_update);
-
        return 0;
 }
 
@@ -420,8 +399,6 @@ void amdgpu_sync_free(struct amdgpu_sync *sync)
                dma_fence_put(e->fence);
                kmem_cache_free(amdgpu_sync_slab, e);
        }
-
-       dma_fence_put(sync->last_vm_update);
 }
 
 /**
This page took 0.033051 seconds and 4 git commands to generate.