From patchwork Sun Jan 12 00:54:42 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: 2581 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 F03856045B for ; Sun, 12 Jan 2020 01:54:49 +0100 (CET) X-Halon-ID: 1f227392-34d6-11ea-a00b-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p54ac5d7b.dip0.t-ipconnect.de [84.172.93.123]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 1f227392-34d6-11ea-a00b-005056917a89; Sun, 12 Jan 2020 01:54:48 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Sun, 12 Jan 2020 01:54:42 +0100 Message-Id: <20200112005442.2607343-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] libcamera: ipa_interface: Document the ownership of dmabufs passed to map_buffers() 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: Sun, 12 Jan 2020 00:54:50 -0000 The ownership of the dmabuf file handles passed to map_buffers() is not clear. Explicitly document that they are borrowed from the callee and only guaranteed to be valid for the duration of the map_buffers() call. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/ipa_interface.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp index ee3e3622f39ae85f..5ca8000a253f5435 100644 --- a/src/libcamera/ipa_interface.cpp +++ b/src/libcamera/ipa_interface.cpp @@ -258,6 +258,11 @@ * \param[in] buffers The buffers to map * \param[in] num_buffers The number of entries in the \a buffers array * + * The dmabuf file descriptors provided in \a buffers are borrowed from the + * caller and are only guaranteed to be valid during the map_buffers() call. + * Should the callee need to store a copy of the file descriptors, it shall + * duplicate them first with ::dup(). + * * \sa libcamera::IPAInterface::mapBuffers() */