All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Auld <matthew.auld@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Matthew Brost" <matthew.brost@intel.com>
Subject: [PATCH 6/7] drm/xe: allow non-contig VRAM kernel BO
Date: Mon, 16 Dec 2024 16:29:47 +0000	[thread overview]
Message-ID: <20241216162941.86070-13-matthew.auld@intel.com> (raw)
In-Reply-To: <20241216162941.86070-8-matthew.auld@intel.com>

If the kernel bo doesn't care about vmap(), either directly or
indirectly with save/restore then we don't need to force contig for such
buffers.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_bo.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
index 3b98ddd2fbda..4990da7870eb 100644
--- a/drivers/gpu/drm/xe/xe_bo.c
+++ b/drivers/gpu/drm/xe/xe_bo.c
@@ -164,11 +164,17 @@ static void try_add_system(struct xe_device *xe, struct xe_bo *bo,
 
 static bool force_contiguous(u32 bo_flags)
 {
+	if (bo_flags & XE_BO_FLAG_STOLEN)
+		return true; /* users expect this */
+	else if (bo_flags & XE_BO_FLAG_PINNED_EARLY_RESTORE)
+		return true; /* needs vmap */
+
 	/*
 	 * For eviction / restore on suspend / resume objects pinned in VRAM
 	 * must be contiguous, also only contiguous BOs support xe_bo_vmap.
 	 */
-	return bo_flags & (XE_BO_FLAG_PINNED | XE_BO_FLAG_GGTT);
+	return bo_flags & XE_BO_FLAG_NEEDS_CPU_ACCESS &&
+	       bo_flags & XE_BO_FLAG_PINNED;
 }
 
 static void add_vram(struct xe_device *xe, struct xe_bo *bo,
-- 
2.47.1


  parent reply	other threads:[~2024-12-16 16:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 16:29 [PATCH 1/7] drm/xe: use backup object for pinned save/restore Matthew Auld
2024-12-16 16:29 ` [PATCH 2/7] drm/xe: split pinned save/restore into phases Matthew Auld
2024-12-16 16:29 ` [PATCH 3/7] drm/xe: Add XE_BO_FLAG_PINNED_NORESTORE Matthew Auld
2024-12-16 17:23   ` Rodrigo Vivi
2024-12-16 16:29 ` [PATCH 4/7] drm/xe: add XE_BO_FLAG_PINNED_EARLY_RESTORE Matthew Auld
2024-12-16 16:29 ` [PATCH 5/7] drm/xe: unconditionally apply PINNED for pin_map() Matthew Auld
2024-12-16 16:29 ` Matthew Auld [this message]
2024-12-16 16:29 ` [PATCH 7/7] drm/xe/sriov: support non-contig VRAM provisioning Matthew Auld
2024-12-16 16:38 ` ✓ CI.Patch_applied: success for series starting with [1/7] drm/xe: use backup object for pinned save/restore Patchwork
2024-12-16 16:39 ` ✗ CI.checkpatch: warning " Patchwork
2024-12-16 16:40 ` ✓ CI.KUnit: success " Patchwork
2024-12-16 16:58 ` ✓ CI.Build: " Patchwork
2024-12-16 17:00 ` ✗ CI.Hooks: failure " Patchwork
2024-12-16 17:02 ` ✓ CI.checksparse: success " Patchwork
2024-12-16 17:35 ` ✗ Xe.CI.BAT: failure " Patchwork
2024-12-16 18:56 ` [PATCH 1/7] " Matthew Auld
2024-12-16 18:59 ` ✗ Xe.CI.Full: failure for series starting with [1/7] " 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=20241216162941.86070-13-matthew.auld@intel.com \
    --to=matthew.auld@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=thomas.hellstrom@linux.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 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.