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 B3225C4332F for ; Tue, 14 Nov 2023 19:42:01 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AoWpLzJSU/Of48dukiqUUcPWEIFxq5W9Nj9Eyo6qLAA=; b=B1652JegAcUiMB dxWf1d8PARqJzqaeWahXeEsbIjCi9L8rb4iU24JqwjzfFJKebwva049n3iuzwjEYhsYq2hNCSexAI oCn/x3EK6dS3V+Weo8jk0ftTck3lQRm1+AWQ84svjfjSf7jEYbOq4G9Pf9z6fnoJkSyuHsL8FAyVy AvJ2xBgL5nkoHXJTrkpnwh2b8+ekwEH8QTphcfNSIMNW2V4CnX6+iDTiUoHIapr85/VuXbV13y9+8 rrkO9/kQMM5yqjSl7jdlM0ShXaF1OuvNyyXbCNf+XfS0AAPyc5GUl7Q1d212IIsQwB4QXz4I9PuQR eVh6tVS5ImMvXwuhslXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2zHw-00Gdqd-1O; Tue, 14 Nov 2023 19:41:32 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2zHr-00GdqE-2O; Tue, 14 Nov 2023 19:41:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1699990872; x=1700595672; i=wahrenst@gmx.net; bh=7XpRZHnFj2Izkoh0Q5WsLmSTskwyxjWzJ7y2oCyz9Lw=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=tJhaV+jnx507vsMlPnQXY1AwpaMQLySogxQTZ0zqBy/TxAUezvw/Y29DWQVM7xVL JGRKSsq4EY9OVJ/6XM3/zIa6qRJk0s559tEdqW4ZKsEF/7YTwqC6fYey9/lj2hR8a kWJSBhizdtz3QQdS2vJCD7UfXPN+boRp54xm6RTQ/4Tke/1kaTgK1o7GdaJbYZVgg u8qaUuTGihmCHuX7IxnUlf/bBVRMIIokblygNg78+vG3gqaWSZDl4T0NDbU8Oaio2 icpfEnDa61PKVRxu8z2yfmFPlMJ5BsC5tVxZpyy/8Z8ey4HPP510pUABTXLY4jBLC B2PA0fm5/i/Pk5e3KA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.1.129] ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M7K3i-1r1tLg0n5Y-007m2J; Tue, 14 Nov 2023 20:41:12 +0100 Message-ID: <72f83177-cd34-480a-afcc-a79f85219751@gmx.net> Date: Tue, 14 Nov 2023 20:41:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 03/15] media: videobuf2: Allow exporting of a struct dmabuf Content-Language: en-US To: 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 Cc: Dave Stevenson , Kieran Bingham , Laurent Pinchart , "Ricardo B . Marliere" , Dan Carpenter , Dave Stevenson References: <20231109210309.638594-1-umang.jain@ideasonboard.com> <20231109210309.638594-4-umang.jain@ideasonboard.com> From: Stefan Wahren In-Reply-To: <20231109210309.638594-4-umang.jain@ideasonboard.com> X-Provags-ID: V03:K1:lEtah1+CEXmZfQprroDXTVetOrwED9+nX9BS3arjwJHN6ph6WKM ykF928OOJEU4gktD50xI3ZlBHgQB77cNHAmyk2yxOvngrS07BhPacCqEGq8jIsWrH4/FGL7 qq9tQR/1k5sTTD1cpE9hWk8vjecnWBrMcb+agC34NOdbrWf8dp1+d/yf2IU3oLFbgE9xzhn Gz3X6mpsZJo9tmY7VMOZQ== UI-OutboundReport: notjunk:1;M01:P0:QXnNKUX7WoI=;3LsnX/DFkXNv40xdv2JyNY2Edo/ JwBaUF7eHGzK8sceqxRe1TxiuGSqMI2w5GvJ9dfmYfDEeLgxKIPkXWYA79tZNObHevFx8W8Tm 9siwrBgsdaoI/qHMf+wQBBY8i9Cd5YfHs6rZBQXQCgSb7l+CPYe18wIrDF2/3yAjIxauinI6l QusjfNzmzhRI+6d31c+UYBi6MsURGRG9dpTBVE114aE2Iy3oieA3+H+JLO3GCtTcRJtKImvX7 CSo2Oe2AYZqmaMK9DQn9Oj54jeApA0bXUtxXtY74eDOioDNfJbKhH5YXnVZt593dK5IPZ7USK 6+6uvvgCNB6kNBX1JzxAvmaa+3dxNjtRz17gRbP0K3z8M51kWWDbgneuJpAajjrVXPUMegXTR qzurkHwy8z5slGIjNVNxYFRwJ+RrKwzNXCfbjvbJWEAuguz+ze0NGGUYysHVc9NKYXAqAM1zK +yOV3gbvUQPUJYkh0B2P4O1gyM+7nc29WVKH3UjAoGuqA300kVOxYhD7f0b01xZLTMl5pHyxJ puziENTtdQsXeGRdYULgO0x36Gel+iziIWdjCkJrYR57k1+hTntcK5J42hEjMsRa057QZhtyu I6tfi/sggJGW4taFh00Pyh8of/oZY1uc7f5glRhB3eUsF3HFkqw73ETDFxpH3ElMESyxniNAo hC84hTalFDpubawYjwHE99IrjLgxJiWdQN3DDioj626OAv9H3mf1Vtd9Wp3A9nPVn3tVRlGnP SXZ2HeYSaplnDalUCPPTU1WzrM94fIF/XPmpZgJ3J9dcT/mjtLuABSoswo3LDozC5Zwb7maGu ATQWe6YNw3AJ3MxrVuCzH7DeFWr6kp8AvLLem9q9lv04XFrsgmZ1vSJZkM2Lx0MeWxxdRuKuk vbkCo8R1XlI9HpHW6V8PNJChrSb7Ug6kqDoVwfI23+2HXzcYuLe25cv7pCJKZm2xZlAJ+xMUv WIxRUw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231114_114128_064252_09AFD78D X-CRM114-Status: GOOD ( 12.60 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Umang, 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 > + * > + * 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel