Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Subject: [Intel-xe] [CI 09/10] drm/xe: Use the evicted flag and RESV_PROTECTED vm.
Date: Mon,  9 Oct 2023 15:13:39 +0200	[thread overview]
Message-ID: <20231009131341.18355-9-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20231009131341.18355-1-thomas.hellstrom@linux.intel.com>

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/drm_gpuvm.c | 12 ++++++------
 drivers/gpu/drm/xe/xe_vm.c  |  5 +++--
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c
index c0d41ad236a5..2deeeb5d8577 100644
--- a/drivers/gpu/drm/drm_gpuvm.c
+++ b/drivers/gpu/drm/drm_gpuvm.c
@@ -1068,8 +1068,10 @@ drm_gpuvm_prepare_objects_locked(struct drm_gpuvm *gpuvm,
 		if (ret)
 			break;
 
-		if (vm_bo->evicted)
+		if (vm_bo->evicted) {
 			drm_gpuvm_bo_list_add(vm_bo, evict, false);
+			vm_bo->evicted = false;
+		}
 	}
 
 	return ret;
@@ -1626,11 +1628,9 @@ drm_gpuvm_bo_evict(struct drm_gpuvm_bo *vm_bo, bool evict)
 
 	dma_resv_assert_held(obj->resv);
 
-	if (drm_gpuvm_is_extobj(gpuvm, obj)) {
-		vm_bo->evicted = evict;
-
-		if (!lock)
-			return;
+	if (evict && !lock && drm_gpuvm_is_extobj(gpuvm, obj)) {
+		vm_bo->evicted = true;
+		return;
 	}
 
 	if (evict)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 3da97442d415..aba299216c55 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -1235,8 +1235,9 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags)
 		goto err_no_resv;
 	}
 
-	drm_gpuvm_init(&vm->gpuvm, vm_resv_obj, "Xe VM", 0, 0, vm->size,
-		       0, 0,
+	drm_gpuvm_init(&vm->gpuvm, vm_resv_obj, "Xe VM",
+		       DRM_GPUVM_RESV_PROTECTED,
+		       0, vm->size, 0, 0,
 		       &gpuvm_ops);
 
 	drm_gem_object_put(vm_resv_obj);
-- 
2.41.0


  parent reply	other threads:[~2023-10-09 13:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 13:13 [Intel-xe] [CI 01/10] drm/gpuvm: add common dma-resv per struct drm_gpuvm Thomas Hellström
2023-10-09 13:13 ` [Intel-xe] [CI 02/10] drm/xe: Adjust to "drm/gpuvm: add common dma-resv per struct drm_gpuvm" Thomas Hellström
2023-10-09 13:13 ` [Intel-xe] [CI 03/10] drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm Thomas Hellström
2023-10-09 13:13 ` [Intel-xe] [CI 04/10] drm/xe: Adjust to commit "drm/gpuvm: add drm_gpuvm_flags to drm_gpuvm" Thomas Hellström
2023-10-09 13:13 ` [Intel-xe] [CI 05/10] drm/gpuvm: add an abstraction for a VM / BO combination Thomas Hellström
2023-10-09 13:13 ` [Intel-xe] [CI 06/10] drm/xe: Adjust to commit "drm/gpuvm: add an abstraction for a VM/BO combination" Thomas Hellström
2023-10-09 13:13 ` [Intel-xe] [CI 07/10] drm/gpuvm: track/lock/validate external/evicted objects Thomas Hellström
2023-10-09 13:13 ` [Intel-xe] [CI 08/10] drm/xe: Adapt to GPUVM tracking of external / evicted objects Thomas Hellström
2023-10-09 13:13 ` Thomas Hellström [this message]
2023-10-09 13:13 ` [Intel-xe] [CI 10/10] drm/nouveau: make use of the GPUVM's shared dma-resv Thomas Hellström
2023-10-09 13:19 ` [Intel-xe] ✓ CI.Patch_applied: success for series starting with [CI,01/10] drm/gpuvm: add common dma-resv per struct drm_gpuvm Patchwork
2023-10-09 13:19 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-10-09 13:20 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-10-09 13:27 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-10-09 13:28 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-10-09 13:29 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-10-09 14:00 ` [Intel-xe] ✗ CI.BAT: failure " Patchwork

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=20231009131341.18355-9-thomas.hellstrom@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox