From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Tomasz Figa <tfiga@chromium.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Daniel Almeida <daniel.almeida@collabora.com>,
Hidenori Kobayashi <hidenorik@chromium.org>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
Sean Young <sean@mess.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Sebastian Fricke <sebastian.fricke@collabora.com>,
Ricardo Ribalda <ribalda@chromium.org>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>
Subject: Re: [ANN] Request for Topics and registration for a Media Summit September 16th
Date: Thu, 13 Jun 2024 12:12:13 +0300 [thread overview]
Message-ID: <20240613091213.GC7291@pendragon.ideasonboard.com> (raw)
In-Reply-To: <ae8cc9b0-2792-4991-83b5-d6a5e50f2d2e@xs4all.nl>
Hi Hans,
On Thu, Jun 13, 2024 at 09:08:55AM +0200, Hans Verkuil wrote:
> On 12/06/2024 22:52, Laurent Pinchart wrote:
> > On Wed, Jun 12, 2024 at 10:44:06PM +0200, Mauro Carvalho Chehab wrote:
> >> Em Wed, 12 Jun 2024 11:34:30 +0300 Laurent Pinchart escreveu:
> >>
> >>> Focussing on this topic, if we're brainstorming memory management for
> >>> media devices, I'd like to throw in a controversial idea. In addition to
> >>> being clearer on the fact that USERPTR is deprecated, I would like to
> >>> deprecate MMAP too and only focus on DMABUF. I believe Linux needs a
> >>> centralized buffer allocator, instead of having multiple allocation APIs
> >>> scattered in different places. There are design ideas in gralloc that we
> >>> could benefit from.
> >>
> >> Deprecating USERPTR is doable, as not many apps use it, and they're
> >> mostly focused on complex camera/ARM scenario. Now, deprecating MMAP at
> >> V4L2 core is a different history: lots of different userspace programs,
> >> including browsers and proprietary apps like zoom, etc. rely on MMAP
> >> support. We can only consider deprecating MMAP once applications switch
> >> to DMABUF.
> >
> > Deprecating doesn't mean dropping it right away, it means telling
> > application developers that DMABUF is the recommended way. We will still
> > have to support MMAP for a long time, including fixing bugs in it, as
> > that will be a long transition. And it first requires solving the
> > problem of centralizing allocation for DMABUF. It won't happen
> > overnight, but I'm trying to gather support for the idea, and get people
> > to collaborate on solving the technical problems that are currently
> > blocking this long term evolution. If the media subsystem endorsed the
> > effort, basically saying publicly that we are fine deprecating MMAP in
> > principle once a good replacement will be available, it may help. I
> > don't expect the deprecation to happen before at least two years, and
> > the removal from the kernel would probably take another 10 to 15 years
> > :-)
>
> IMHO you cannot removed MMAP support: it is the only streaming I/O method
> that is supported by all drivers, whereas DMABUF isn't. And many, many userspace
> applications use that. Nor does it pose problems: it just works.
I may have failed to get my point across properly, so I'll try again :-)
What I would like to do is
1. Explore how we can implement a centralized allocator that
applications can use on any Linux system to provide dmabuf instances.
2. Implement that allocator.
3. Deprecate MMAP, meaning documenting that users of V4L2 should use the
centralized allocator and DMABUF. No code change in V4L2, no removal of
MMAP, and bugs in MMAP support would keep being addressed.
4. 5-10 years later, start scheduling MMAP removal, as in setting a date
for it.
5. 5-10 years more in the future, drop MMAP when nobody will be using it
anymore.
It's phases 1 to 3 that I'm the most interested in. 4 and 5 are just
about dropping code *when* MMAP isn't used anymore *iff* that ever
happens.
> USERPTR support is another matter: there have been problems with it, and
> the vb2 code is hard to understand and to support.
>
> I wouldn't shed a tear if it disappears. The strategy would be to first
> make sure any driver supporting USERPTR also supports DMABUF, and then
> put USERPTR under a kernel config option. Initially it would default to y,
> but issue a warning, and later (after a few years) it can default to n
> and eventually be removed.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-06-13 9:12 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 11:33 [ANN] Request for Topics and registration for a Media Summit September 16th Hans Verkuil
2024-05-06 11:40 ` Ricardo Ribalda
2024-05-06 12:31 ` Laurent Pinchart
2024-05-06 13:32 ` Sean Young
2024-05-07 6:40 ` Tommaso Merciai
2024-05-08 7:16 ` Hans Verkuil
2024-05-08 12:19 ` Tommaso Merciai
2024-05-14 16:16 ` Daniel Almeida
2024-06-12 4:12 ` Tomasz Figa
2024-06-12 6:46 ` Hans Verkuil
2024-06-12 7:10 ` Steve Cho
2024-06-12 7:54 ` Mauro Carvalho Chehab
2024-06-12 8:22 ` Tomasz Figa
2024-06-12 8:34 ` Laurent Pinchart
2024-06-12 9:01 ` Tomasz Figa
2024-06-12 9:20 ` Laurent Pinchart
2024-06-12 9:33 ` Tomasz Figa
2024-06-12 9:40 ` Laurent Pinchart
2024-06-12 20:09 ` Nicolas Dufresne
2024-06-12 20:19 ` Laurent Pinchart
2024-06-13 7:17 ` Chen-Yu Tsai
2024-06-12 20:44 ` Mauro Carvalho Chehab
2024-06-12 20:52 ` Laurent Pinchart
2024-06-13 7:08 ` Hans Verkuil
2024-06-13 9:12 ` Laurent Pinchart [this message]
2024-06-13 9:38 ` Hans Verkuil
2024-06-13 9:59 ` Laurent Pinchart
2024-06-12 20:35 ` Mauro Carvalho Chehab
2024-06-13 7:38 ` Hans Verkuil
2024-06-13 8:14 ` Tomasz Figa
2024-06-13 8:35 ` Hans Verkuil
2024-06-13 10:08 ` Laurent Pinchart
2024-06-12 8:06 ` Tomasz Figa
2024-06-12 7:46 ` Laurent Pinchart
2024-05-15 9:32 ` Hans Verkuil
2024-06-04 21:48 ` Steve Cho
2024-06-17 12:43 ` Hans Verkuil
2024-06-19 9:28 ` Tomasz Figa
2024-06-28 11:59 ` Sakari Ailus
2024-07-16 13:11 ` Sakari Ailus
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=20240613091213.GC7291@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=daniel.almeida@collabora.com \
--cc=hidenorik@chromium.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=ribalda@chromium.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sean@mess.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.