]> Git Repo - linux.git/commitdiff
drm/amdgpu: Expose special on chip memory pools in fdinfo
authorTvrtko Ursulin <[email protected]>
Thu, 24 Oct 2024 09:23:41 +0000 (10:23 +0100)
committerAlex Deucher <[email protected]>
Mon, 4 Nov 2024 16:32:52 +0000 (11:32 -0500)
In the past these specialized on chip memory pools were reported as system
memory (aka 'cpu') which was not correct and misleading. That has since
been removed so lets make them visible as their own respective memory
regions.

Reviewed-by: Christian König <[email protected]>
Signed-off-by: Tvrtko Ursulin <[email protected]>
Cc: Christian König <[email protected]>
Cc: Yunxiang Li <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c

index 7a9573958d87ce1b66ec00c9daa5ebfeebfdf1ad..df2cf5c3392554c4fab051126426b6ad468ad466 100644 (file)
@@ -66,6 +66,10 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
                [TTM_PL_VRAM] = "vram",
                [TTM_PL_TT] = "gtt",
                [TTM_PL_SYSTEM] = "cpu",
+               [AMDGPU_PL_GDS] = "gds",
+               [AMDGPU_PL_GWS] = "gws",
+               [AMDGPU_PL_OA] = "oa",
+               [AMDGPU_PL_DOORBELL] = "doorbell",
        };
        unsigned int hw_ip, i;
        int ret;
@@ -87,12 +91,16 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
 
        drm_printf(p, "pasid:\t%u\n", fpriv->vm.pasid);
 
-       for (i = 0; i < TTM_PL_PRIV; i++)
+       for (i = 0; i < ARRAY_SIZE(pl_name); i++) {
+               if (!pl_name[i])
+                       continue;
+
                drm_print_memory_stats(p,
                                       &stats[i].drm,
                                       DRM_GEM_OBJECT_RESIDENT |
                                       DRM_GEM_OBJECT_PURGEABLE,
                                       pl_name[i]);
+       }
 
        /* Legacy amdgpu keys, alias to drm-resident-memory-: */
        drm_printf(p, "drm-memory-vram:\t%llu KiB\n",
This page took 0.056844 seconds and 4 git commands to generate.