[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3c0c7e7e-1530-411b-b7a4-9f13e0ff1f9e@redhat.com>
Date: Tue, 7 May 2024 16:34:24 +0200
From: Hans de Goede <hdegoede@...hat.com>
To: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Cc: Sumit Semwal <sumit.semwal@...aro.org>,
Benjamin Gaignard <benjamin.gaignard@...labora.com>,
Brian Starkey <Brian.Starkey@....com>, John Stultz <jstultz@...gle.com>,
"T.J. Mercier" <tjmercier@...gle.com>,
Christian König <christian.koenig@....com>,
Lennart Poettering <mzxreary@...inter.de>,
Robert Mader <robert.mader@...labora.com>,
Sebastien Bacher <sebastien.bacher@...onical.com>,
Linux Media Mailing List <linux-media@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
linaro-mm-sig@...ts.linaro.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
Milan Zamazal <mzamazal@...hat.com>, Maxime Ripard <mripard@...hat.com>,
Andrey Konovalov <andrey.konovalov.ynk@...il.com>
Subject: Re: Safety of opening up /dev/dma_heap/* to physically present users
(udev uaccess tag) ?
Hi Dmitry,
On 5/7/24 3:32 PM, Dmitry Baryshkov wrote:
> On Mon, May 06, 2024 at 01:49:17PM +0200, Hans de Goede wrote:
>> Hi dma-buf maintainers, et.al.,
>>
>> Various people have been working on making complex/MIPI cameras work OOTB
>> with mainline Linux kernels and an opensource userspace stack.
>>
>> The generic solution adds a software ISP (for Debayering and 3A) to
>> libcamera. Libcamera's API guarantees that buffers handed to applications
>> using it are dma-bufs so that these can be passed to e.g. a video encoder.
>>
>> In order to meet this API guarantee the libcamera software ISP allocates
>> dma-bufs from userspace through one of the /dev/dma_heap/* heaps. For
>> the Fedora COPR repo for the PoC of this:
>> https://hansdegoede.dreamwidth.org/28153.html
>
> Is there any reason for allocating DMA buffers for libcamera through
> /dev/dma_heap/ rather than allocating them via corresponding media
> device and then giving them away to DRM / VPU / etc?
>
> At least this should solve the permission usecase: if the app can open
> camera device, it can allocate a buffer.
This is with a software ISP, the input buffers with raw bayer data
come from a v4l2 device, but the output buffers with the processed
data are purely userspace managed in this case.
Regards,
Hans
Powered by blists - more mailing lists