From patchwork Thu Jan 9 23:26:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 2545 X-Patchwork-Delegate: niklas.soderlund@ragnatech.se Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 15F236045F for ; Fri, 10 Jan 2020 00:26:57 +0100 (CET) X-Halon-ID: 82e481a5-3337-11ea-b6d8-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p54ac5d7b.dip0.t-ipconnect.de [84.172.93.123]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 82e481a5-3337-11ea-b6d8-005056917f90; Fri, 10 Jan 2020 00:26:53 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Fri, 10 Jan 2020 00:26:47 +0100 Message-Id: <20200109232647.2068851-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: ipa_interface: Document the ownership of dmabufs passed to mapBuffers() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jan 2020 23:26:57 -0000 The ownership of the dmabuf file handles passed to mapBuffers() is not clear. Explicitly document that they are borrowed from the callee and only guaranteed to be valid for the duration of the mapBuffers() call. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/ipa_interface.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp index ee3e3622f39ae85f..25b075fef5a50db7 100644 --- a/src/libcamera/ipa_interface.cpp +++ b/src/libcamera/ipa_interface.cpp @@ -429,6 +429,9 @@ namespace libcamera { * handler that the IPA needs to access. It provides dmabuf file handles for * each buffer, and associates the buffers with unique numerical IDs. * + * The dmabuf file handles provided in \a buffers are borrowed from the callee + * and are only guaranteed to be valid during the mapBuffers() call. + * * IPAs shall map the dmabuf file handles to their address space and keep a * cache of the mappings, indexed by the buffer numerical IDs. The IDs are used * in all other IPA interface methods to refer to buffers, including the