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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zack Rusin <zackr@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

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:
-- 
2.32.0




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux