]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/amdgpu: Wire up MMIO_REMAP placement and User-visible strings
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Wed, 20 Aug 2025 10:47:52 +0000 (16:17 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 9 Sep 2025 20:18:34 +0000 (16:18 -0400)
Wire up the conversions and strings for the new MMIO_REMAP placement:

* amdgpu_mem_type_to_domain() maps AMDGPU_PL_MMIO_REMAP -> domain
* amdgpu_bo_placement_from_domain() accepts the new domain
* amdgpu_bo_mem_stats_placement() and amdgpu_bo_print_info() report it
* res cursor supports the new placement
* fdinfo prints "mmioremap" for the new placement

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h

index 91d638098889d61c2460b3cb2e16ff440fe5beaf..b349bb3676d5f0a7200a3a15281ba95c103cdd4a 100644 (file)
@@ -70,6 +70,7 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
                [AMDGPU_PL_GWS] = "gws",
                [AMDGPU_PL_OA] = "oa",
                [AMDGPU_PL_DOORBELL] = "doorbell",
+               [AMDGPU_PL_MMIO_REMAP] = "mmioremap",
        };
        unsigned int hw_ip, i;
 
index 122a882948839464dc197d40ff8e46cf161f7b42..fe486988a738447e7154608b582c4cd2b4f90e82 100644 (file)
@@ -153,6 +153,14 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain)
                c++;
        }
 
+       if (domain & AMDGPU_GEM_DOMAIN_MMIO_REMAP) {
+               places[c].fpfn = 0;
+               places[c].lpfn = 0;
+               places[c].mem_type = AMDGPU_PL_MMIO_REMAP;
+               places[c].flags = 0;
+               c++;
+       }
+
        if (domain & AMDGPU_GEM_DOMAIN_GTT) {
                places[c].fpfn = 0;
                places[c].lpfn = 0;
@@ -1545,6 +1553,8 @@ uint32_t amdgpu_bo_mem_stats_placement(struct amdgpu_bo *bo)
                return AMDGPU_PL_OA;
        case AMDGPU_GEM_DOMAIN_DOORBELL:
                return AMDGPU_PL_DOORBELL;
+       case AMDGPU_GEM_DOMAIN_MMIO_REMAP:
+               return AMDGPU_PL_MMIO_REMAP;
        default:
                return TTM_PL_SYSTEM;
        }
@@ -1628,6 +1638,9 @@ u64 amdgpu_bo_print_info(int id, struct amdgpu_bo *bo, struct seq_file *m)
                        case AMDGPU_PL_DOORBELL:
                                placement = "DOORBELL";
                                break;
+                       case AMDGPU_PL_MMIO_REMAP:
+                               placement = "MMIO REMAP";
+                               break;
                        case TTM_PL_SYSTEM:
                        default:
                                placement = "CPU";
index 87523fcd438639b55cfd26076f6564b859fdcabd..656b8a931dae85136d863a23d8590e319442d1f2 100644 (file)
@@ -167,6 +167,8 @@ static inline unsigned amdgpu_mem_type_to_domain(u32 mem_type)
                return AMDGPU_GEM_DOMAIN_OA;
        case AMDGPU_PL_DOORBELL:
                return AMDGPU_GEM_DOMAIN_DOORBELL;
+       case AMDGPU_PL_MMIO_REMAP:
+               return AMDGPU_GEM_DOMAIN_MMIO_REMAP;
        default:
                break;
        }
index 50fcd86e1033b87af2d699317118000624ae72c0..be2e56ce1355ecb31f9a1e62a2135402b5841e5d 100644 (file)
@@ -91,6 +91,7 @@ static inline void amdgpu_res_first(struct ttm_resource *res,
                break;
        case TTM_PL_TT:
        case AMDGPU_PL_DOORBELL:
+       case AMDGPU_PL_MMIO_REMAP:
                node = to_ttm_range_mgr_node(res)->mm_nodes;
                while (start >= node->size << PAGE_SHIFT)
                        start -= node++->size << PAGE_SHIFT;
@@ -153,6 +154,7 @@ static inline void amdgpu_res_next(struct amdgpu_res_cursor *cur, uint64_t size)
                break;
        case TTM_PL_TT:
        case AMDGPU_PL_DOORBELL:
+       case AMDGPU_PL_MMIO_REMAP:
                node = cur->node;
 
                cur->node = ++node;