diff options
Diffstat (limited to 'drivers/media/platform/sti/hva/hva-v4l2.c')
-rw-r--r-- | drivers/media/platform/sti/hva/hva-v4l2.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/drivers/media/platform/sti/hva/hva-v4l2.c b/drivers/media/platform/sti/hva/hva-v4l2.c index 65e94b3e4f6b..052f2feebc86 100644 --- a/drivers/media/platform/sti/hva/hva-v4l2.c +++ b/drivers/media/platform/sti/hva/hva-v4l2.c @@ -15,8 +15,6 @@ #include "hva.h" #include "hva-hw.h" -#define HVA_NAME "st-hva" - #define MIN_FRAMES 1 #define MIN_STREAMS 1 @@ -813,6 +811,10 @@ static void hva_run_work(struct work_struct *work) /* protect instance against reentrancy */ mutex_lock(&ctx->lock); +#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS + hva_dbg_perf_begin(ctx); +#endif + src_buf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx); dst_buf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); @@ -834,6 +836,10 @@ static void hva_run_work(struct work_struct *work) ctx->encoded_frames++; +#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS + hva_dbg_perf_end(ctx, stream); +#endif + v4l2_m2m_buf_done(src_buf, VB2_BUF_STATE_DONE); v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_DONE); } @@ -1201,6 +1207,10 @@ static int hva_open(struct file *file) /* default parameters for frame and stream */ set_default_params(ctx); +#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS + hva_dbg_ctx_create(ctx); +#endif + dev_info(dev, "%s encoder instance created\n", ctx->name); return 0; @@ -1242,6 +1252,10 @@ static int hva_release(struct file *file) v4l2_fh_del(&ctx->fh); v4l2_fh_exit(&ctx->fh); +#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS + hva_dbg_ctx_remove(ctx); +#endif + dev_info(dev, "%s encoder instance released\n", ctx->name); kfree(ctx); @@ -1366,6 +1380,10 @@ static int hva_probe(struct platform_device *pdev) goto err_hw; } +#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS + hva_debugfs_create(hva); +#endif + hva->work_queue = create_workqueue(HVA_NAME); if (!hva->work_queue) { dev_err(dev, "%s %s failed to allocate work queue\n", @@ -1387,6 +1405,9 @@ static int hva_probe(struct platform_device *pdev) err_work_queue: destroy_workqueue(hva->work_queue); err_v4l2: +#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS + hva_debugfs_remove(hva); +#endif v4l2_device_unregister(&hva->v4l2_dev); err_hw: hva_hw_remove(hva); @@ -1405,6 +1426,10 @@ static int hva_remove(struct platform_device *pdev) hva_hw_remove(hva); +#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS + hva_debugfs_remove(hva); +#endif + v4l2_device_unregister(&hva->v4l2_dev); dev_info(dev, "%s %s removed\n", HVA_PREFIX, pdev->name); |