aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Skrabec2022-11-02 19:08:02 +0100
committerPaul Kocialkowski2024-08-08 11:58:46 +0200
commit5c2a95b4902456a7473cc9fb8a43e27c0133469a (patch)
treeb9a74906794de0f6b8e89bda18a6c4389e85b3e7
parent502465251a0ae0cef3b39f12fa01c3febe0b8382 (diff)
media: cedrus: use helper to set default formats
Now that set output format helper is available, let's use that for setting default values. Advantage of this is that values will be always valid. Current code produced invalid default values for V3s SoC, which doesn't support MPEG2 decoding. Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/staging/media/sunxi/cedrus/cedrus.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c b/drivers/staging/media/sunxi/cedrus/cedrus.c
index d2419319afd7..28fd668c7ea7 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -361,16 +361,8 @@ static int cedrus_open(struct file *file)
ret = PTR_ERR(ctx->fh.m2m_ctx);
goto err_ctrls;
}
- ctx->dst_fmt.pixelformat = V4L2_PIX_FMT_NV12_32L32;
- cedrus_prepare_format(&ctx->dst_fmt);
- ctx->src_fmt.pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
- /*
- * TILED_NV12 has more strict requirements, so copy the width and
- * height to src_fmt to ensure that is matches the dst_fmt resolution.
- */
- ctx->src_fmt.width = ctx->dst_fmt.width;
- ctx->src_fmt.height = ctx->dst_fmt.height;
- cedrus_prepare_format(&ctx->src_fmt);
+
+ cedrus_reset_out_format(ctx);
v4l2_fh_add(&ctx->fh);