lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4e17d1f-0e93-4e5a-9a23-aa5e704161ec@gmx.net>
Date:   Wed, 15 Nov 2023 22:00:44 +0100
From:   Stefan Wahren <wahrenst@....net>
To:     Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:     Umang Jain <umang.jain@...asonboard.com>,
        linux-media@...r.kernel.org, kernel-list@...pberrypi.com,
        linux-kernel@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-staging@...ts.linux.dev,
        Dave Stevenson <dave.stevenson@...pberrypi.com>,
        Kieran Bingham <kieran.bingham@...asonboard.com>,
        "Ricardo B . Marliere" <ricardo@...liere.net>,
        Dan Carpenter <error27@...il.com>,
        Dave Stevenson <dave.stevenson@...pberrypi.org>
Subject: Re: [PATCH v2 03/15] media: videobuf2: Allow exporting of a struct
 dmabuf

Am 15.11.23 um 20:31 schrieb Laurent Pinchart:
> On Tue, Nov 14, 2023 at 08:41:11PM +0100, Stefan Wahren wrote:
>> Am 09.11.23 um 22:02 schrieb Umang Jain:
>>> From: Dave Stevenson <dave.stevenson@...pberrypi.org>
>>>
>>> videobuf2 only allowed exporting a dmabuf as a file descriptor,
>>> but there are instances where having the struct dma_buf is
>>> useful within the kernel.
>>>
>>> Split the current implementation into two, one step which
>>> exports a struct dma_buf, and the second which converts that
>>> into an fd.
>>>
>>> Signed-off-by: Dave Stevenson <dave.stevenson@...pberrypi.org>
>>> Signed-off-by: Umang Jain <umang.jain@...asonboard.com>
>>> ---
>> ...
>>
>>> diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
>>> index 4b6a9d2ea372..cba4e495f6a2 100644
>>> --- a/include/media/videobuf2-core.h
>>> +++ b/include/media/videobuf2-core.h
>>> @@ -925,6 +925,21 @@ int vb2_core_streamon(struct vb2_queue *q, unsigned int type);
>>>     */
>>>    int vb2_core_streamoff(struct vb2_queue *q, unsigned int type);
>>>
>>> +/**
>>> + * vb2_core_expbuf_dmabuf() - Export a buffer as a dma_buf structure
>>> + * @q:         videobuf2 queue
>>> + * @type:      buffer type
>>> + * @index:     id number of the buffer
>>> + * @plane:     index of the plane to be exported, 0 for single plane queues
>>> + * @flags:     flags for newly created file, currently only O_CLOEXEC is
>>> + *             supported, refer to manual of open syscall for more details
>> i think "newly created file" could be confusing here
> Would "newly created dmabuf file handle" be clearer and work for
> everybody ?
i'm fine with it
>
>>> + *
>>> + * Return: Returns the dmabuf pointer
>>> + */
>>> +struct dma_buf *vb2_core_expbuf_dmabuf(struct vb2_queue *q, unsigned int type,
>>> +				       unsigned int index, unsigned int plane,
>>> +				       unsigned int flags);
>>> +
>>>    /**
>>>     * vb2_core_expbuf() - Export a buffer as a file descriptor.
>>>     * @q:		pointer to &struct vb2_queue with videobuf2 queue.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