aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMansur Alisha Shaik <mansur@codeaurora.org>2021-08-25 10:44:34 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-10-08 11:26:13 +0200
commit8c404ebae527515ea5274d03e23976b55fdb26fc (patch)
tree4100067609388979d7b75e80d4fbb4c773f077a7
parent799926a123cfe6fcb38979c45b3609c0aea61b84 (diff)
media: venus: vdec: update output buffer size during vdec_s_fmt()
Video driver maintains an internal context for the output buffer size. During S_fmt() on capture plane, the output buffer size is not updated in driver context. As a result, during buf_prepare(), the size of the vb2_plane and internal size of the buffer, as maintained by the driver, does not match. This leads to buf_prepare() failure. Update the instance context for the output buffer size during s_fmt(). Signed-off-by: Mansur Alisha Shaik <mansur@codeaurora.org> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/platform/qcom/venus/vdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 198e47eb63f4..c129b061a325 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -332,8 +332,11 @@ static int vdec_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
inst->fmt_out = fmt;
- else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
+ else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
inst->fmt_cap = fmt;
+ inst->output2_buf_size =
+ venus_helper_get_framesz(pixfmt_cap, orig_pixmp.width, orig_pixmp.height);
+ }
return 0;
}

Privacy Policy