Skip to content

Commit 52a36e7

Browse files
committed
drm/xe: allow non-contig VRAM kernel BO
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: Satyanarayana K V P <satyanarayana.k.v.p@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com> Link: https://lore.kernel.org/r/20250403102440.266113-15-matthew.auld@intel.com
1 parent 8e8e9c2 commit 52a36e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,18 @@ static void try_add_system(struct xe_device *xe, struct xe_bo *bo,
191191

192192
static bool force_contiguous(u32 bo_flags)
193193
{
194+
if (bo_flags & XE_BO_FLAG_STOLEN)
195+
return true; /* users expect this */
196+
else if (bo_flags & XE_BO_FLAG_PINNED &&
197+
!(bo_flags & XE_BO_FLAG_PINNED_LATE_RESTORE))
198+
return true; /* needs vmap */
199+
194200
/*
195201
* For eviction / restore on suspend / resume objects pinned in VRAM
196202
* must be contiguous, also only contiguous BOs support xe_bo_vmap.
197203
*/
198-
return bo_flags & (XE_BO_FLAG_PINNED | XE_BO_FLAG_GGTT);
204+
return bo_flags & XE_BO_FLAG_NEEDS_CPU_ACCESS &&
205+
bo_flags & XE_BO_FLAG_PINNED;
199206
}
200207

201208
static void add_vram(struct xe_device *xe, struct xe_bo *bo,

0 commit comments

Comments
 (0)