intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	himal.prasad.ghimiray@intel.com,
	"Matthew Brost" <matthew.brost@intel.com>,
	"Matthew Auld" <matthew.auld@intel.com>
Subject: [PATCH 4/5] drm/xe/migrate: Allow xe_migrate_vram() also on non-pagefault capable devices
Date: Mon, 17 Mar 2025 11:41:31 +0100	[thread overview]
Message-ID: <20250317104132.8200-5-thomas.hellstrom@linux.intel.com> (raw)
In-Reply-To: <20250317104132.8200-1-thomas.hellstrom@linux.intel.com>

The drm_pagemap functionality does not depend on the device having
recoverable pagefaults available. So allow xe_migrate_vram() also for
such devices. Even if this will have little use in practice, it's
beneficial for testin multi-device SVM, since a memory provider could
be a non-pagefault capable gpu.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/xe/xe_migrate.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index d364c9f458e7..f17234533504 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -1609,6 +1609,7 @@ static struct dma_fence *xe_migrate_vram(struct xe_migrate *m,
 {
 	struct xe_gt *gt = m->tile->primary_gt;
 	struct xe_device *xe = gt_to_xe(gt);
+	bool use_usm_batch = xe->info.has_usm;
 	struct dma_fence *fence = NULL;
 	u32 batch_size = 2;
 	u64 src_L0_ofs, dst_L0_ofs;
@@ -1625,7 +1626,7 @@ static struct dma_fence *xe_migrate_vram(struct xe_migrate *m,
 	batch_size += pte_update_cmd_size(round_update_size);
 	batch_size += EMIT_COPY_DW;
 
-	bb = xe_bb_new(gt, batch_size, true);
+	bb = xe_bb_new(gt, batch_size, use_usm_batch);
 	if (IS_ERR(bb)) {
 		err = PTR_ERR(bb);
 		return ERR_PTR(err);
@@ -1650,7 +1651,7 @@ static struct dma_fence *xe_migrate_vram(struct xe_migrate *m,
 		  XE_PAGE_SIZE);
 
 	job = xe_bb_create_migration_job(m->q, bb,
-					 xe_migrate_batch_base(m, true),
+					 xe_migrate_batch_base(m, use_usm_batch),
 					 update_idx);
 	if (IS_ERR(job)) {
 		err = PTR_ERR(job);
-- 
2.48.1


  parent reply	other threads:[~2025-03-17 10:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 10:41 [PATCH 0/5] drm/xe: xe-only patches from the multi-device GPUSVM series Thomas Hellström
2025-03-17 10:41 ` [PATCH 1/5] drm/xe: Introduce CONFIG_DRM_XE_GPUSVM Thomas Hellström
2025-03-20 21:24   ` Matthew Brost
2025-03-17 10:41 ` [PATCH 2/5] drm/xe/svm: Fix a potential bo UAF Thomas Hellström
2025-03-20 21:25   ` Matthew Brost
2025-03-17 10:41 ` [PATCH 3/5] drm/xe/bo: Add a bo remove callback Thomas Hellström
2025-03-17 15:58   ` Matthew Auld
2025-03-17 16:16     ` Thomas Hellström
2025-03-17 16:50       ` Matthew Auld
2025-03-17 17:07         ` Thomas Hellström
2025-03-17 17:35           ` Matthew Auld
2025-03-17 10:41 ` Thomas Hellström [this message]
2025-03-20 21:26   ` [PATCH 4/5] drm/xe/migrate: Allow xe_migrate_vram() also on non-pagefault capable devices Matthew Brost
2025-03-17 10:41 ` [PATCH 5/5] drm/xe/uapi, drm/xe: Make the PT code handle placement per PTE rather than per vma / range Thomas Hellström
2025-03-17 15:19 ` ✗ CI.Patch_applied: failure for drm/xe: xe-only patches from the multi-device GPUSVM series Patchwork
2025-03-19 10:50 ` ✓ CI.Patch_applied: success for drm/xe: xe-only patches from the multi-device GPUSVM series (rev2) Patchwork
2025-03-19 10:50 ` ✗ CI.checkpatch: warning " Patchwork
2025-03-19 10:51 ` ✓ CI.KUnit: success " Patchwork
2025-03-19 11:08 ` ✓ CI.Build: " Patchwork
2025-03-19 11:10 ` ✗ CI.Hooks: failure " Patchwork
2025-03-19 11:11 ` ✓ CI.checksparse: success " Patchwork
2025-03-19 11:32 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-03-19 12:30 ` ✗ Xe.CI.Full: " 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=20250317104132.8200-5-thomas.hellstrom@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).