From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B144C54FB9 for ; Wed, 15 Nov 2023 19:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PDOgf+v6yrqvSNBVHPF80ifCcHPjLa2eHAz5Ln1hoys=; b=inRx1ibtqsjpul 6RAgYGabH7JIbqp2WQar9vnC68GD+BD0pUYiVmiu0l1Ikq1zITw8E+jp7XUSB7nDT5V8JA7BdfvwP dYGSDCPxRA0l0p6k2u7ggKLNH1Oy1rFMZ6ofXPwEIBvmfIkVkyOt2GQxJ2uK1kYVD7hgCgSKgc4Xo B75NyThH3My1yc0tuGlaSK1XdawtTQXQiS5NcO6zS12hSoCFcbcQHQ5WdKsn1ba0+opnUIKl7zKx9 bKllVATEuonQzoHe0XYTRosR25O+2UoWJJoNVJ6+DjB1FtXdqQtRu1b+CJrSDdmgR6oW/Yn4S/Pbx x33O85JT/s8c27ws9NIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3LbP-001apU-39; Wed, 15 Nov 2023 19:31:07 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3LbM-001ap5-21; Wed, 15 Nov 2023 19:31:06 +0000 Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7BF1929A; Wed, 15 Nov 2023 20:30:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1700076636; bh=VG1aMvjuyEjHJfeeciYccDaZR4VmWCZdcztVpSsBQws=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DAOdraz76XQD0sbIC3knIYtUGx5E+j6Jv8+x8BDAOyZy9+/XccbKVNgc8o2fyn0kT VJwVjUEi3AQvh5UUDbCoo24qXhx/ti2gRaUpPLmyoyCPt4ozjzmX1KB2KOW1oN9FR3 FEeMVeEB1CUz75/SuM+6/BC6maXz3BqjBYXVbjoQ= Date: Wed, 15 Nov 2023 21:31:07 +0200 From: Laurent Pinchart To: Stefan Wahren Cc: Umang Jain , linux-media@vger.kernel.org, kernel-list@raspberrypi.com, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, Dave Stevenson , Kieran Bingham , "Ricardo B . Marliere" , Dan Carpenter , Dave Stevenson Subject: Re: [PATCH v2 03/15] media: videobuf2: Allow exporting of a struct dmabuf Message-ID: <20231115193107.GB29486@pendragon.ideasonboard.com> References: <20231109210309.638594-1-umang.jain@ideasonboard.com> <20231109210309.638594-4-umang.jain@ideasonboard.com> <72f83177-cd34-480a-afcc-a79f85219751@gmx.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <72f83177-cd34-480a-afcc-a79f85219751@gmx.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_113104_825499_0AC31CA4 X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > > > > 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 > > Signed-off-by: Umang Jain > > --- > > ... > > > 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 ? > > + * > > + * 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. -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel