summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/arc
diff options
context:
space:
mode:
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>2017-03-03 15:30:35 +0300
committerAlexey Brodkin <abrodkin@synopsys.com>2017-08-03 00:11:00 +0300
commit13eee7706549333d7d73638e99a264b085df852f (patch)
tree8edfed855fe25393147a7885df7babe14db6f8ca /drivers/gpu/drm/arc
parentdd24df657075fdf1e850612ea50634816f3c3581 (diff)
downloadlinux-13eee7706549333d7d73638e99a264b085df852f.tar.xz
drm/arcpgu: Opt in debugfs
This change adopts debugfs usage for outputting useful data. As of today we print: * Mode and real HW clock values * Standard FB info Code is heavily borrowed from ARM's HDLCD thus adding Liviu in Cc. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: David Airlie <airlied@linux.ie> Cc: Jose Abreu <joabreu@synopsys.com>
Diffstat (limited to 'drivers/gpu/drm/arc')
-rw-r--r--drivers/gpu/drm/arc/arcpgu_drv.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index 3e43a5d4fb09..b43ddf00b50e 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -160,6 +160,32 @@ static int arcpgu_unload(struct drm_device *drm)
return 0;
}
+#ifdef CONFIG_DEBUG_FS
+static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
+{
+ struct drm_info_node *node = (struct drm_info_node *)m->private;
+ struct drm_device *drm = node->minor->dev;
+ struct arcpgu_drm_private *arcpgu = drm->dev_private;
+ unsigned long clkrate = clk_get_rate(arcpgu->clk);
+ unsigned long mode_clock = arcpgu->crtc.mode.crtc_clock * 1000;
+
+ seq_printf(m, "hw : %lu\n", clkrate);
+ seq_printf(m, "mode: %lu\n", mode_clock);
+ return 0;
+}
+
+static struct drm_info_list arcpgu_debugfs_list[] = {
+ { "clocks", arcpgu_show_pxlclock, 0 },
+ { "fb", drm_fb_cma_debugfs_show, 0 },
+};
+
+static int arcpgu_debugfs_init(struct drm_minor *minor)
+{
+ return drm_debugfs_create_files(arcpgu_debugfs_list,
+ ARRAY_SIZE(arcpgu_debugfs_list), minor->debugfs_root, minor);
+}
+#endif
+
static struct drm_driver arcpgu_drm_driver = {
.driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME |
DRIVER_ATOMIC,
@@ -185,6 +211,9 @@ static struct drm_driver arcpgu_drm_driver = {
.gem_prime_vmap = drm_gem_cma_prime_vmap,
.gem_prime_vunmap = drm_gem_cma_prime_vunmap,
.gem_prime_mmap = drm_gem_cma_prime_mmap,
+#ifdef CONFIG_DEBUG_FS
+ .debugfs_init = arcpgu_debugfs_init,
+#endif
};
static int arcpgu_probe(struct platform_device *pdev)