Merge tag 'amd-drm-next-5.19-2022-04-15' of https://gitlab.freedesktop.org/agd5f...
[linux-block.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_vm_sdma.c
index 69fba68ff88ea1f408e4a97df90c21293df7b34d..1fd3cbca20a2907f1aaf985ce8a5e8fa56a22ee3 100644 (file)
@@ -204,14 +204,19 @@ static int amdgpu_vm_sdma_update(struct amdgpu_vm_update_params *p,
        struct amdgpu_bo *bo = &vmbo->bo;
        enum amdgpu_ib_pool_type pool = p->immediate ? AMDGPU_IB_POOL_IMMEDIATE
                : AMDGPU_IB_POOL_DELAYED;
+       struct dma_resv_iter cursor;
        unsigned int i, ndw, nptes;
+       struct dma_fence *fence;
        uint64_t *pte;
        int r;
 
        /* Wait for PD/PT moves to be completed */
-       r = amdgpu_sync_fence(&p->job->sync, bo->tbo.moving);
-       if (r)
-               return r;
+       dma_resv_for_each_fence(&cursor, bo->tbo.base.resv,
+                               DMA_RESV_USAGE_KERNEL, fence) {
+               r = amdgpu_sync_fence(&p->job->sync, fence);
+               if (r)
+                       return r;
+       }
 
        do {
                ndw = p->num_dw_left;