diff options
author | Rob Clark <robdclark@gmail.com> | 2012-12-10 10:46:43 -0600 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2013-02-17 17:55:42 -0500 |
commit | 6f646095ec2f5d38a6429dd896cb2d5cbbb776dc (patch) | |
tree | 41444767a379449c4e57f60dbee6d3bf2c670904 /drivers/gpu/drm/drm_gem_cma_helper.c | |
parent | 21a245d2d62ef617978316203af032d499805cd2 (diff) | |
download | talos-obmc-linux-6f646095ec2f5d38a6429dd896cb2d5cbbb776dc.tar.gz talos-obmc-linux-6f646095ec2f5d38a6429dd896cb2d5cbbb776dc.zip |
drm/cma: add debugfs helpers
Add helper to display fb's which can be used directly in drm_info_list:
static struct drm_info_list foo_debugfs_list[] = {
...
{ "fb", drm_fb_cma_debugfs_show, 0 },
};
to display information about CMA fb objects, as well as a
drm_gem_cma_describe() which can be used if the driver bothers to keep
a list of CMA GEM objects.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/drm_gem_cma_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_gem_cma_helper.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c index 1aa8fee1e865..0a7e011509bd 100644 --- a/drivers/gpu/drm/drm_gem_cma_helper.c +++ b/drivers/gpu/drm/drm_gem_cma_helper.c @@ -249,3 +249,24 @@ int drm_gem_cma_dumb_destroy(struct drm_file *file_priv, return drm_gem_handle_delete(file_priv, handle); } EXPORT_SYMBOL_GPL(drm_gem_cma_dumb_destroy); + +#ifdef CONFIG_DEBUG_FS +void drm_gem_cma_describe(struct drm_gem_cma_object *cma_obj, struct seq_file *m) +{ + struct drm_gem_object *obj = &cma_obj->base; + struct drm_device *dev = obj->dev; + uint64_t off = 0; + + WARN_ON(!mutex_is_locked(&dev->struct_mutex)); + + if (obj->map_list.map) + off = (uint64_t)obj->map_list.hash.key; + + seq_printf(m, "%2d (%2d) %08llx %08Zx %p %d", + obj->name, obj->refcount.refcount.counter, + off, cma_obj->paddr, cma_obj->vaddr, obj->size); + + seq_printf(m, "\n"); +} +EXPORT_SYMBOL_GPL(drm_gem_cma_describe); +#endif |