Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/igt_drm_fdinfo: Handle amdgpu memory stats
@ 2024-05-03 12:37 Tvrtko Ursulin
  2024-05-03 12:40 ` Tvrtko Ursulin
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Tvrtko Ursulin @ 2024-05-03 12:37 UTC (permalink / raw)
  To: igt-dev
  Cc: Tvrtko Ursulin, Alex Deucher, Christian König, Rob Clark,
	Lucas De Marchi

From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>

Code so far only handles the clients using the common DRM helper.

Handle the amdgpu driver which uses a slightly different set of keys. More
specifically, outputs drm-memory-<region> instead of drm-total-<region>.

With this added gputop starts showing total memory usage for amdgpu.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.keonig@amd.com>
Cc: Rob Clark <robdclark@chromium.org>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/igt_drm_fdinfo.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/igt_drm_fdinfo.c b/lib/igt_drm_fdinfo.c
index cab677df29a9..89992f1477ec 100644
--- a/lib/igt_drm_fdinfo.c
+++ b/lib/igt_drm_fdinfo.c
@@ -262,6 +262,10 @@ __igt_parse_drm_fdinfo(int dir, const char *fd, struct drm_client_fdinfo *info,
 			idx = parse_region(l, info, strlen("drm-total-"),
 					   region_map, region_entries, &val);
 			UPDATE_REGION(idx, total, val);
+		} else if (!strncmp(l, "drm-memory-", 11)) {
+			idx = parse_region(l, info, strlen("drm-memory-"),
+					   region_map, region_entries, &val);
+			UPDATE_REGION(idx, total, val);
 		} else if (!strncmp(l, "drm-shared-", 11)) {
 			idx = parse_region(l, info, strlen("drm-shared-"),
 					   region_map, region_entries, &val);
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-05-04  3:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-03 12:37 [PATCH i-g-t] lib/igt_drm_fdinfo: Handle amdgpu memory stats Tvrtko Ursulin
2024-05-03 12:40 ` Tvrtko Ursulin
2024-05-03 13:32 ` Lucas De Marchi
2024-05-03 13:53   ` Tvrtko Ursulin
2024-05-03 13:59     ` Lucas De Marchi
2024-05-03 15:54 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-05-03 16:29 ` ✓ CI.xeBAT: " Patchwork
2024-05-03 19:14 ` ✗ CI.xeFULL: failure " Patchwork
2024-05-04  3:00 ` ✗ Fi.CI.IGT: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox