From a1e210185b518c3894a5b0a6ab95796aabb33429 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Tue, 25 Apr 2017 13:00:47 -0400 Subject: [PATCH 1289/4131] Change fence references to dma_fence Required now that we're based on drm-next [4.11] Change-Id: I43d3ac96525d231fb2771c964969c787bc091449 Conflicts: drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c drivers/gpu/drm/amd/include/kgd_kfd_interface.h --- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 12 ++++++------ drivers/gpu/drm/amd/amdkfd/kfd_device.c | 14 +++++++------- drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c index 6a41746..97a8070 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c @@ -1765,7 +1765,7 @@ static int kfd_ioctl_cross_memory_copy(struct file *filep, struct task_struct *remote_task; struct mm_struct *remote_mm; struct pid *remote_pid; - struct fence *fence = NULL, *lfence = NULL; + struct dma_fence *fence = NULL, *lfence = NULL; uint64_t dst_va_addr; uint64_t copied, total_copied = 0; uint64_t src_offset, dst_offset; @@ -1931,7 +1931,7 @@ static int kfd_ioctl_cross_memory_copy(struct file *filep, /* Later fence available. Release old fence */ if (fence && lfence) { - fence_put(lfence); + dma_fence_put(lfence); lfence = NULL; } @@ -1971,14 +1971,14 @@ static int kfd_ioctl_cross_memory_copy(struct file *filep, /* Wait for the last fence irrespective of error condition */ if (fence) { - if (fence_wait_timeout(fence, false, msecs_to_jiffies(1000)) + if (dma_fence_wait_timeout(fence, false, msecs_to_jiffies(1000)) < 0) pr_err("Cross mem copy failed. BO timed out\n"); - fence_put(fence); + dma_fence_put(fence); } else if (lfence) { pr_debug("GPU copy fail. But wait for prev DMA to finish\n"); - fence_wait_timeout(lfence, true, msecs_to_jiffies(1000)); - fence_put(lfence); + dma_fence_wait_timeout(lfence, true, msecs_to_jiffies(1000)); + dma_fence_put(lfence); } kfd_process_fail: diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 45a234d..43ccf18 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "kfd_priv.h" #include "kfd_device_queue_manager.h" #include "kfd_pm4_headers_vi.h" @@ -905,7 +905,7 @@ void kfd_restore_bo_worker(struct work_struct *work) * */ int kgd2kfd_schedule_evict_and_restore_process(struct mm_struct *mm, - struct fence *fence) + struct dma_fence *fence) { struct kfd_process *p; unsigned long active_time; @@ -914,7 +914,7 @@ int kgd2kfd_schedule_evict_and_restore_process(struct mm_struct *mm, if (!fence) return -EINVAL; - if (fence_is_signaled(fence)) + if (dma_fence_is_signaled(fence)) return 0; p = kfd_lookup_process_by_mm(mm); @@ -931,11 +931,11 @@ int kgd2kfd_schedule_evict_and_restore_process(struct mm_struct *mm, else { WARN(1, "Starting new evict with previous evict is not completed\n"); if (cancel_delayed_work_sync(&p->eviction_work.dwork)) - fence_put(p->eviction_work.quiesce_fence); + dma_fence_put(p->eviction_work.quiesce_fence); } } - p->eviction_work.quiesce_fence = fence_get(fence); + p->eviction_work.quiesce_fence = dma_fence_get(fence); /* Avoid KFD process starvation. Wait for at least * PROCESS_ACTIVE_TIME_MS before evicting the process again @@ -982,13 +982,13 @@ void kfd_evict_bo_worker(struct work_struct *work) pr_info("Started evicting process of pasid %d\n", p->pasid); ret = quiesce_process_mm(p); if (!ret) { - fence_signal(eviction_work->quiesce_fence); + dma_fence_signal(eviction_work->quiesce_fence); schedule_delayed_work(&p->restore_work, PROCESS_RESTORE_TIME_MS); } else pr_err("Failed to quiesce user queues. Cannot evict BOs\n"); - fence_put(eviction_work->quiesce_fence); + dma_fence_put(eviction_work->quiesce_fence); pr_info("Finished evicting process of pasid %d\n", p->pasid); diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index fc5ba66..5174a2a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -588,7 +588,7 @@ struct qcm_process_device { /* KFD Memory Eviction */ struct kfd_eviction_work { struct delayed_work dwork; - struct fence *quiesce_fence; + struct dma_fence *quiesce_fence; }; /* Approx. wait time before attempting to restore evicted BOs */ @@ -601,7 +601,7 @@ struct kfd_eviction_work { void kfd_evict_bo_worker(struct work_struct *work); void kfd_restore_bo_worker(struct work_struct *work); int kgd2kfd_schedule_evict_and_restore_process(struct mm_struct *mm, - struct fence *fence); + struct dma_fence *fence); /* 8 byte handle containing GPU ID in the most significant 4 bytes and -- 2.7.4