diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2017-11-07 22:13:43 +0300 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2017-11-11 13:22:46 +0300 |
commit | d68920120d712136cc1538e5f4f8e119f2d4f43a (patch) | |
tree | 89f483cf4f2cc66b594ef5ebcfaf6bba29508ad8 /drivers/gpu/drm | |
parent | 8d25ccebef55b8fc47b674f24ccdccbef08e2f32 (diff) | |
download | linux-d68920120d712136cc1538e5f4f8e119f2d4f43a.tar.xz |
drm/cma-helper: Add drm_gem_cma_print_info()
Add drm_gem_cma_print_info() for debugfs printing
struct drm_gem_cma_object specific info.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171107191348.17555-8-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_gem_cma_helper.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c index 020e7668dfab..29f7b0fd3ad4 100644 --- a/drivers/gpu/drm/drm_gem_cma_helper.c +++ b/drivers/gpu/drm/drm_gem_cma_helper.c @@ -424,6 +424,25 @@ EXPORT_SYMBOL_GPL(drm_gem_cma_describe); #endif /** + * drm_gem_cma_print_info() - Print &drm_gem_cma_object info for debugfs + * @p: DRM printer + * @indent: Tab indentation level + * @gem: GEM object + * + * This function can be used as the &drm_driver->gem_print_info callback. + * It prints paddr and vaddr for use in e.g. debugfs output. + */ +void drm_gem_cma_print_info(struct drm_printer *p, unsigned int indent, + const struct drm_gem_object *obj) +{ + const struct drm_gem_cma_object *cma_obj = to_drm_gem_cma_obj(obj); + + drm_printf_indent(p, indent, "paddr=%pad\n", &cma_obj->paddr); + drm_printf_indent(p, indent, "vaddr=%p\n", cma_obj->vaddr); +} +EXPORT_SYMBOL(drm_gem_cma_print_info); + +/** * drm_gem_cma_prime_get_sg_table - provide a scatter/gather table of pinned * pages for a CMA GEM object * @obj: GEM object |