From: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
To: Hans Verkuil <hans.verkuil@cisco.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Maxime Ripard <maxime.ripard@bootlin.com>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Thierry Reding <thierry.reding@gmail.com>,
Tiffany Lin <tiffany.lin@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Subject: Hardware-accelerated video decoders used through a firmware instead of hardware registers
Date: Sun, 12 May 2019 13:35:55 +0200 [thread overview]
Message-ID: <19804f842e80f1f8bd85b8eb49e75e149abf0062.camel@bootlin.com> (raw)
Hi,
With the work done on the media request API and the cedrus driver for
Allwinner ARM SoCs, we now have a kernel interface for exposing fixed-
hardware video decoding pipelines (currently MPEG-2 and H.264, with
H.265 on the way). Some work remains on the per-format interface and we
are looking to improve latency-related aspects, but we are all set to
have a nice interface here, that plays well with e.g. ffmpeg.
A specific situation came to my interest, which is apparently quite
common: some platforms have general-purpose microcontrollers embedded,
which can help with video decoding. They are however rarely to never
used to do the decoding itself (since they are general-purpose, not
DSPs) and just coordinate the decoding with the fixed-pipeline decoding
hardware block. The advantage is that the interface is just a simple
mailbox and the raw video bitstream from the file can be passed
directly without the need for userspace to do any parsing that the
codec requires.
One side-effect from this setup is that the actual hardware register
layout of the decoder is hidden away in a non-free piece of
microcontroller firmware, that's usually loaded at run-time.
With the recent developments on the media interface, we could interface
with these hardware decoders directly, which offers various advantages:
- we no longer need a 3rd party external non-free firmware, which just
makes distribution easier for everyone and allows support in fully-
free setups;
- all the usual advantages of having free code that can be fixed and
updated instead of an obscure binary that many not always be doing
the right thing;
- parsing of the slices is probably best done in userspace, and I
heard that ffmpeg does this threaded, so there could be a latency
advantage there as well, not to mention that it avoids the drag of
a mailbox interface altogether;
- the general-purpose micro-controller can then be reused for something
useful where it could actually make a performance difference.
As far as I understand, it seems that the video decoder for MT8173
fails in that category, where a MD32 general-purpose micro-controller
is used to only do the parsing. We even have device-tree nodes about
the decoder and encoder, but no register layout.
So I was wondering if the linux-media community should set some
boundaries here and push towards native implementations instead of
firmware-based ones. My opininon is that it definitely should.
It seems that other platforms (e.g. Tegra K1 and onwards) are in the
same situation, and I think the ChromiumOS downstream kernel uses an
obscure firmware on a general-purpose auxiliary ARM core (that's also
used at boot time IIRC).
What do you think?
Cheers,
Paul
--
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
next reply other threads:[~2019-05-12 11:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-12 11:35 Paul Kocialkowski [this message]
2019-05-12 14:17 ` Nicolas Dufresne
2019-05-12 16:32 ` Paul Kocialkowski
2019-05-12 20:11 ` Nicolas Dufresne
2019-05-13 13:47 ` Philipp Zabel
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=19804f842e80f1f8bd85b8eb49e75e149abf0062.camel@bootlin.com \
--to=paul.kocialkowski@bootlin.com \
--cc=andrew-ct.chen@mediatek.com \
--cc=hans.verkuil@cisco.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maxime.ripard@bootlin.com \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=thierry.reding@gmail.com \
--cc=tiffany.lin@mediatek.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®