From: Alexandre Courbot <acourbot@chromium.org>
To: mgottam@codeaurora.org
Cc: Stanimir Varbanov <stanimir.varbanov@linaro.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-arm-msm@vger.kernel.org, vgarodia@codeaurora.org
Subject: Re: [PATCH v2] media: venus: amend buffer size for bitstream plane
Date: Mon, 26 Nov 2018 17:21:45 +0900 [thread overview]
Message-ID: <CAPBb6MWZ146=Ri12HyBRed4QUOGqDT4m90w2W5VwRhKW4ELCHA@mail.gmail.com> (raw)
In-Reply-To: <1542696783-23016-1-git-send-email-mgottam@codeaurora.org>
Hi Malathi,
On Tue, Nov 20, 2018 at 3:53 PM Malathi Gottam <mgottam@codeaurora.org> wrote:
>
> Accept the buffer size requested by client and compare it
> against driver calculated size and set the maximum to
> bitstream plane.
>
> Signed-off-by: Malathi Gottam <mgottam@codeaurora.org>
> ---
> drivers/media/platform/qcom/venus/venc.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index ce85962..ecfdbd6 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -303,6 +303,7 @@ static int venc_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f)
> struct v4l2_pix_format_mplane *pixmp = &f->fmt.pix_mp;
> struct v4l2_plane_pix_format *pfmt = pixmp->plane_fmt;
> const struct venus_format *fmt;
> + __u32 sizeimage;
>
> memset(pfmt[0].reserved, 0, sizeof(pfmt[0].reserved));
> memset(pixmp->reserved, 0, sizeof(pixmp->reserved));
> @@ -334,9 +335,10 @@ static int venc_enum_fmt(struct file *file, void *fh, struct v4l2_fmtdesc *f)
> pixmp->num_planes = fmt->num_planes;
> pixmp->flags = 0;
>
> - pfmt[0].sizeimage = venus_helper_get_framesz(pixmp->pixelformat,
> - pixmp->width,
> - pixmp->height);
> + sizeimage = venus_helper_get_framesz(pixmp->pixelformat,
> + pixmp->width,
> + pixmp->height);
> + pfmt[0].sizeimage = max(ALIGN(pfmt[0].sizeimage, SZ_4K), sizeimage);
>
> if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
> pfmt[0].bytesperline = ALIGN(pixmp->width, 128);
> @@ -408,8 +410,10 @@ static int venc_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->output_buf_size = pixmp->plane_fmt[0].sizeimage;
> + }
>
> return 0;
> }
> @@ -908,6 +912,7 @@ static int venc_queue_setup(struct vb2_queue *q,
> sizes[0] = venus_helper_get_framesz(inst->fmt_cap->pixfmt,
> inst->width,
> inst->height);
> + sizes[0] = max(sizes[0], inst->output_buf_size);
> inst->output_buf_size = sizes[0];
> break;
> default:
I think this should work, but don't we also need to do the same thing
for the decoder's OUTPUT queue?
next prev parent reply other threads:[~2018-11-26 19:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-20 6:53 [PATCH v2] media: venus: amend buffer size for bitstream plane Malathi Gottam
2018-11-26 8:21 ` Alexandre Courbot [this message]
2018-11-26 9:43 ` Stanimir Varbanov
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPBb6MWZ146=Ri12HyBRed4QUOGqDT4m90w2W5VwRhKW4ELCHA@mail.gmail.com' \
--to=acourbot@chromium.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=mgottam@codeaurora.org \
--cc=stanimir.varbanov@linaro.org \
--cc=vgarodia@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).