Skip to content

Commit af4a25b

Browse files
committed
drm/vmwgfx: Add debugfs entries for various ttm resource managers
Use the newly added TTM's ability to automatically create debugfs entries for specified placements. This creates debugfs files that can be read to get information about various TTM resource managers which are used by vmwgfx. Signed-off-by: Zack Rusin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Christian König <[email protected]>
1 parent 8cd9efd commit af4a25b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

+18
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,23 @@ static void vmw_remove(struct pci_dev *pdev)
13851385
vmw_driver_unload(dev);
13861386
}
13871387

1388+
static void vmw_debugfs_resource_managers_init(struct vmw_private *vmw)
1389+
{
1390+
struct drm_minor *minor = vmw->drm.primary;
1391+
struct dentry *root = minor->debugfs_root;
1392+
1393+
ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, TTM_PL_SYSTEM),
1394+
root, "system_ttm");
1395+
ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, TTM_PL_VRAM),
1396+
root, "vram_ttm");
1397+
ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_GMR),
1398+
root, "gmr_ttm");
1399+
ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_MOB),
1400+
root, "mob_ttm");
1401+
ttm_resource_manager_create_debugfs(ttm_manager_type(&vmw->bdev, VMW_PL_SYSTEM),
1402+
root, "system_mob_ttm");
1403+
}
1404+
13881405
static unsigned long
13891406
vmw_get_unmapped_area(struct file *file, unsigned long uaddr,
13901407
unsigned long len, unsigned long pgoff,
@@ -1632,6 +1649,7 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
16321649
goto out_unload;
16331650

16341651
vmw_debugfs_gem_init(vmw);
1652+
vmw_debugfs_resource_managers_init(vmw);
16351653

16361654
return 0;
16371655
out_unload:

0 commit comments

Comments
 (0)