linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <tfiga@chromium.org>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Alexandre Courbot <acourbot@chromium.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	linuxtv-commits@linuxtv.org,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Hirokazu Honda <hiroh@chromium.org>
Subject: Re: [git:media_tree/master] media: mtk-vcodec: Remove extra area allocation in an input buffer on encoding
Date: Tue, 17 Dec 2019 15:46:21 +0900	[thread overview]
Message-ID: <CAAFQd5BrTcC+bavoPoBsfKKuFLe7AdD=7BM17BSY59t9R4SL6w@mail.gmail.com> (raw)
In-Reply-To: <ef927bf9-57ad-3be0-c9af-30da4751fdb8@xs4all.nl>

+Alexandre Courbot

On Sun, Nov 10, 2019 at 10:36 PM Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
>
> On 11/10/19 2:13 PM, Tomasz Figa wrote:
> > Hi Mauro and Hans,
> >
> > On Sun, Nov 10, 2019 at 3:42 PM Mauro Carvalho Chehab
> > <mchehab@kernel.org> wrote:
> >>
> >> This is an automatic generated email to let you know that the following patch were queued:
> >>
> >> Subject: media: mtk-vcodec: Remove extra area allocation in an input buffer on encoding
> >> Author:  Hirokazu Honda <hiroh@chromium.org>
> >> Date:    Sun Nov 10 07:25:34 2019 +0100
> >
> > I asked for some more testing on different platforms in my review
> > reply and we got some offline signals that it might not work on some
> > platforms, due to some hardware prefetch. (Would be better if that was
> > reported to the mailing list instead.) We're trying to figure out the
> > exact requirements here, because half of the frame doesn't sound like
> > something reasonable. Let's hold off the patch for the time being.
>
> I'll repost my last pull request, including a revert of this patch.
>
> The state of this patch in patchwork is changed back to New.
>
> I'll wait for your feedback on what to do with this patch.
>
> Regards,
>
>         Hans
>
> >
> > Best regards,
> > Tomasz
> >
> >>
> >> MediaTek encoder allocates non pixel data area for an input buffer every
> >> plane. As the input buffer should be read-only, the driver should not write
> >> anything in the buffer. Therefore, the extra data should be unnecessary.
> >>
> >> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
> >> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> >> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> >> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
> >>
> >>  drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 9 +++------
> >>  1 file changed, 3 insertions(+), 6 deletions(-)
> >>
> >> ---
> >>
> >> diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> >> index fd8de027e83e..6aad53d97d74 100644
> >> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> >> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c
> >> @@ -332,14 +332,12 @@ static int vidioc_try_fmt(struct v4l2_format *f,
> >>
> >>                 pix_fmt_mp->num_planes = fmt->num_planes;
> >>                 pix_fmt_mp->plane_fmt[0].sizeimage =
> >> -                               pix_fmt_mp->width * pix_fmt_mp->height +
> >> -                               ((ALIGN(pix_fmt_mp->width, 16) * 2) * 16);
> >> +                       pix_fmt_mp->width * pix_fmt_mp->height;
> >>                 pix_fmt_mp->plane_fmt[0].bytesperline = pix_fmt_mp->width;
> >>
> >>                 if (pix_fmt_mp->num_planes == 2) {
> >>                         pix_fmt_mp->plane_fmt[1].sizeimage =
> >> -                               (pix_fmt_mp->width * pix_fmt_mp->height) / 2 +
> >> -                               (ALIGN(pix_fmt_mp->width, 16) * 16);
> >> +                               (pix_fmt_mp->width * pix_fmt_mp->height) / 2;
> >>                         pix_fmt_mp->plane_fmt[2].sizeimage = 0;
> >>                         pix_fmt_mp->plane_fmt[1].bytesperline =
> >>                                                         pix_fmt_mp->width;
> >> @@ -347,8 +345,7 @@ static int vidioc_try_fmt(struct v4l2_format *f,
> >>                 } else if (pix_fmt_mp->num_planes == 3) {
> >>                         pix_fmt_mp->plane_fmt[1].sizeimage =
> >>                         pix_fmt_mp->plane_fmt[2].sizeimage =
> >> -                               (pix_fmt_mp->width * pix_fmt_mp->height) / 4 +
> >> -                               ((ALIGN(pix_fmt_mp->width, 16) / 2) * 16);
> >> +                               (pix_fmt_mp->width * pix_fmt_mp->height) / 4;
> >>                         pix_fmt_mp->plane_fmt[1].bytesperline =
> >>                                 pix_fmt_mp->plane_fmt[2].bytesperline =
> >>                                 pix_fmt_mp->width / 2;
>

  reply	other threads:[~2019-12-17  6:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1iTgvs-0004qe-3k@www.linuxtv.org>
2019-11-10 13:13 ` [git:media_tree/master] media: mtk-vcodec: Remove extra area allocation in an input buffer on encoding Tomasz Figa
2019-11-10 13:36   ` Hans Verkuil
2019-12-17  6:46     ` Tomasz Figa [this message]
2019-12-19  9:30       ` Tomasz Figa
2020-06-25  6:13         ` Alexandre Courbot

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='CAAFQd5BrTcC+bavoPoBsfKKuFLe7AdD=7BM17BSY59t9R4SL6w@mail.gmail.com' \
    --to=tfiga@chromium.org \
    --cc=acourbot@chromium.org \
    --cc=hiroh@chromium.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=linuxtv-commits@linuxtv.org \
    --cc=mchehab@kernel.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).