diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2023-02-01 01:36:39 +0300 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-20 02:27:48 +0300 |
commit | 77775e24e684c761d44ba2f804581c0c42e0ad38 (patch) | |
tree | f99e45d1a1db81252bc395ed454221216115bff6 /drivers/gpu/drm/xe/xe_ggtt.c | |
parent | 50a48cca608102a53a0961bd95aefb53a8ced3ab (diff) | |
download | linux-77775e24e684c761d44ba2f804581c0c42e0ad38.tar.xz |
drm/xe: Add debugfs for dumping GGTT mappings
Adding a debugfs dump of GGTT was useful for some debugging I did,
and easy to add. Might be useful for others too.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_ggtt.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_ggtt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c index 20450ed8400b..907a603572b2 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -345,3 +345,16 @@ void xe_ggtt_remove_bo(struct xe_ggtt *ggtt, struct xe_bo *bo) xe_ggtt_remove_node(ggtt, &bo->ggtt_node); } + +int xe_ggtt_dump(struct xe_ggtt *ggtt, struct drm_printer *p) +{ + int err; + + err = mutex_lock_interruptible(&ggtt->lock); + if (err) + return err; + + drm_mm_print(&ggtt->mm, p); + mutex_unlock(&ggtt->lock); + return err; +} |