From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Dave Stevenson <dave.stevenson@raspberrypi.com>,
Nicolas Dufresne <nicolas@ndufresne.ca>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Tomasz Figa <tfiga@chromium.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Andrzej Pietrasiewicz <andrzej.p@collabora.com>,
Gustavo Padovan <gustavo.padovan@collabora.com>,
Boris Brezillon <bbrezillon@collabora.com>,
Daniel Almeida <daniel.almeida@collabora.com>,
Sebastian Fricke <sebastian.fricke@collabora.com>,
Laura Nao <laura.nao@collabora.com>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Dmitry Osipenko <digetx@gmail.com>
Subject: Re: [PATCH v1] media: videobuf2: Allow applications customize data offsets of capture buffers
Date: Sat, 23 Apr 2022 01:50:03 +0300 [thread overview]
Message-ID: <ad030c70-19eb-ce15-5a78-4c04450b7ad3@collabora.com> (raw)
In-Reply-To: <CAPY8ntBQBrWytYRbv50F-4TZJdCaSQs86r3vY6kJdp+oc6SxEQ@mail.gmail.com>
On 3/25/22 16:11, Dave Stevenson wrote:
> Hi Nicolas & Dmitry
>
> On Fri, 25 Mar 2022 at 12:32, Nicolas Dufresne <nicolas@ndufresne.ca> wrote:
>>
>> Le jeudi 24 mars 2022 à 21:20 +0300, Dmitry Osipenko a écrit :
>>> The root of the problem is that DRM UAPI is more flexible and allows to
>>> customize offsets for both S/MPLANEs, while V4L doesn't allow to do it
>>> at all. I'm exploring all the potential options, so far neither of the
>>> proposed variants is ideal.
>>
>> In GStreamer kmssink, the way DRM is used, is that if you have 2 planes in your
>> pixel format, but only received 1 DMABuf, we will pass this DMABuf twice (well
>> GEM handles, but twice), with appropriate offset.
>>
>> With this in mind, the idea for V4L2 could be to always resort to MPLANE for
>> this purpose. The tricky part for userland is that it needs to know the dual
>> pixel format and map that accordingly. That is a bit difficult and this is
>> something Helen was trying to address with the v4l2_buffer_ext (that and
>> allowing space to store DRM Modifiers in the future).
>>
>> The second challenge is the overhead. In DRM, as we "prime" the DMABuf into
>> handles, this gives a kernel object to store any relevant information about the
>> buffer. So having it duplicate can be done at no cost. In V4L2, the driver would
>> need to handle that more often. Specially that despite the recommendation
>> (except for primary buffer decoder, were this is mandatory), we don't force a
>> strict DMABuf / Buffer IDX mapping.
>
> To throw another use case of data offsets into the mix, I'm keeping a
> watching eye on implementing stereoscopic capture into libcamera where
> we want to present the same buffer to the ISP twice (once for each
> eye) with either a vertical or horizontal offset between the two
> passes.
> Adding a data_offset of either a half line or half the frame is the
> easiest way around that one, although it could potentially be
> accommodated through the selection API setting a compose region
> instead.
Hi Dave,
Thank you for the suggestion about the stereoscopic capture! If you'll
manage to test this patch and it will work for you, then please feel
free to give yours tested-by.
I'll need to do couple extra checks to ensure that we really need this
new feature for the Chromebooks, this will take time. But if you'll be
able to confirm that this variant of the patch works for yours case with
the stereo cams, then we may try to proceed using the current variant
right away.
next prev parent reply other threads:[~2022-04-22 23:10 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-22 13:23 Dmitry Osipenko
2022-03-23 13:05 ` Nicolas Dufresne
2022-03-23 14:28 ` Dmitry Osipenko
2022-03-23 19:21 ` Nicolas Dufresne
2022-03-24 18:20 ` Dmitry Osipenko
2022-03-25 12:32 ` Nicolas Dufresne
2022-03-25 13:11 ` Dave Stevenson
2022-04-22 22:50 ` Dmitry Osipenko [this message]
2022-05-18 10:26 ` Hans Verkuil
2022-05-19 10:22 ` Dmitry Osipenko
2022-06-29 15:37 ` Dmitry Osipenko
2025-12-02 20:07 ` Hirokazu Honda
2025-12-03 8:28 ` Hans Verkuil
2025-12-12 23:15 ` Hirokazu Honda
2025-12-15 20:56 ` Nicolas Dufresne
2025-12-17 8:44 ` Tomasz Figa
2025-12-17 10:02 ` Hans Verkuil
2025-12-19 2:01 ` Hirokazu Honda
2025-12-19 15:18 ` Nicolas Dufresne
2025-12-24 6:09 ` Tomasz Figa
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=ad030c70-19eb-ce15-5a78-4c04450b7ad3@collabora.com \
--to=dmitry.osipenko@collabora.com \
--cc=andrzej.p@collabora.com \
--cc=bbrezillon@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=daniel.almeida@collabora.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=digetx@gmail.com \
--cc=gustavo.padovan@collabora.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=laura.nao@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mchehab@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=sebastian.fricke@collabora.com \
--cc=tfiga@chromium.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®