summaryrefslogtreecommitdiff
path: root/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
diff options
context:
space:
mode:
authorFabien Dessenne <fabien.dessenne@st.com>2015-05-12 13:02:11 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-06-09 18:12:28 -0300
commit34b6beb65beb7f7726baa771661c671310445265 (patch)
tree1c419de647756c9de8cb07aaede3534bc46d7a2a /drivers/media/platform/sti/bdisp/bdisp-v4l2.c
parent28ffeebbb7bdc0dd7899286b63f3c359d43d0a1a (diff)
[media] bdisp: add debug file system
Creates 5 debugfs entries to dump the last HW request, the last HW node (=command), the HW registers and the recent HW performance (time & fps) Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/sti/bdisp/bdisp-v4l2.c')
-rw-r--r--drivers/media/platform/sti/bdisp/bdisp-v4l2.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
index 6e8fd2747e8a..89d7a2279bc6 100644
--- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
+++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c
@@ -336,6 +336,8 @@ static void bdisp_device_run(void *priv)
goto out;
}
+ bdisp_dbg_perf_begin(bdisp);
+
err = bdisp_hw_reset(bdisp);
if (err) {
dev_err(bdisp->dev, "could not get HW ready\n");
@@ -1075,6 +1077,8 @@ static irqreturn_t bdisp_irq_thread(int irq, void *priv)
spin_lock(&bdisp->slock);
+ bdisp_dbg_perf_end(bdisp);
+
cancel_delayed_work(&bdisp->timeout_work);
if (!test_and_clear_bit(ST_M2M_RUNNING, &bdisp->state))
@@ -1247,6 +1251,8 @@ static int bdisp_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
+ bdisp_debugfs_remove(bdisp);
+
v4l2_device_unregister(&bdisp->v4l2_dev);
if (!IS_ERR(bdisp->clock))
@@ -1328,12 +1334,19 @@ static int bdisp_probe(struct platform_device *pdev)
goto err_clk;
}
+ /* Debug */
+ ret = bdisp_debugfs_create(bdisp);
+ if (ret) {
+ dev_err(dev, "failed to create debugfs\n");
+ goto err_v4l2;
+ }
+
/* Power management */
pm_runtime_enable(dev);
ret = pm_runtime_get_sync(dev);
if (ret < 0) {
dev_err(dev, "failed to set PM\n");
- goto err_v4l2;
+ goto err_dbg;
}
/* Continuous memory allocator */
@@ -1370,6 +1383,8 @@ err_vb2_dma:
vb2_dma_contig_cleanup_ctx(bdisp->alloc_ctx);
err_pm:
pm_runtime_put(dev);
+err_dbg:
+ bdisp_debugfs_remove(bdisp);
err_v4l2:
v4l2_device_unregister(&bdisp->v4l2_dev);
err_clk: