]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/pagemap: Rename drm_pagemap_device_addr to drm_pagemap_addr
authorFrancois Dugast <francois.dugast@intel.com>
Tue, 5 Aug 2025 13:59:02 +0000 (15:59 +0200)
committerFrancois Dugast <francois.dugast@intel.com>
Wed, 6 Aug 2025 11:34:32 +0000 (13:34 +0200)
Rename this struct to the more generic name drm_pagemap_addr so it can be
used in a broader context, such as DMA mappings of CPU memory.

Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://lore.kernel.org/r/20250805140028.599361-2-francois.dugast@intel.com
Signed-off-by: Francois Dugast <francois.dugast@intel.com>
drivers/gpu/drm/drm_gpusvm.c
drivers/gpu/drm/xe/xe_res_cursor.h
drivers/gpu/drm/xe/xe_svm.c
drivers/gpu/drm/xe/xe_svm.h
include/drm/drm_gpusvm.h
include/drm/drm_pagemap.h

index 5bb4c77db2c3ccf636f244a359a725b86d297fa8..661306da6b2d954fc9134c19c728282ba9852047 100644 (file)
@@ -1048,7 +1048,7 @@ static void __drm_gpusvm_range_unmap_pages(struct drm_gpusvm *gpusvm,
                };
 
                for (i = 0, j = 0; i < npages; j++) {
-                       struct drm_pagemap_device_addr *addr = &range->dma_addr[j];
+                       struct drm_pagemap_addr *addr = &range->dma_addr[j];
 
                        if (addr->proto == DRM_INTERCONNECT_SYSTEM)
                                dma_unmap_page(dev,
@@ -1400,7 +1400,7 @@ map_pages:
                                goto err_unmap;
                        }
 
-                       range->dma_addr[j] = drm_pagemap_device_addr_encode
+                       range->dma_addr[j] = drm_pagemap_addr_encode
                                (addr, DRM_INTERCONNECT_SYSTEM, order,
                                 DMA_BIDIRECTIONAL);
                }
