From: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
To: "herman.chen@rock-chips.com" <herman.chen@rock-chips.com>,
李夏润 <randy.li@rock-chips.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Hans Verkuil <hverkuil@xs4all.nl>, pawel <pawel@osciak.com>,
"ayaka@soulik.info" <ayaka@soulik.info>,
"florent.revest" <florent.revest@free-electrons.com>,
"hugues.fruchet" <hugues.fruchet@st.com>
Subject: Re: Request API: stateless VPU: the buffer mechanism and DPB management
Date: Tue, 17 Jan 2017 09:59:02 -0500 [thread overview]
Message-ID: <1484665142.7839.3.camel@collabora.co.uk> (raw)
In-Reply-To: <2017011720451777881856@rock-chips.com>
Le mardi 17 janvier 2017 à 20:46 +0800, herman.chen@rock-chips.com a
écrit :
> If we move parser or part of DPB management mechanism into kernel we
> will face a issue as follows:
> One customer requires dpb management do a flush when stream occurs in
> order to keep output frame clean.
> While another one requires output frame with error to keep output
> frame smooth.
> And when only one field has a error one customer wants to do a simple
> field copy to recover.
The driver should send all frames and simply mark the corrupted frames
using V4L2_BUF_FLAG_ERROR. This way, the userspace can then make their
own decision. It is also important to keep track and cleanup the
buffers meta's (which are application specific). If the driver silently
drops frame, it makes that management much harder.
About flushing and draining operation, they are respectively signalled
to the driver using STREAMOFF and CMD_STOP.
>
> These are some operation related to strategy rather then mechanism.
> I think it is not a good idea to bring such kind of flexible process
> to kernel driver.
>
> So here is the ultimate challenge that how to reasonably move the
> parser and flexible process
> which is encapsuled in firmware to a userspace - kernel stateless
> driver model.
Moving the parsers in the kernel (on the main CPU) is not acceptable.
This is too much of a security threat. Userspace should parse the data
into structures, doing any validation required before end.
My main question and that should have an impact decision, is if those
structures can be made generic. PDB handling is not that trivial (my
reference is VAAPI here, maybe they are doing it wrong) and with driver
specific structures, we would have this code copy-pasted over and over.
So with driver specific structures, it's probably better to keep all
the parsing and reordering logic outside (hence together).
That remains, that some driver will deal with reordering on the
firmware side (even the if they don't parse), hence we need to take
this into consideration.
regards,
Nicolas
next prev parent reply other threads:[~2017-01-17 14:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 3:04 Request API: stateless VPU: the buffer mechanism and DPB management Randy Li
[not found] ` <2017011720451777881856@rock-chips.com>
2017-01-17 14:59 ` Nicolas Dufresne [this message]
2017-01-17 15:32 ` ayaka
-- strict thread matches above, loose matches on Subject: below --
2017-01-17 3:04 Randy Li
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=1484665142.7839.3.camel@collabora.co.uk \
--to=nicolas.dufresne@collabora.co.uk \
--cc=ayaka@soulik.info \
--cc=dri-devel@lists.freedesktop.org \
--cc=florent.revest@free-electrons.com \
--cc=herman.chen@rock-chips.com \
--cc=hugues.fruchet@st.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=pawel@osciak.com \
--cc=randy.li@rock-chips.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