drm/xe: Update xe_ttm_access_memory to use GPU for non-visible access
authorMatthew Brost <matthew.brost@intel.com>
Wed, 23 Apr 2025 17:17:23 +0000 (10:17 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Thu, 24 Apr 2025 22:51:39 +0000 (15:51 -0700)
commit270172f64b114451876c1b68912653e72ab99f38
tree43dd5677b34dac1933d529a8357b2ec7d7034894
parentc4a2e5f865b7230a9565c57c54b375b1d2ce82f5
drm/xe: Update xe_ttm_access_memory to use GPU for non-visible access

Add migrate layer functions to access VRAM and update
xe_ttm_access_memory to use for non-visible access and large (more than
16k) BO access. 8G devcoreump on BMG observed 3 minute CPU copy time vs.
3s GPU copy time.

v4:
 - Fix non-page aligned accesses
 - Add support for small / unaligned access
 - Update commit message indicating migrate used for large accesses (Auld)
 - Fix warning in xe_res_cursor for non-zero offset
v5:
 - Fix 32 bit build (CI)
v6:
 - Rebase and use SVM migration copy functions
v7:
 - Fix build error (CI)
v8:
 - Remove ifdef around VRAM copy functions (CI)
 - Use break statement in dma unmmaping (Jonathan)
 - Use if/else rather than goto (Jonathan)
 - Use single return point (Jonathan)

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://lore.kernel.org/r/20250423171725.597955-3-matthew.brost@intel.com
drivers/gpu/drm/xe/xe_bo.c
drivers/gpu/drm/xe/xe_migrate.c
drivers/gpu/drm/xe/xe_migrate.h