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 BEE53C2BB3F for ; Wed, 15 Nov 2023 21:01:37 +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=rn9shL/0GPBi8YCsEIeBdvcFg9qa2fx4N9zHHCDQmpQ=; b=2Uzr1LBBpU5XeB szs5Ax5xJrQkMlADPTGCZaimdLVaw0RBMRT+jia/hAS+bMxNNqnzMGaj/it+KO6jD96VO5YEozcrm RsXo6/BZV2yGhR9qiDB6gvCLOqqZdE9Qf/x/aWgfZwg/aKw+MMRaG8LoxaRR9oZbZp52/szR8L9v7 ksR3gmIVe+HFQ2nuNSs5PE4rclfmrDVXCmhsBnhpF4b/4yb/WfNvquUk4L4EEeo2flU0crVJvYFOc wToXqtjlFJP6sWAckVJLDph1EAKEIbateueliUFXhO0UMie3svgyh2dpHUC/Ib+Wq99wd6+oTVkT7 em+TRoRl3b4oR4PT4YsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3N0X-001iw7-0R; Wed, 15 Nov 2023 21:01:09 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3N0P-001iuM-2E; Wed, 15 Nov 2023 21:01:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1700082045; x=1700686845; i=wahrenst@gmx.net; bh=rNldis1p5YzojdhDCj6DbU417aqwBP/yDtSPkIspBbc=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=fXkHTN75FcRZtVBiywx3P4JHLkbBbRKhh4I/yrExOLokjRHgazDkg0zD125CpSbv akA0Ja44935tnpAiaxWkpDnK+h2/5QBFcHvHQzoBPy1SFqlndbHTFdHuiV2UZp5nK 6bTI0OrzjL6McYSDQ7tJ2hSgVrWtO4oF3aoXJ1fpPHPXCtjDmeBh20vQNxz3x7Ygr RJfkdpLuycgeD4mSU0QgyoZ+hIvYFMy52alvI5F6YE9VyIr9TpPEKSVUAycB+ompm iBr6A3I1kRh4ZCu1jV4xZZo1Ti2j4vwLj2F5qQWVJAeg72zc04PZm+1qFIW4nS5ZP YKzZ7GUZo1VXKIgZyA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.1.129] ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MvK4f-1rKtoq16Vl-00rJIA; Wed, 15 Nov 2023 22:00:45 +0100 Message-ID: Date: Wed, 15 Nov 2023 22:00:44 +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: Laurent Pinchart 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 References: <20231109210309.638594-1-umang.jain@ideasonboard.com> <20231109210309.638594-4-umang.jain@ideasonboard.com> <72f83177-cd34-480a-afcc-a79f85219751@gmx.net> <20231115193107.GB29486@pendragon.ideasonboard.com> From: Stefan Wahren In-Reply-To: <20231115193107.GB29486@pendragon.ideasonboard.com> X-Provags-ID: V03:K1:UWGy7py8UJCyH9p7MwNMAqWaExabfledFsS9bYQ+Wcm7PdM+Lhk SGgRxwglD9RZ4ma/gw/rxFCDeuEMTd/HB8VzNzNuM4rDWnBDPV1QCoYlF6dsYoGXapCmwP6 QCD2D2HziofbOCAavL8rESDzxALmrzYHDz4MB+3pgYAUATcdJRW9Dw6yrudwN06tBChk5BW ibPbYKSLSfGFNE1UlR7Lg== UI-OutboundReport: notjunk:1;M01:P0:PDL5jnpKONE=;DyIsb0RLet2GXJxWKOX4t38yqwi QmdqylkFt+pkhpOPLRLPR5U97ibxn193Ywz7rCCwx40HbO1l4fw0yP2lbm0ZSMtxV2+TRHqDs zEpue0VqM5MN/EleTZEN/4qByaQBMJk5Uc5k3f19MKUcH1I0/3UBHPk6ADwac4W6r8b7x0hGA g9uEKfX0ROZ6q+WM3J9VfusVYejN6YTzg0yHx5tFTdLBvuVM9JOjW+0F5/lAvqYjy9q96blLp Hdu1ak5JsbCld9mlBIK2z8fab6LA8LuEZJD0HOCRk3V5wJ2++UGIxYp4s9gt+o1TMLSLncivQ nbe5Fe3xYzlgL0ZlvU9uz4cqMUPmSsGuFS9M1PgdW0hcu0yoNS2e6yA2/BY1x/o3G/ymcEnBb glktj9fcEd4DaeDkY4dzRm1XDbJnlC5sHCa96YoZ7ft9x85iaOj33XHldCNv1vS6qnYWliQXG 3wCa72yVOGu4CrvJZ8lwQ+Nk5G7sIn94T86hFbLfe1+uKIEITvFfq/7khbGbpU3bNPgfCMHEq e3qYqqM3cDattpBaXvZ0J7Ypl5MLCLnss7Qx5Q7SCT9eSDN70SKbch1m78TdJ23vOO3ejFpFf b4tSZeT4GQz3HG81lylvksYBr4etYb9rLWiyegsscyQCskqAPDqRD/4UJ1loCrTwDWpBQUUgo un4RwMt29E7CuZPt9nn9HAZiHsLbht601tP6Z0ondkJP6YzZZKANfWWDKwzIiB4Nly4yPycyD hESPabmo6R8MDjspuocmdiwnMwz6syTP0+YiLdApdaDlvfTMlci0RBKDtX6fsXKuRrb20gGnm HPQ/zf0B26tDRtpYL38D6aRUPBq0Ppls5FFVBS1/1v+cVVG4ys8QTmbhts5aF3LcN3WzdvN19 V2Fgi+nmNYnfTb5mDiZ9aOI0qWEWCr7dr1VGpjyij/Lgfrz3ieSsIDLyRI64DhsK5T5XtmoHo DGTRPbJhSC7Nqs8ID0riE4Xm3zQ= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_130105_122982_69D43930 X-CRM114-Status: GOOD ( 10.46 ) 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 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 >>> >>> 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 ? 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel