diff options
author | Dave Airlie <airlied@redhat.com> | 2013-02-21 09:31:47 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-02-21 09:31:47 +1000 |
commit | ca18e1426bb2db987b67030256477c9571aebd09 (patch) | |
tree | 72e7cbe5f00f90390d00f5d3d4c9bdec79e48bbe /drivers/gpu/drm/drm_fb_cma_helper.c | |
parent | 74e1697478ffdee0e12e48db024a9b3677fd8cee (diff) | |
parent | 0d4bbaf9f3e5b9f52150ddc5a4ee8b0ab83a440b (diff) | |
download | blackbird-op-linux-ca18e1426bb2db987b67030256477c9571aebd09.tar.gz blackbird-op-linux-ca18e1426bb2db987b67030256477c9571aebd09.zip |
Merge branch 'tilcdc-next' of git://people.freedesktop.org/~robclark/linux into drm-next
KMS driver for TI LCD controller
* 'tilcdc-next' of git://people.freedesktop.org/~robclark/linux:
drm/tilcdc: add support for LCD panels (v5)
drm/tilcdc: add encoder slave (v2)
drm/i2c: nxp-tda998x (v3)
drm/tilcdc: add TI LCD Controller DRM driver (v4)
drm/nouveau: use i2c encoder helper wrappers
drm: i2c encoder helper wrappers
drm/cma: add debugfs helpers
drm: small fix in drm_send_vblank_event()
drm: Don't set the plane->fb to NULL on successfull set_plane
drm/cma-helper: fixup compilation
Conflicts:
drivers/gpu/drm/Kconfig
drivers/gpu/drm/Makefile
drivers/gpu/drm/drm_fb_cma_helper.c
Diffstat (limited to 'drivers/gpu/drm/drm_fb_cma_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_fb_cma_helper.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index 1c8549dae99a..0b5af7d0edb1 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -180,6 +180,59 @@ struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, } EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_obj); +#ifdef CONFIG_DEBUG_FS +/** + * drm_fb_cma_describe() - Helper to dump information about a single + * CMA framebuffer object + */ +void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m) +{ + struct drm_fb_cma *fb_cma = to_fb_cma(fb); + int i, n = drm_format_num_planes(fb->pixel_format); + + seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height, + (char *)&fb->pixel_format); + + for (i = 0; i < n; i++) { + seq_printf(m, " %d: offset=%d pitch=%d, obj: ", + i, fb->offsets[i], fb->pitches[i]); + drm_gem_cma_describe(fb_cma->obj[i], m); + } +} +EXPORT_SYMBOL_GPL(drm_fb_cma_describe); + +/** + * drm_fb_cma_debugfs_show() - Helper to list CMA framebuffer objects + * in debugfs. + */ +int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg) +{ + struct drm_info_node *node = (struct drm_info_node *) m->private; + struct drm_device *dev = node->minor->dev; + struct drm_framebuffer *fb; + int ret; + + ret = mutex_lock_interruptible(&dev->mode_config.mutex); + if (ret) + return ret; + + ret = mutex_lock_interruptible(&dev->struct_mutex); + if (ret) { + mutex_unlock(&dev->mode_config.mutex); + return ret; + } + + list_for_each_entry(fb, &dev->mode_config.fb_list, head) + drm_fb_cma_describe(fb, m); + + mutex_unlock(&dev->struct_mutex); + mutex_unlock(&dev->mode_config.mutex); + + return 0; +} +EXPORT_SYMBOL_GPL(drm_fb_cma_debugfs_show); +#endif + static struct fb_ops drm_fbdev_cma_ops = { .owner = THIS_MODULE, .fb_fillrect = sys_fillrect, |