Skip to content

Commit 8c404eb

Browse files
Mansur Alisha Shaikmchehab
authored andcommitted
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 <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 799926a commit 8c404eb

File tree

1 file changed

+4
-1
lines changed
  • drivers/media/platform/qcom/venus

1 file changed

+4
-1
lines changed

drivers/media/platform/qcom/venus/vdec.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,11 @@ static int vdec_s_fmt(struct file *file, void *fh, struct v4l2_format *f)
332332

333333
if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
334334
inst->fmt_out = fmt;
335-
else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
335+
else if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
336336
inst->fmt_cap = fmt;
337+
inst->output2_buf_size =
338+
venus_helper_get_framesz(pixfmt_cap, orig_pixmp.width, orig_pixmp.height);
339+
}
337340

338341
return 0;
339342
}

0 commit comments

Comments
 (0)