From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: wens Tsai <wens213@gmail.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Maxime Ripard <maxime.ripard@bootlin.com>
Subject: Re: Single- vs Multi-planar APIs for mem2mem devices
Date: Thu, 11 Jul 2019 11:38:42 +0200 [thread overview]
Message-ID: <20190711093842.GB15882@aptenodytes> (raw)
In-Reply-To: <CAGb2v65AHjF4oNBixiEb=yqHF_gZyz91K_65U7kUAPGd6_cOkg@mail.gmail.com>
Hi,
On Thu 11 Jul 19, 17:21, wens Tsai wrote:
> I noticed that recent codec driver additions, such as hantro, meson/vdec,
> mtk, used the multi-planar API (mplane) instead of the single-planar API.
>
> Is there a preference for moving towards mplane?
Well, there is strict technical requirement for using the single-planar API
instead of the multi-planar one in cedrus.
Historically, we started with mplane because we can definitely pass
different addresses for luma and chroma to our decoder. However, we found
out that there are some internal limitations of the decoder block and the
addresses cannot be "too far apart". This means that if we allocate luma
at the begging of our pool and chroma at the end, the gap was too big
and the resulting decoded frame was not stored at the right address.
We found out about this purely by accident, where one particular sequence of
events lead to such a gap and showed the issue. One possible explanation
would be that the decoder uses an offset from the luma address for chroma
internally, on a limited number of bits.
So unfortunately, this means we're stuck with having our multi-planar
(in the YUV sense) buffers allocated in a single chunk (the single-plane
V4L2 API). I don't have any better answer than "userspace should cope with both
APIs as it reflects a hardware constraint", which is indeed what ffmpeg is
already doing.
Cheers,
Paul
> Also I noticed that v4l-utils has a plugin that seamlessly adapts mplane
> devices to work with single-planar API calls, but there isn't one the
> other way around. Would that be something worthwhile working on? To me
> it seems having one central adapter is better than having applications
> try to use both APIs, though some such as FFmpeg already do so.
>
> My interest in this is trying to get Chromium's v4l2 video decode
> accelerator to work on the Raspberry Pi 3 with their downstream kernel,
> which has the bcm2835-v4l2 driver. It would also benefit other platforms
> that have a stateful VPU, such as Amlogic (meson) or Mediatek SoCs.
> Chromium's code uses MPLANE exclusively, and it's geared towards ChromeOS,
> not standard Linux, but still it might be interesting to get it to work.
>
> There's also the v4l2 slice video decode accelerator which uses the
> request API which has the same issue, but lets not get ahead of ourselves.
>
> Regards
> ChenYu
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2019-07-11 9:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 9:21 Single- vs Multi-planar APIs for mem2mem devices wens Tsai
2019-07-11 9:38 ` Paul Kocialkowski [this message]
2019-07-11 11:51 ` wens Tsai
2019-07-11 12:19 ` Paul Kocialkowski
2019-07-12 4:26 ` wens Tsai
2019-07-12 9:37 ` Paul Kocialkowski
2019-07-12 10:04 ` wens Tsai
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=20190711093842.GB15882@aptenodytes \
--to=paul.kocialkowski@bootlin.com \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=mchehab@kernel.org \
--cc=wens213@gmail.com \
/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