LKML Archive on
help / color / mirror / Atom feed
From: Mansur Alisha Shaik <>
Cc:,,,,, Mansur Alisha Shaik <>
Subject: [PATCH] venus: vdec: update output buffer size during vdec_s_fmt()
Date: Wed, 25 Aug 2021 14:14:34 +0530	[thread overview]
Message-ID: <> (raw)

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 <>
 drivers/media/platform/qcom/venus/vdec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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)
 		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;
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member 
of Code Aurora Forum, hosted by The Linux Foundation

             reply	other threads:[~2021-08-25  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  8:44 Mansur Alisha Shaik [this message]
2021-08-25 23:11 ` Nathan Hebert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] venus: vdec: update output buffer size during vdec_s_fmt()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).