]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/migrate: support MEM_COPY instruction
authorMatthew Auld <matthew.auld@intel.com>
Wed, 22 Oct 2025 16:38:35 +0000 (17:38 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Thu, 23 Oct 2025 09:48:39 +0000 (10:48 +0100)
commit1e12dbae9d726b1e4ada1e5e101ccf6bb7a8c8aa
tree20e6d5dac1522e5a47a2e3b6e4c9a0105fc22c3d
parent0171dcce33fb0c5c26129d8334cd13e511b5522a
drm/xe/migrate: support MEM_COPY instruction

Make this the default on xe2+ when doing a copy. This has a few
advantages over the exiting copy instruction:

1) It has a special PAGE_COPY mode that claims to be optimised for
   page-in/page-out, which is the vast majority of current users.

2) It also has a simple BYTE_COPY mode that supports byte granularity
   copying without any restrictions.

With 2) we can now easily skip the bounce buffer flow when copying
buffers with strange sizing/alignment, like for memory_access. But that
is left for the next patch.

v2 (Matt Brost):
  - Use device info to check whether device should use the MEM_COPY
    path. This should fit better with making this a configfs tunable.
  - And with that also keep old path still functional on xe2 for possible
    experimentation.
  - Add a define for PAGE_COPY page-size.
v3 (Matt Brost):
  - Fallback to an actual linear copy for pitch=1.
  - Also update NVL.

BSpec: 57561
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20251022163836.191405-7-matthew.auld@intel.com
drivers/gpu/drm/xe/instructions/xe_gpu_commands.h
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_migrate.c
drivers/gpu/drm/xe/xe_pci.c
drivers/gpu/drm/xe/xe_pci_types.h