aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2720-drm-amdgpu-KFD-Restore-process-Optimize-waiting.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2720-drm-amdgpu-KFD-Restore-process-Optimize-waiting.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2720-drm-amdgpu-KFD-Restore-process-Optimize-waiting.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2720-drm-amdgpu-KFD-Restore-process-Optimize-waiting.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2720-drm-amdgpu-KFD-Restore-process-Optimize-waiting.patch
new file mode 100644
index 00000000..c44a438b
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2720-drm-amdgpu-KFD-Restore-process-Optimize-waiting.patch
@@ -0,0 +1,58 @@
+From d2932cc15c0d8cd8f712e960b2aaf374453a1e9d Mon Sep 17 00:00:00 2001
+From: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
+Date: Wed, 28 Feb 2018 11:50:10 -0500
+Subject: [PATCH 2720/2940] drm/amdgpu: KFD Restore process: Optimize waiting
+
+Instead of waiting for each KFD BO after validation just wait for the
+last BO moving fence.
+
+Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
+Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+index bc185511ee89..190b92f81153 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+@@ -2075,7 +2075,12 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
+ pr_debug("Memory eviction: Validate BOs failed. Try again\n");
+ goto validate_map_fail;
+ }
+-
++ ret = amdgpu_sync_fence(amdgpu_ttm_adev(bo->tbo.bdev),
++ &sync_obj, bo->tbo.moving, false);
++ if (ret) {
++ pr_debug("Memory eviction: Sync BO fence failed. Try again\n");
++ goto validate_map_fail;
++ }
+ list_for_each_entry(bo_va_entry, &mem->bo_va_list,
+ bo_list) {
+ ret = update_gpuvm_pte((struct amdgpu_device *)
+@@ -2096,6 +2101,7 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
+ goto validate_map_fail;
+ }
+
++ /* Wait for validate and PT updates to finish */
+ amdgpu_sync_wait(&sync_obj, false);
+
+ /* Release old eviction fence and create new one, because fence only
+@@ -2114,10 +2120,7 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
+ process_info->eviction_fence = new_fence;
+ *ef = dma_fence_get(&new_fence->base);
+
+- /* Wait for validate to finish and attach new eviction fence */
+- list_for_each_entry(mem, &process_info->kfd_bo_list,
+- validate_list.head)
+- ttm_bo_wait(&mem->bo->tbo, false, false);
++ /* Attach new eviction fence to all BOs */
+ list_for_each_entry(mem, &process_info->kfd_bo_list,
+ validate_list.head)
+ amdgpu_bo_fence(mem->bo,
+--
+2.17.1
+