[{"id":2347,"web_url":"https://patchwork.libcamera.org/comment/2347/","msgid":"<20190808203416.GE6055@pendragon.ideasonboard.com>","date":"2019-08-08T20:34:16","subject":"Re: [libcamera-devel] [PATCH 1/6] libcamera: v4l2_device: Add\n\tsetFd()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Thu, Aug 08, 2019 at 04:12:16PM +0100, Kieran Bingham wrote:\n> Provide a means for V4L2 device instances to set the fd_ explicitly.\n> This allows for V4L2Devices to operate when they must use an external open() call.\n\nLine wrap ?\n\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n>  src/libcamera/include/v4l2_device.h |  1 +\n>  src/libcamera/v4l2_device.cpp       | 19 +++++++++++++++++++\n>  2 files changed, 20 insertions(+)\n> \n> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> index e7e9829cb05f..7c3af5f6ebe0 100644\n> --- a/src/libcamera/include/v4l2_device.h\n> +++ b/src/libcamera/include/v4l2_device.h\n> @@ -39,6 +39,7 @@ protected:\n>  \tint ioctl(unsigned long request, void *argp);\n>  \n>  \tint fd() { return fd_; }\n> +\tint setFd(int fd);\n>  \n>  private:\n>  \tvoid listControls();\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 9a00566a532b..120f68e49d7a 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -308,6 +308,25 @@ int V4L2Device::ioctl(unsigned long request, void *argp)\n>   * \\return The V4L2 device file descriptor, -1 if the device node is not open\n>   */\n>  \n> +/**\n> + * \\brief Set the file descriptor of a V4L2 device.\n\ns/\\.$//\n\n> + * \\param[in] fd The file descriptor handle\n> + *\n> + * Allow a device to set the internal file descriptor rather than opening a\n> + * device node directly.\n\nHow about the following ?\n\n * This method allows a device to provide an already opened file descriptor\n * referring to the V4L2 device node, instead of opening it with open(). This\n * can be used for V4L2 M2M devices where a single video device node is used for\n * both the output and capture devices, or when receiving an open file\n * descriptor in a context that doesn't have permission to open the device node\n * itself.\n *\n * This method and the open() method are mutually exclusive, only one of the two\n * shall be used for a V4L2Device instance.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> + *\n> + * \\return 0 on success or a negative error code otherwise\n> + */\n> +int V4L2Device::setFd(int fd)\n> +{\n> +\tif (fd_ != -1)\n> +\t\treturn -1;\n> +\n> +\tfd_ = fd;\n> +\n> +\treturn 0;\n> +}\n> +\n>  /*\n>   * \\brief List and store information about all controls supported by the\n>   * V4L2 device","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E9EE6161B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Aug 2019 22:34:26 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 11B46CC;\n\tThu,  8 Aug 2019 22:34:25 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1565296466;\n\tbh=NwtuV9rmvhHNf4g+92s4igo61hMGxzQy/OEhnGF2kG4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AHeG5mGFxa8vd3GiHP4JMQ0rGuoMPhdEv+vTT7g1bs6Qzh/leg6d7OP7n0yHTSofN\n\tY/qW3pDIyPlwiQhJn/RusY3Os+WXlRw1kCtu4g6caHOcGJ7jZhq/XEdOrE2EpqI2b5\n\t2uXb4yAB5u5xRF9eKl/9fYGne8ws3v71vNXVOUR0=","Date":"Thu, 8 Aug 2019 23:34:16 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190808203416.GE6055@pendragon.ideasonboard.com>","References":"<20190808151221.24254-1-kieran.bingham@ideasonboard.com>\n\t<20190808151221.24254-2-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20190808151221.24254-2-kieran.bingham@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 1/6] libcamera: v4l2_device: Add\n\tsetFd()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Thu, 08 Aug 2019 20:34:26 -0000"}},{"id":2356,"web_url":"https://patchwork.libcamera.org/comment/2356/","msgid":"<ca0a605c-a7e6-7881-92b3-6e23cb1f77fa@ideasonboard.com>","date":"2019-08-09T10:00:54","subject":"Re: [libcamera-devel] [PATCH 1/6] libcamera: v4l2_device: Add\n\tsetFd()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"On 08/08/2019 21:34, Laurent Pinchart wrote:\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Thu, Aug 08, 2019 at 04:12:16PM +0100, Kieran Bingham wrote:\n>> Provide a means for V4L2 device instances to set the fd_ explicitly.\n>> This allows for V4L2Devices to operate when they must use an external open() call.\n> \n> Line wrap ?\n\nFixed,\n\n> \n>>\n>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>> ---\n>>  src/libcamera/include/v4l2_device.h |  1 +\n>>  src/libcamera/v4l2_device.cpp       | 19 +++++++++++++++++++\n>>  2 files changed, 20 insertions(+)\n>>\n>> diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n>> index e7e9829cb05f..7c3af5f6ebe0 100644\n>> --- a/src/libcamera/include/v4l2_device.h\n>> +++ b/src/libcamera/include/v4l2_device.h\n>> @@ -39,6 +39,7 @@ protected:\n>>  \tint ioctl(unsigned long request, void *argp);\n>>  \n>>  \tint fd() { return fd_; }\n>> +\tint setFd(int fd);\n>>  \n>>  private:\n>>  \tvoid listControls();\n>> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n>> index 9a00566a532b..120f68e49d7a 100644\n>> --- a/src/libcamera/v4l2_device.cpp\n>> +++ b/src/libcamera/v4l2_device.cpp\n>> @@ -308,6 +308,25 @@ int V4L2Device::ioctl(unsigned long request, void *argp)\n>>   * \\return The V4L2 device file descriptor, -1 if the device node is not open\n>>   */\n>>  \n>> +/**\n>> + * \\brief Set the file descriptor of a V4L2 device.\n> \n> s/\\.$//\n\nRemoved\n\n> \n>> + * \\param[in] fd The file descriptor handle\n>> + *\n>> + * Allow a device to set the internal file descriptor rather than opening a\n>> + * device node directly.\n> \n> How about the following ?\n> \n>  * This method allows a device to provide an already opened file descriptor\n>  * referring to the V4L2 device node, instead of opening it with open(). This\n>  * can be used for V4L2 M2M devices where a single video device node is used for\n>  * both the output and capture devices, or when receiving an open file\n>  * descriptor in a context that doesn't have permission to open the device node\n>  * itself.\n>  *\n>  * This method and the open() method are mutually exclusive, only one of the two\n>  * shall be used for a V4L2Device instance.\n\n\nAdded verbatim.\n\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nCollected.\n\n> \n>> + *\n>> + * \\return 0 on success or a negative error code otherwise\n>> + */\n>> +int V4L2Device::setFd(int fd)\n>> +{\n>> +\tif (fd_ != -1)\n>> +\t\treturn -1;\n>> +\n>> +\tfd_ = fd;\n>> +\n>> +\treturn 0;\n>> +}\n>> +\n>>  /*\n>>   * \\brief List and store information about all controls supported by the\n>>   * V4L2 device\n>","headers":{"Return-Path":"<kieran.bingham@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0D9C160E2F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Aug 2019 12:00:57 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 62B7FCC;\n\tFri,  9 Aug 2019 12:00:56 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1565344856;\n\tbh=urWrEb1dwgySL1APWOfnW7mNhrxwkU3Ugz6iF9CH3q0=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=ZfJzqX3mi4VCiGINAkCkk6gKeIsDheRWS0Ahnf1iwgKtaiSg+8g+IVv4LyppozFaU\n\tQ7lyLWb+TJpIMyAg7dxxloFazr7ZrFyB9BDSYsfzto5qqcsDO9am4/wg98w37SDRZ1\n\tlnNr9orBvmqNj/W6KcSwLi0Sz5HXj040GNFaT2fA=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","References":"<20190808151221.24254-1-kieran.bingham@ideasonboard.com>\n\t<20190808151221.24254-2-kieran.bingham@ideasonboard.com>\n\t<20190808203416.GE6055@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\tmQINBFYE/WYBEACs1PwjMD9rgCu1hlIiUA1AXR4rv2v+BCLUq//vrX5S5bjzxKAryRf0uHat\n\tV/zwz6hiDrZuHUACDB7X8OaQcwhLaVlq6byfoBr25+hbZG7G3+5EUl9cQ7dQEdvNj6V6y/SC\n\trRanWfelwQThCHckbobWiQJfK9n7rYNcPMq9B8e9F020LFH7Kj6YmO95ewJGgLm+idg1Kb3C\n\tpotzWkXc1xmPzcQ1fvQMOfMwdS+4SNw4rY9f07Xb2K99rjMwZVDgESKIzhsDB5GY465sCsiQ\n\tcSAZRxqE49RTBq2+EQsbrQpIc8XiffAB8qexh5/QPzCmR4kJgCGeHIXBtgRj+nIkCJPZvZtf\n\tKr2EAbc6tgg6DkAEHJb+1okosV09+0+TXywYvtEop/WUOWQ+zo+Y/OBd+8Ptgt1pDRyOBzL8\n\tRXa8ZqRf0Mwg75D+dKntZeJHzPRJyrlfQokngAAs4PaFt6UfS+ypMAF37T6CeDArQC41V3ko\n\tlPn1yMsVD0p+6i3DPvA/GPIksDC4owjnzVX9kM8Zc5Cx+XoAN0w5Eqo4t6qEVbuettxx55gq\n\t8K8FieAjgjMSxngo/HST8TpFeqI5nVeq0/lqtBRQKumuIqDg+Bkr4L1V/PSB6XgQcOdhtd36\n\tOe9X9dXB8YSNt7VjOcO7BTmFn/Z8r92mSAfHXpb07YJWJosQOQARAQABtDBLaWVyYW4gQmlu\n\tZ2hhbSA8a2llcmFuLmJpbmdoYW1AaWRlYXNvbmJvYXJkLmNvbT6JAkAEEwEKACoCGwMFCwkI\n\tBwIGFQgJCgsCBBYCAwECHgECF4ACGQEFAlnDk/gFCQeA/YsACgkQoR5GchCkYf3X5w/9EaZ7\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y5wGo/YFA\n\tJxB1gWThL4kOTbsqqXj9GLcyOImkW0lJGGR3o/fV91Zh63S5TKnf2YGGGzxki+ADdxVQAm+Q\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<ca0a605c-a7e6-7881-92b3-6e23cb1f77fa@ideasonboard.com>","Date":"Fri, 9 Aug 2019 11:00:54 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.8.0","MIME-Version":"1.0","In-Reply-To":"<20190808203416.GE6055@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 1/6] libcamera: v4l2_device: Add\n\tsetFd()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 09 Aug 2019 10:00:57 -0000"}},{"id":2360,"web_url":"https://patchwork.libcamera.org/comment/2360/","msgid":"<20190809134311.ugnsayvp4jzhicuc@uno.localdomain>","date":"2019-08-09T13:43:11","subject":"Re: [libcamera-devel] [PATCH 1/6] libcamera: v4l2_device: Add\n\tsetFd()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hello,\n\nOn Thu, Aug 08, 2019 at 11:34:16PM +0300, Laurent Pinchart wrote:\n> Hi Kieran,\n>\n> Thank you for the patch.\n>\n> On Thu, Aug 08, 2019 at 04:12:16PM +0100, Kieran Bingham wrote:\n> > Provide a means for V4L2 device instances to set the fd_ explicitly.\n> > This allows for V4L2Devices to operate when they must use an external open() call.\n>\n> Line wrap ?\n>\n> >\n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > ---\n> >  src/libcamera/include/v4l2_device.h |  1 +\n> >  src/libcamera/v4l2_device.cpp       | 19 +++++++++++++++++++\n> >  2 files changed, 20 insertions(+)\n> >\n> > diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\n> > index e7e9829cb05f..7c3af5f6ebe0 100644\n> > --- a/src/libcamera/include/v4l2_device.h\n> > +++ b/src/libcamera/include/v4l2_device.h\n> > @@ -39,6 +39,7 @@ protected:\n> >  \tint ioctl(unsigned long request, void *argp);\n> >\n> >  \tint fd() { return fd_; }\n> > +\tint setFd(int fd);\n> >\n> >  private:\n> >  \tvoid listControls();\n> > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> > index 9a00566a532b..120f68e49d7a 100644\n> > --- a/src/libcamera/v4l2_device.cpp\n> > +++ b/src/libcamera/v4l2_device.cpp\n> > @@ -308,6 +308,25 @@ int V4L2Device::ioctl(unsigned long request, void *argp)\n> >   * \\return The V4L2 device file descriptor, -1 if the device node is not open\n> >   */\n> >\n> > +/**\n> > + * \\brief Set the file descriptor of a V4L2 device.\n>\n> s/\\.$//\n>\n> > + * \\param[in] fd The file descriptor handle\n> > + *\n> > + * Allow a device to set the internal file descriptor rather than opening a\n> > + * device node directly.\n>\n> How about the following ?\n>\n>  * This method allows a device to provide an already opened file descriptor\n>  * referring to the V4L2 device node, instead of opening it with open(). This\n>  * can be used for V4L2 M2M devices where a single video device node is used for\n>  * both the output and capture devices, or when receiving an open file\n>  * descriptor in a context that doesn't have permission to open the device node\n>  * itself.\n>  *\n>  * This method and the open() method are mutually exclusive, only one of the two\n>  * shall be used for a V4L2Device instance.\n\nThanks, this gives some more context on why this change is needed\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n> > + *\n> > + * \\return 0 on success or a negative error code otherwise\n> > + */\n> > +int V4L2Device::setFd(int fd)\n> > +{\n> > +\tif (fd_ != -1)\n> > +\t\treturn -1;\n> > +\n> > +\tfd_ = fd;\n> > +\n> > +\treturn 0;\n> > +}\n> > +\n> >  /*\n> >   * \\brief List and store information about all controls supported by the\n> >   * V4L2 device\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 362D961620\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  9 Aug 2019 15:41:52 +0200 (CEST)","from uno.localdomain\n\t(host150-24-dynamic.51-79-r.retail.telecomitalia.it [79.51.24.150])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id 63E0F200004;\n\tFri,  9 Aug 2019 13:41:51 +0000 (UTC)"],"Date":"Fri, 9 Aug 2019 15:43:11 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLibCamera Devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20190809134311.ugnsayvp4jzhicuc@uno.localdomain>","References":"<20190808151221.24254-1-kieran.bingham@ideasonboard.com>\n\t<20190808151221.24254-2-kieran.bingham@ideasonboard.com>\n\t<20190808203416.GE6055@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"ceu43pszse26k5at\"","Content-Disposition":"inline","In-Reply-To":"<20190808203416.GE6055@pendragon.ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 1/6] libcamera: v4l2_device: Add\n\tsetFd()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 09 Aug 2019 13:41:52 -0000"}}]