mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
drm/rockchip: add mm dump debugfs
shell# cat /sys/kernel/debug/dri/0/mm_dump 0x0000000000000000-0x00000000000a6000: 679936: free 0x00000000000a6000-0x0000000000970000:9216000: used 0x0000000000970000-0x000000000123a000:9216000: used 0x000000000123a000-0x0000000001b04000:9216000: used 0x0000000001b04000-0x00000000023ce000:9216000: used 0x00000000023ce000-0x0000000002c98000:9216000: used 0x0000000002c98000-0x0000000003562000:9216000: used 0x0000000003562000-0x0000000003e2c000:9216000: used 0x0000000003e2c000-0x0000000100000000: 4229775360: free total: 4294967296, used 64512000 free 4230455296 Change-Id: I39cb5b12a63418c050b3bd890829f831f898db4e Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This commit is contained in:
@@ -135,6 +135,23 @@ static void rockchip_iommu_cleanup(struct drm_device *drm_dev)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
static int rockchip_drm_mm_dump(struct seq_file *s, void *data)
|
||||
{
|
||||
struct drm_info_node *node = s->private;
|
||||
struct drm_minor *minor = node->minor;
|
||||
struct drm_device *drm_dev = minor->dev;
|
||||
struct rockchip_drm_private *priv = drm_dev->dev_private;
|
||||
struct drm_printer p = drm_seq_file_printer(s);
|
||||
|
||||
if (!priv->domain)
|
||||
return 0;
|
||||
mutex_lock(&priv->mm_lock);
|
||||
drm_mm_print(&priv->mm, &p);
|
||||
mutex_unlock(&priv->mm_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rockchip_drm_summary_show(struct seq_file *s, void *data)
|
||||
{
|
||||
struct drm_info_node *node = s->private;
|
||||
@@ -156,6 +173,7 @@ static int rockchip_drm_summary_show(struct seq_file *s, void *data)
|
||||
|
||||
static struct drm_info_list rockchip_debugfs_files[] = {
|
||||
{ "summary", rockchip_drm_summary_show, 0, NULL },
|
||||
{ "mm_dump", rockchip_drm_mm_dump, 0, NULL },
|
||||
};
|
||||
|
||||
static void rockchip_drm_debugfs_init(struct drm_minor *minor)
|
||||
|
||||
Reference in New Issue
Block a user