]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/pagemap: Drop source_peer_migrates flag and assume true
authorMatthew Brost <matthew.brost@intel.com>
Fri, 10 Apr 2026 20:59:26 +0000 (13:59 -0700)
committerMatthew Brost <matthew.brost@intel.com>
Mon, 13 Apr 2026 03:51:11 +0000 (20:51 -0700)
All current users of DRM pagemap set source_peer_migrates to true during
migration, and it is unclear whether any user would ever want to disable
this for performance reasons or for features such as compression. It is
also questionable whether this flag could be made to work with
high-speed fabric mapping APIs.

Drop the flag and make DRM pagemap unconditionally assume that
source_peer_migrates is true.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Francois Dugast <francois.dugast@intel.com>
Link: https://patch.msgid.link/20260410205929.3914474-3-matthew.brost@intel.com
drivers/gpu/drm/drm_pagemap.c
drivers/gpu/drm/xe/xe_svm.c
include/drm/drm_pagemap.h

index 5002049e0198120ff95114aa0caa2cb69484071f..63f32cf6e1a7d6a14274ea65750f300acfef265d 100644 (file)
@@ -651,12 +651,10 @@ int drm_pagemap_migrate_to_devmem(struct drm_pagemap_devmem *devmem_allocation,
                                own_pages++;
                                goto next;
                        }
-                       if (mdetails->source_peer_migrates) {
-                               cur.dpagemap = src_zdd->dpagemap;
-                               cur.ops = src_zdd->devmem_allocation->ops;
-                               cur.device = cur.dpagemap->drm->dev;
-                               pages[i] = src_page;
-                       }
+                       cur.dpagemap = src_zdd->dpagemap;
+                       cur.ops = src_zdd->devmem_allocation->ops;
+                       cur.device = cur.dpagemap->drm->dev;
+                       pages[i] = src_page;
                }
                if (!pages[i]) {
                        cur.dpagemap = NULL;
index 5933b2b6392b1a493f710950fbef7e8c6c8e020f..b54587b77b2fd24fcbe8091a27a151834ee3f50c 100644 (file)
@@ -1055,7 +1055,6 @@ static int xe_drm_pagemap_populate_mm(struct drm_pagemap *dpagemap,
        struct xe_pagemap *xpagemap = container_of(dpagemap, typeof(*xpagemap), dpagemap);
        struct drm_pagemap_migrate_details mdetails = {
                .timeslice_ms = timeslice_ms,
-               .source_peer_migrates = 1,
        };
        struct xe_vram_region *vr = xe_pagemap_to_vr(xpagemap);
        struct dma_fence *pre_migrate_fence = NULL;
index 75e6ca58922d56b3a93bad265c86c22cc22acd2f..95eb4b66b0577fdbaeca76c236ece39d68b74f48 100644 (file)
@@ -329,17 +329,12 @@ struct drm_pagemap_devmem {
  * struct drm_pagemap_migrate_details - Details to govern migration.
  * @timeslice_ms: The time requested for the migrated pagemap pages to
  * be present in @mm before being allowed to be migrated back.
- * @can_migrate_same_pagemap: Whether the copy function as indicated by
- * the @source_peer_migrates flag, can migrate device pages within a
- * single drm_pagemap.
- * @source_peer_migrates: Whether on p2p migration, The source drm_pagemap
- * should use the copy_to_ram() callback rather than the destination
- * drm_pagemap should use the copy_to_devmem() callback.
+ * @can_migrate_same_pagemap: Whether the copy function can migrate
+ * device pages within a single drm_pagemap.
  */
 struct drm_pagemap_migrate_details {
        unsigned long timeslice_ms;
        u32 can_migrate_same_pagemap : 1;
-       u32 source_peer_migrates : 1;
 };
 
 #if IS_ENABLED(CONFIG_ZONE_DEVICE)