[PATCH 1/3] drm/amdkfd: don't validate pinned BOs
Lang Yu
Lang.Yu at amd.com
Tue Jun 7 09:59:45 UTC 2022
If a BO is pinned to VRAM and you try to validate it into GTT,
you will get an error.
Suggested-by: Christian König <christian.koenig at amd.com>
Signed-off-by: Lang Yu <Lang.Yu at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index abf2fc421323..81bcffb510f4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -346,6 +346,9 @@ static int amdgpu_amdkfd_bo_validate(struct amdgpu_bo *bo, uint32_t domain,
struct ttm_operation_ctx ctx = { false, false };
int ret;
+ if (bo->tbo.pin_count)
+ return 0;
+
if (WARN(amdgpu_ttm_tt_get_usermm(bo->tbo.ttm),
"Called with userptr BO"))
return -EINVAL;
--
2.25.1
More information about the amd-gfx
mailing list