summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorPrike Liang <Prike.Liang@amd.com>2026-05-26 16:42:14 +0800
committerAlex Deucher <alexander.deucher@amd.com>2026-06-03 13:49:29 -0400
commit113fa3ca614a865776f81759bb245dabf99859a7 (patch)
treee653a5e35ba3cc6d890303d49f77916a64abd048 /drivers/gpu
parentc04b0430a9b9291ac2ad23a46cd6216c7ef8964f (diff)
downloadlinux-next-113fa3ca614a865776f81759bb245dabf99859a7.tar.gz
linux-next-113fa3ca614a865776f81759bb245dabf99859a7.zip
drm/amdgpu: reserve TTM move fences slot for rearming eviction fences
The eviction rearming does not cover possible TTM move fences. If TTM moves the BO and consumes move fence slots, the later eviction fence add can hit the dma_resv_add_fence() BUG. Signed-off-by: Prike Liang <Prike.Liang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index 1120f8225ac0..212c14d99f6b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -249,7 +249,7 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj,
drm_exec_init(&exec, DRM_EXEC_IGNORE_DUPLICATES, 0);
drm_exec_until_all_locked(&exec) {
- r = drm_exec_prepare_obj(&exec, &abo->tbo.base, 1);
+ r = drm_exec_prepare_obj(&exec, &abo->tbo.base, TTM_NUM_MOVE_FENCES + 1);
drm_exec_retry_on_contention(&exec);
if (unlikely(r))
goto out_unlock;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
index 5438d5fde878..e07d936b8f8d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
@@ -975,7 +975,7 @@ retry_lock:
if (unlikely(ret))
goto unlock_all;
- ret = amdgpu_vm_lock_individual(vm, &exec, 1);
+ ret = amdgpu_vm_lock_individual(vm, &exec, TTM_NUM_MOVE_FENCES + 1);
drm_exec_retry_on_contention(&exec);
if (unlikely(ret))
goto unlock_all;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 4558a5663c66..96da18e5b138 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -484,7 +484,7 @@ int amdgpu_vm_lock_individual(struct amdgpu_vm *vm, struct drm_exec *exec,
amdgpu_bo_ref(bo);
spin_unlock(&vm->individual_lock);
- ret = drm_exec_prepare_obj(exec, &bo->tbo.base, 1);
+ ret = drm_exec_prepare_obj(exec, &bo->tbo.base, num_fences);
amdgpu_bo_unref(&bo);
if (unlikely(ret))
return ret;