All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdkfd: don't validate pinned BOs
@ 2022-06-07  9:59 Lang Yu
  2022-06-07  9:59 ` [PATCH 2/3] drm/amdkfd: simplify PD and PT BOs validation Lang Yu
  2022-06-07  9:59 ` [PATCH 3/3] drm/amdkfd: use existing VM helper for PD and PT validation in SVM Lang Yu
  0 siblings, 2 replies; 6+ messages in thread
From: Lang Yu @ 2022-06-07  9:59 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Felix Kuehling, Huang Rui, Lang Yu,
	Christian Koenig

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@amd.com>
Signed-off-by: Lang Yu <Lang.Yu@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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-08 13:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-07  9:59 [PATCH 1/3] drm/amdkfd: don't validate pinned BOs Lang Yu
2022-06-07  9:59 ` [PATCH 2/3] drm/amdkfd: simplify PD and PT BOs validation Lang Yu
2022-06-07  9:59 ` [PATCH 3/3] drm/amdkfd: use existing VM helper for PD and PT validation in SVM Lang Yu
2022-06-07 17:02   ` Felix Kuehling
2022-06-08  2:21     ` Lang Yu
2022-06-08 13:40       ` Felix Kuehling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.