[{"id":3424,"web_url":"https://patchwork.libcamera.org/comment/3424/","msgid":"<20200112010319.GB2960@pendragon.ideasonboard.com>","date":"2020-01-12T01:03:19","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: ipa_interface: Document\n\tthe ownership of dmabufs passed to map_buffers()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Sun, Jan 12, 2020 at 01:54:42AM +0100, Niklas Söderlund wrote:\n> The ownership of the dmabuf file handles passed to map_buffers() is not\n> clear. Explicitly document that they are borrowed from the callee and\n\ns/callee/caller/ ?\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> only guaranteed to be valid for the duration of the map_buffers() call.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/ipa_interface.cpp | 5 +++++\n>  1 file changed, 5 insertions(+)\n> \n> diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\n> index ee3e3622f39ae85f..5ca8000a253f5435 100644\n> --- a/src/libcamera/ipa_interface.cpp\n> +++ b/src/libcamera/ipa_interface.cpp\n> @@ -258,6 +258,11 @@\n>   * \\param[in] buffers The buffers to map\n>   * \\param[in] num_buffers The number of entries in the \\a buffers array\n>   *\n> + * The dmabuf file descriptors provided in \\a buffers are borrowed from the\n> + * caller and are only guaranteed to be valid during the map_buffers() call.\n> + * Should the callee need to store a copy of the file descriptors, it shall\n> + * duplicate them first with ::dup().\n> + *\n>   * \\sa libcamera::IPAInterface::mapBuffers()\n>   */\n>","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5048C606EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 12 Jan 2020 02:03:33 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DBA0B30F;\n\tSun, 12 Jan 2020 02:03:32 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1578791013;\n\tbh=yWdUY/khl4Ily3zgIv1svJpVAOMTV3m26my7n0zDFxw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Npo7MN0gcACYHottXQ5ejoBltKtFeYBYmYlbHxv6YcB6jc4gbK9w9gl88UhETkJsF\n\tTzR7/GJeAd1vM+FOWH9Q3kW0d4N+MowBm8dUyXCtXPPne7MXxKY4VKcHCoyRMTePX/\n\tjsFQgLJmITyeXOorIHPf4jjar7cP0ufjN/h05RKw=","Date":"Sun, 12 Jan 2020 03:03:19 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200112010319.GB2960@pendragon.ideasonboard.com>","References":"<20200112005442.2607343-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200112005442.2607343-1-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: ipa_interface: Document\n\tthe ownership of dmabufs passed to map_buffers()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Sun, 12 Jan 2020 01:03:33 -0000"}},{"id":3433,"web_url":"https://patchwork.libcamera.org/comment/3433/","msgid":"<20200112181809.GA784242@oden.dyn.berto.se>","date":"2020-01-12T18:18:09","subject":"Re: [libcamera-devel] [PATCH v2] libcamera: ipa_interface: Document\n\tthe ownership of dmabufs passed to map_buffers()","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your feedback.\n\nOn 2020-01-12 03:03:19 +0200, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Sun, Jan 12, 2020 at 01:54:42AM +0100, Niklas Söderlund wrote:\n> > The ownership of the dmabuf file handles passed to map_buffers() is not\n> > clear. Explicitly document that they are borrowed from the callee and\n> \n> s/callee/caller/ ?\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nThanks, with this fixed and your tag this patch is pushed to master.\n\n> \n> > only guaranteed to be valid for the duration of the map_buffers() call.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > ---\n> >  src/libcamera/ipa_interface.cpp | 5 +++++\n> >  1 file changed, 5 insertions(+)\n> > \n> > diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\n> > index ee3e3622f39ae85f..5ca8000a253f5435 100644\n> > --- a/src/libcamera/ipa_interface.cpp\n> > +++ b/src/libcamera/ipa_interface.cpp\n> > @@ -258,6 +258,11 @@\n> >   * \\param[in] buffers The buffers to map\n> >   * \\param[in] num_buffers The number of entries in the \\a buffers array\n> >   *\n> > + * The dmabuf file descriptors provided in \\a buffers are borrowed from the\n> > + * caller and are only guaranteed to be valid during the map_buffers() call.\n> > + * Should the callee need to store a copy of the file descriptors, it shall\n> > + * duplicate them first with ::dup().\n> > + *\n> >   * \\sa libcamera::IPAInterface::mapBuffers()\n> >   */\n> >  \n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4CB0C6045D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 12 Jan 2020 19:18:11 +0100 (CET)","by mail-lj1-x241.google.com with SMTP id o13so7530591ljg.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 12 Jan 2020 10:18:11 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\tg25sm4534862ljn.107.2020.01.12.10.18.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 12 Jan 2020 10:18:10 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=wjRFzvavhHUZ+UpZDKpC2SuShwdNvdF8502PsHlHcxI=;\n\tb=Sp259KBDLILEMzqVkGEQLDqnqOR0UNBugMnGa8viU89f0cvMSO9o4BEG6Uk01c8Chx\n\tLuM6X18nmd111wMRziRdczSTkeew1LpDl7VOY3XtDjdRatkP/zqd0MxDkV/5K58W/Myb\n\tuCud72KwcycQFAOgTo86EF6WH08tihH618eigcjd/ICmzjabUgJHqIVdiw1pL3F0+bN6\n\tlH93JkZngj3/9/+RAPnQ9dqSU+E1DWNqv5TtFxL/wfWPYaoieFxrEBz0QgEqIx2g8LkY\n\tsHK3ouUd7j1e11lkDY+Su8hJ8znxGO3dKjxO49PGeXXfr3RyqkTAfV4eQ64FL897i05a\n\tImuw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=wjRFzvavhHUZ+UpZDKpC2SuShwdNvdF8502PsHlHcxI=;\n\tb=psEk1F3mFqKALI1Bys6S8oZtRz8WRQUBdIWMLZoR5BO1hgONlLUem57eJhQy4uH+D5\n\tMlqrZuEP5xGCDk4PUlh2LabYv6zqCGMYdvELo91w1UWaupMvEMk+uvzUPXY6Q2yez3EG\n\tBAmQsfDAVx3HW7dTY2AktN9rOXU2Kij/zf+7UmOodpmpk0+/wD0WcN47ApC43qf1QaCp\n\tXtPNDukVvP9Fl4t3Iz8y8LPJ1EDqaix+/DSbch+d8+m3nVizK7FStgq61WH56lllAPD9\n\t1XZ8IKFzL2/Rf6XQUsFeTUjT8MH9l3BthalsIQfVnwXIbq/3lZb8HNmITHpOzVBalI+Q\n\tEX6A==","X-Gm-Message-State":"APjAAAWzjc+Hs26zGn9pX4YLdGt7W8MnJ2F9DK42WDzY9jBq6mH+vO3T\n\tSAr7FBkC15YkEIYPFYCkUE5t33csp0YkXw==","X-Google-Smtp-Source":"APXvYqwCJ73iXGVB/LWc3MFNcooPdg3mr7DQV94KPyJpK6vpPSaEnkZRxuzuioY8MOd6J8bjOt78kQ==","X-Received":"by 2002:a2e:9ad1:: with SMTP id p17mr8542850ljj.26.1578853090754;\n\tSun, 12 Jan 2020 10:18:10 -0800 (PST)","Date":"Sun, 12 Jan 2020 19:18:09 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200112181809.GA784242@oden.dyn.berto.se>","References":"<20200112005442.2607343-1-niklas.soderlund@ragnatech.se>\n\t<20200112010319.GB2960@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200112010319.GB2960@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH v2] libcamera: ipa_interface: Document\n\tthe ownership of dmabufs passed to map_buffers()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Sun, 12 Jan 2020 18:18:11 -0000"}}]