All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH 4/6] drm/amdgpu: kmap PDs/PTs in amdgpu_vm_update_directories
Date: Thu, 17 May 2018 11:49:34 +0200	[thread overview]
Message-ID: <20180517094936.4293-4-christian.koenig@amd.com> (raw)
In-Reply-To: <20180517094936.4293-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>

In theory it is possible that PDs/PTs can move without eviction.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 4d88b060fbde..a31afac8e8e9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -242,13 +242,6 @@ int amdgpu_vm_validate_pt_bos(struct amdgpu_device *adev, struct amdgpu_vm *vm,
 			spin_unlock(&glob->lru_lock);
 		}
 
-		if (bo->tbo.type == ttm_bo_type_kernel &&
-		    vm->use_cpu_for_update) {
-			r = amdgpu_bo_kmap(bo, NULL);
-			if (r)
-				break;
-		}
-
 		if (bo->tbo.type != ttm_bo_type_kernel) {
 			spin_lock(&vm->moved_lock);
 			list_move(&bo_base->vm_status, &vm->moved);
@@ -940,6 +933,14 @@ int amdgpu_vm_update_directories(struct amdgpu_device *adev,
 	params.adev = adev;
 
 	if (vm->use_cpu_for_update) {
+		struct amdgpu_vm_bo_base *bo_base;
+
+		list_for_each_entry(bo_base, &vm->relocated, vm_status) {
+			r = amdgpu_bo_kmap(bo_base->bo, NULL);
+			if (unlikely(r))
+				return r;
+		}
+
 		r = amdgpu_vm_wait_pd(adev, vm, AMDGPU_FENCE_OWNER_VM);
 		if (unlikely(r))
 			return r;
-- 
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-05-17  9:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17  9:49 [PATCH 1/6] drm/amdgpu: rework VM state machine lock handling v2 Christian König
     [not found] ` <20180517094936.4293-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-05-17  9:49   ` [PATCH 2/6] drm/amdgpu: cleanup amdgpu_vm_validate_pt_bos v2 Christian König
2018-05-17  9:49   ` [PATCH 3/6] drm/amdgpu: further optimize amdgpu_vm_handle_moved Christian König
2018-05-17  9:49   ` Christian König [this message]
2018-05-17  9:49   ` [PATCH 5/6] drm/amdgpu: consistenly use VM moved flag Christian König
2018-05-17  9:49   ` [PATCH 6/6] drm/amdgpu: move VM BOs on LRU again Christian König
     [not found]     ` <20180517094936.4293-6-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-05-18  6:49       ` zhoucm1
2018-05-18  9:55   ` [PATCH 1/6] drm/amdgpu: rework VM state machine lock handling v2 Zhang, Jerry (Junwei)
     [not found]     ` <5AFEA313.8040905-5C7GfCeVMHo@public.gmane.org>
2018-05-19  8:00       ` Zhang, Jerry
     [not found]         ` <CY4PR12MB1414D3B8AE6ECEF5A9277A9AFF970-rpdhrqHFk04b0eJBKAp/BwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-05-22 13:07           ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180517094936.4293-4-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.