index d1a403cfb628456ebe272da5cf9327e5e7e25275..4e00008b70817679f146a7749f7841087209c5fb 100644 (file)
@@ -55,8 +55,8 @@ struct xe_res_cursor {
        u32 mem_type;
        /** @sgl: Scatterlist for cursor */
        struct scatterlist *sgl;
-       /** @dma_addr: Current element in a struct drm_pagemap_device_addr array */
-       const struct drm_pagemap_device_addr *dma_addr;
+       /** @dma_addr: Current element in a struct drm_pagemap_addr array */
+       const struct drm_pagemap_addr *dma_addr;
        /** @mm: Buddy allocator for VRAM cursor */
        struct drm_buddy *mm;
        /**
@@ -170,7 +170,7 @@ static inline void __xe_res_sg_next(struct xe_res_cursor *cur)
  */
 static inline void __xe_res_dma_next(struct xe_res_cursor *cur)
 {
-       const struct drm_pagemap_device_addr *addr = cur->dma_addr;
+       const struct drm_pagemap_addr *addr = cur->dma_addr;
        u64 start = cur->start;
 
        while (start >= cur->dma_seg_size) {
@@ -222,14 +222,14 @@ static inline void xe_res_first_sg(const struct sg_table *sg,
 /**
  * xe_res_first_dma - initialize a xe_res_cursor with dma_addr array
  *
- * @dma_addr: struct drm_pagemap_device_addr array to walk
+ * @dma_addr: struct drm_pagemap_addr array to walk
  * @start: Start of the range
  * @size: Size of the range
  * @cur: cursor object to initialize
  *
  * Start walking over the range of allocations between @start and @size.
  */
-static inline void xe_res_first_dma(const struct drm_pagemap_device_addr *dma_addr,
+static inline void xe_res_first_dma(const struct drm_pagemap_addr *dma_addr,
                                    u64 start, u64 size,
                                    struct xe_res_cursor *cur)
 {
index 10c8a1bcb86e88e29cf06ddc0b9432e77e7ddbf6..3e4f4a8760eed5acf82566f01fdfac8168e0c184 100644 (file)
@@ -1014,7 +1014,7 @@ int xe_svm_alloc_vram(struct xe_tile *tile, struct xe_svm_range *range,
                                       ctx->timeslice_ms);
 }
 
-static struct drm_pagemap_device_addr
+static struct drm_pagemap_addr
 xe_drm_pagemap_device_map(struct drm_pagemap *dpagemap,
                          struct device *dev,
                          struct page *page,
@@ -1033,7 +1033,7 @@ xe_drm_pagemap_device_map(struct drm_pagemap *dpagemap,
                prot = 0;
        }
 
-       return drm_pagemap_device_addr_encode(addr, prot, order, dir);
+       return drm_pagemap_addr_encode(addr, prot, order, dir);
 }
 
 static const struct drm_pagemap_ops xe_drm_pagemap_ops = {
index da9a69ea0bb1313460e6951b59a141fafd02f939..4bdccb56d25f5c6c059505ec84fe0fc4853ba905 100644 (file)
@@ -163,7 +163,7 @@ void xe_svm_flush(struct xe_vm *vm);
 #else
 #include <linux/interval_tree.h>
 
-struct drm_pagemap_device_addr;
+struct drm_pagemap_addr;
 struct drm_gpusvm_ctx;
 struct drm_gpusvm_range;
 struct xe_bo;
@@ -178,7 +178,7 @@ struct xe_vram_region;
 struct xe_svm_range {
        struct {
                struct interval_tree_node itree;
-               const struct drm_pagemap_device_addr *dma_addr;
+               const struct drm_pagemap_addr *dma_addr;
        } base;
        u32 tile_present;
        u32 tile_invalidated;
index 4aedc5423aff1347da6191a7d86a41f8f15d3d94..8d613e9b2690ec13be4e1561ca4308ac964bb295 100644 (file)
@@ -17,7 +17,7 @@ struct drm_gpusvm_notifier;
 struct drm_gpusvm_ops;
 struct drm_gpusvm_range;
 struct drm_pagemap;
-struct drm_pagemap_device_addr;
+struct drm_pagemap_addr;
 
 /**
  * struct drm_gpusvm_ops - Operations structure for GPU SVM
@@ -154,7 +154,7 @@ struct drm_gpusvm_range {
        struct interval_tree_node itree;
        struct list_head entry;
        unsigned long notifier_seq;
-       struct drm_pagemap_device_addr *dma_addr;
+       struct drm_pagemap_addr *dma_addr;
        struct drm_pagemap *dpagemap;
        struct drm_gpusvm_range_flags flags;
 };
index e5f20a1235be6dacb2ecaf6065885bd0eb62e29d..69d6ee49a3def6064a9ab92de4111bfdeefd10d8 100644 (file)
@@ -23,7 +23,7 @@ enum drm_interconnect_protocol {
 };
 
 /**
- * struct drm_pagemap_device_addr - Device address representation.
+ * struct drm_pagemap_addr - Address representation.
  * @addr: The dma address or driver-defined address for driver private interconnects.
  * @proto: The interconnect protocol.
  * @order: The page order of the device mapping. (Size is PAGE_SIZE << order).
@@ -32,7 +32,7 @@ enum drm_interconnect_protocol {
  * Note: There is room for improvement here. We should be able to pack into
  * 64 bits.
  */
-struct drm_pagemap_device_addr {
+struct drm_pagemap_addr {
        dma_addr_t addr;
        u64 proto : 54;
        u64 order : 8;
@@ -40,21 +40,21 @@ struct drm_pagemap_device_addr {
 };
 
 /**
- * drm_pagemap_device_addr_encode() - Encode a dma address with metadata
+ * drm_pagemap_addr_encode() - Encode a dma address with metadata
  * @addr: The dma address or driver-defined address for driver private interconnects.
  * @proto: The interconnect protocol.
  * @order: The page order of the dma mapping. (Size is PAGE_SIZE << order).
  * @dir: The DMA direction.
  *
- * Return: A struct drm_pagemap_device_addr encoding the above information.
+ * Return: A struct drm_pagemap_addr encoding the above information.
  */
-static inline struct drm_pagemap_device_addr
-drm_pagemap_device_addr_encode(dma_addr_t addr,
-                              enum drm_interconnect_protocol proto,
-                              unsigned int order,
-                              enum dma_data_direction dir)
+static inline struct drm_pagemap_addr
+drm_pagemap_addr_encode(dma_addr_t addr,
+                       enum drm_interconnect_protocol proto,
+                       unsigned int order,
+                       enum dma_data_direction dir)
 {
-       return (struct drm_pagemap_device_addr) {
+       return (struct drm_pagemap_addr) {
                .addr = addr,
                .proto = proto,
                .order = order,
@@ -75,11 +75,11 @@ struct drm_pagemap_ops {
         * @order: The page order of the device mapping. (Size is PAGE_SIZE << order).
         * @dir: The transfer direction.
         */
-       struct drm_pagemap_device_addr (*device_map)(struct drm_pagemap *dpagemap,
-                                                    struct device *dev,
-                                                    struct page *page,
-                                                    unsigned int order,
-                                                    enum dma_data_direction dir);
+       struct drm_pagemap_addr (*device_map)(struct drm_pagemap *dpagemap,
+                                             struct device *dev,
+                                             struct page *page,
+                                             unsigned int order,
+                                             enum dma_data_direction dir);
 
        /**
         * @device_unmap: Unmap a device address previously obtained using @device_map.
@@ -90,7 +90,7 @@ struct drm_pagemap_ops {
         */
        void (*device_unmap)(struct drm_pagemap *dpagemap,
                             struct device *dev,
-                            struct drm_pagemap_device_addr addr);
+                            struct drm_pagemap_addr addr);
 
        /**
         * @populate_mm: Populate part of the mm with @dpagemap memory,