diff options
author | Ming Qian <ming.qian@nxp.com> | 2022-05-11 09:11:22 +0800 |
---|---|---|
committer | Mirela Rabulea <mirela.rabulea@oss.nxp.com> | 2022-05-11 12:12:17 +0300 |
commit | 035b6b6507d747577b7039ff11f50021e65fc0d1 (patch) | |
tree | 8439ec3803fb6d5d7f81e73cd23cfc9cfe39722a /drivers/media/platform | |
parent | fa0384dc997dad3573f40e3ed9986bae28a8d849 (diff) |
LF-5926: media: imx-jpeg: Add soft reset after frame done
if don't soft reset the codec for each frame,
there may be two problems:
1. the decoder may hang
2. the decoded picture may be incorrect
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Reviewed-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/imx-jpeg/mxc-jpeg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/imx-jpeg/mxc-jpeg.c index 109d0b49b4d0..8710e6875f1f 100644 --- a/drivers/media/platform/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/imx-jpeg/mxc-jpeg.c @@ -330,6 +330,10 @@ static unsigned int debug; module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "Debug level (0-3)"); +static unsigned int sw_reset = 1; +module_param(sw_reset, int, 0644); +MODULE_PARM_DESC(sw_reset, "SW reset every frame (0=no reset, 1=do reset)"); + static void mxc_jpeg_bytesperline(struct mxc_jpeg_q_data *q, u32 precision); static void mxc_jpeg_sizeimage(struct mxc_jpeg_q_data *q); @@ -665,6 +669,8 @@ buffers_done: v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx); v4l2_m2m_buf_done(src_buf, buf_state); v4l2_m2m_buf_done(dst_buf, buf_state); + if (sw_reset) + mxc_jpeg_sw_reset(reg); spin_unlock(&jpeg->hw_lock); v4l2_m2m_job_finish(jpeg->m2m_dev, ctx->fh.m2m_ctx); return IRQ_HANDLED; |