mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-07 16:17:41 -04:00
drm/xe: Pre-allocate system memory for pinned external bos in the pm notfier
Similarly to what we do for other pinned bos, pre-allocate system memory for pinned external bos in the pm notifier, where swapping is still possible. This hasn't been needed until now when we're about to allow pinning of exernal VRAM bos. Cc: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://lore.kernel.org/r/20250918092207.54472-3-thomas.hellstrom@linux.intel.com
This commit is contained in:
@@ -73,6 +73,11 @@ int xe_bo_notifier_prepare_all_pinned(struct xe_device *xe)
|
||||
&xe->pinned.late.kernel_bo_present,
|
||||
xe_bo_notifier_prepare_pinned);
|
||||
|
||||
if (!ret)
|
||||
ret = xe_bo_apply_to_pinned(xe, &xe->pinned.late.external,
|
||||
&xe->pinned.late.external,
|
||||
xe_bo_notifier_prepare_pinned);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -93,6 +98,10 @@ void xe_bo_notifier_unprepare_all_pinned(struct xe_device *xe)
|
||||
(void)xe_bo_apply_to_pinned(xe, &xe->pinned.late.kernel_bo_present,
|
||||
&xe->pinned.late.kernel_bo_present,
|
||||
xe_bo_notifier_unprepare_pinned);
|
||||
|
||||
(void)xe_bo_apply_to_pinned(xe, &xe->pinned.late.external,
|
||||
&xe->pinned.late.external,
|
||||
xe_bo_notifier_unprepare_pinned);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user