summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@collabora.com>2019-07-25 10:17:54 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-07-25 12:09:54 -0400
commit932a9317ac492d4b93227357db4e3e2af28f0fbb (patch)
tree37aab91fc4df3607a28f443f3a30dde0a88a1328 /drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
parentdeff5c37c88921e61a336f1c4eba1f7ad438cebe (diff)
downloadlinux-932a9317ac492d4b93227357db4e3e2af28f0fbb.tar.bz2
media: hantro: Add helpers to prepare/finish a run
And use them where appropriate. We might want to move hantro_{prepare,finish}_run() calls to device_run() and have a 2-step approach similar to cedrus (prepare + trigger) at some point, but let's keep that for later. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/staging/media/hantro/hantro_h1_jpeg_enc.c')
-rw-r--r--drivers/staging/media/hantro/hantro_h1_jpeg_enc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
index f5adb5cbde50..ecd34a7db190 100644
--- a/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
+++ b/drivers/staging/media/hantro/hantro_h1_jpeg_enc.c
@@ -87,6 +87,8 @@ void hantro_h1_jpeg_enc_run(struct hantro_ctx *ctx)
src_buf = hantro_get_src_buf(ctx);
dst_buf = hantro_get_dst_buf(ctx);
+ hantro_prepare_run(ctx);
+
memset(&jpeg_ctx, 0, sizeof(jpeg_ctx));
jpeg_ctx.buffer = vb2_plane_vaddr(&dst_buf->vb2_buf, 0);
jpeg_ctx.width = ctx->dst_fmt.width;
@@ -119,7 +121,8 @@ void hantro_h1_jpeg_enc_run(struct hantro_ctx *ctx)
| H1_REG_ENC_CTRL_ENC_MODE_JPEG
| H1_REG_ENC_PIC_INTRA
| H1_REG_ENC_CTRL_EN_BIT;
- /* Kick the watchdog and start encoding */
- schedule_delayed_work(&vpu->watchdog_work, msecs_to_jiffies(2000));
+
+ hantro_finish_run(ctx);
+
vepu_write(vpu, reg, H1_REG_ENC_CTRL);
}