]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/xe: use backup object for pinned save/restore
authorMatthew Auld <matthew.auld@intel.com>
Thu, 3 Apr 2025 10:24:42 +0000 (11:24 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Fri, 4 Apr 2025 10:41:00 +0000 (11:41 +0100)
commit86f69c26113c3b35967f29db052d40a10317cac0
tree2ab911e7d4756cab61903e1603d109dc3c674bf0
parent7654d51f1fd80f2d985a98beac4cd62d20afe3f9
drm/xe: use backup object for pinned save/restore

Currently we move pinned objects, relying on the fact that the lpfn/fpfn
will force the placement to occupy the same pages when restoring.
However this then limits all such pinned objects to be contig
underneath. In addition it is likely a little fragile moving pinned
objects in the first place. Rather than moving such objects rather copy
the page contents to a secondary system memory object, that way the VRAM
pages never move and remain pinned. This also opens the door for
eventually having non-contig pinned objects that can also be
saved/restored using blitter.

v2:
 - Make sure to drop the fence ref.
 - Handle NULL bo->migrate.
v3:
 - Ensure we add the copy fence to the BOs, otherwise backup_obj can
   be freed before pipelined copy finishes.
v4:
  - Rebase on newly added apply-to-pinned infra.

Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1182
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-10-matthew.auld@intel.com
drivers/gpu/drm/xe/xe_bo.c
drivers/gpu/drm/xe/xe_bo_evict.c
drivers/gpu/drm/xe/xe_bo_types.h