diff mbox series

[2/5] drm/vmwgfx: Add debugfs entries for various ttm resource managers

Message ID 20220407025652.146426-3-zack@kde.org (mailing list archive)
State New, archived
Headers show
Series drm/ttm: Introduce TTM res manager debugfs helpers | expand

Commit Message

Zack Rusin April 7, 2022, 2:56 a.m. UTC
From: Zack Rusin <zackr@vmware.com>

Use the newly added TTM's ability to automatically create debugfs entries
for specified placements. This creates entries in /sys/kernel/debug/ttm/
that can be read to get information about various TTM resource
managers which are used by vmwgfx.

Signed-off-by: Zack Rusin <zackr@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index decd54b8333d..59d0d1cd564b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1630,6 +1630,13 @@  static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct vmw_private *vmw;
 	int ret;
+	const char * const ttm_placement_names[] = {
+		[TTM_PL_SYSTEM] = "system_ttm",
+		[TTM_PL_VRAM] = "vram_ttm",
+		[VMW_PL_GMR] = "gmr_ttm",
+		[VMW_PL_MOB] = "mob_ttm",
+		[VMW_PL_SYSTEM] = "system_mob_ttm"
+	};
 
 	ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver);
 	if (ret)
@@ -1657,6 +1664,9 @@  static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto out_unload;
 
 	vmw_debugfs_gem_init(vmw);
+	ttm_resource_manager_debugfs_init(&vmw->bdev,
+					  ttm_placement_names,
+					  ARRAY_SIZE(ttm_placement_names));
 
 	return 0;
 out_unload: