[{"id":32421,"web_url":"https://patchwork.libcamera.org/comment/32421/","msgid":"<173279123855.1605529.10685710347616084410@ping.linuxembedded.co.uk>","date":"2024-11-28T10:53:58","subject":"Re: [PATCH] libcamera: v4l2_videodevice: Clarify V4L2M2MDevice","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi (2024-11-27 08:12:11)\n> The documentation seems to suggest that to create a new M2M\n> execution context it is expected users to call V4L2M2MDevice::open()\n> multiple times on the same video device path.\n> \n> It is instead expected that multiple instances of the class are\n> created, one for each required execution context.\n> \n> Clarify it in the documentation of the V4L2M2MDevice class.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/libcamera/v4l2_videodevice.cpp | 9 +++++++--\n>  1 file changed, 7 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 14eba0561d6a..156601d08d0c 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -2128,11 +2128,16 @@ V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelForma\n>   * deviceNode which operate together using two queues to implement the V4L2\n>   * Memory to Memory API.\n>   *\n> - * The two devices should be opened by calling open() on the V4L2M2MDevice, and\n> - * can be closed by calling close on the V4L2M2MDevice.\n\nI would open this paragraph with a statement that it's possible to use\nmultiple contexts. I don't think that itself is clear...\n\n\"\"\"\nMemory to Memory devices in the kernel using the V4L2 M2M API can\noperate with multiple contexts for parallel operations on a single\ndevice. Each instance of a V4L2M2MDevice represents a single context.\n\"\"\"\n\nThen continue with your text with one small typo:\n\n> + * User of this class should create a new instance of the V4L2M2MDevice for each\n\ns/User/Users/\n\n> + * desired execution context and then open it by calling open() on the\n> + * V4L2M2MDevice and close it by calling close() on the V4L2M2MDevice.\n>   *\n>   * Calling V4L2VideoDevice::open() and V4L2VideoDevice::close() on the capture\n>   * or output V4L2VideoDevice is not permitted.\n> + *\n> + * Once the M2M device is open users can operate on the output and capture queue\n> + * represented by the V4L2VideoDevice returned by the output() and capture()\n> + * functions.\n>   */\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  \n>  /**\n> -- \n> 2.47.0\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id AA9E1BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 Nov 2024 10:54:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ACC41658A2;\n\tThu, 28 Nov 2024 11:54:03 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EA21F60531\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Nov 2024 11:54:01 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2550C59D;\n\tThu, 28 Nov 2024 11:53:38 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"B3iDKkhu\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732791218;\n\tbh=BXH4aPOGUK6KhSKshs+F6iCkDyMRwB5jHj/45ksxy6g=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=B3iDKkhuupEXE7TYCm0U3QhcxyoxqkTnMnhrsinOKw+viZhyr2rYI6jSR5QdhXtIw\n\tVpGAnAZZjoX+gjEjieaDHkO1a8TjBxZxbAIOXcqeuq9W34NbBY2ynItvew190aK/wL\n\tbYi4QpA+5I7b3PdFNwZ3SwrS+wK2N/D9CXEJrarM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241127081212.16543-1-jacopo.mondi@ideasonboard.com>","References":"<20241127081212.16543-1-jacopo.mondi@ideasonboard.com>","Subject":"Re: [PATCH] libcamera: v4l2_videodevice: Clarify V4L2M2MDevice","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 28 Nov 2024 10:53:58 +0000","Message-ID":"<173279123855.1605529.10685710347616084410@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32422,"web_url":"https://patchwork.libcamera.org/comment/32422/","msgid":"<c723qefcwrq5vfuh6i4zir2wyqtbkqapjo3sqtjfk6ygtjspgq@4pg7krrq2yow>","date":"2024-11-28T11:09:17","subject":"Re: [PATCH] libcamera: v4l2_videodevice: Clarify V4L2M2MDevice","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Kieran\n\nOn Thu, Nov 28, 2024 at 10:53:58AM +0000, Kieran Bingham wrote:\n> Quoting Jacopo Mondi (2024-11-27 08:12:11)\n> > The documentation seems to suggest that to create a new M2M\n> > execution context it is expected users to call V4L2M2MDevice::open()\n> > multiple times on the same video device path.\n> >\n> > It is instead expected that multiple instances of the class are\n> > created, one for each required execution context.\n> >\n> > Clarify it in the documentation of the V4L2M2MDevice class.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > ---\n> >  src/libcamera/v4l2_videodevice.cpp | 9 +++++++--\n> >  1 file changed, 7 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > index 14eba0561d6a..156601d08d0c 100644\n> > --- a/src/libcamera/v4l2_videodevice.cpp\n> > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > @@ -2128,11 +2128,16 @@ V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelForma\n> >   * deviceNode which operate together using two queues to implement the V4L2\n> >   * Memory to Memory API.\n> >   *\n> > - * The two devices should be opened by calling open() on the V4L2M2MDevice, and\n> > - * can be closed by calling close on the V4L2M2MDevice.\n>\n> I would open this paragraph with a statement that it's possible to use\n> multiple contexts. I don't think that itself is clear...\n>\n> \"\"\"\n> Memory to Memory devices in the kernel using the V4L2 M2M API can\n> operate with multiple contexts for parallel operations on a single\n> device. Each instance of a V4L2M2MDevice represents a single context.\n> \"\"\"\n\nIndeed, that's helpful!\n\n>\n> Then continue with your text with one small typo:\n>\n> > + * User of this class should create a new instance of the V4L2M2MDevice for each\n>\n> s/User/Users/\n>\n> > + * desired execution context and then open it by calling open() on the\n> > + * V4L2M2MDevice and close it by calling close() on the V4L2M2MDevice.\n> >   *\n> >   * Calling V4L2VideoDevice::open() and V4L2VideoDevice::close() on the capture\n> >   * or output V4L2VideoDevice is not permitted.\n> > + *\n> > + * Once the M2M device is open users can operate on the output and capture queue\n\nand s/queue/queues/\n\n> > + * represented by the V4L2VideoDevice returned by the output() and capture()\n> > + * functions.\n> >   */\n>\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nThanks\n  j\n\n>\n> >\n> >  /**\n> > --\n> > 2.47.0\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A2059BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 28 Nov 2024 11:09:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C323865F55;\n\tThu, 28 Nov 2024 12:09:21 +0100 (CET)","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 1BFDF65898\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Nov 2024 12:09:20 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3269C353;\n\tThu, 28 Nov 2024 12:08:56 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gXK58XqG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732792136;\n\tbh=dDomwZZrwu1i0zxTkxr0LkGTnfnMy1WJaTEspuvHFLQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gXK58XqGCdoC5+Jt9oRTh40YXcZul2/eg8b4/peNrqnmuPNpVEMEJvxTNKd1zo8ZQ\n\trdowT43C24R3rAJiHIg90QwGt9uHqLdvp6tP4BS5cEJl4CyOd+dLBzLsDKS210h2AK\n\tk9Gm7vJaokvQ/6j+qGGE8J6YhEuZp2LbkYDRA5KE=","Date":"Thu, 28 Nov 2024 12:09:17 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] libcamera: v4l2_videodevice: Clarify V4L2M2MDevice","Message-ID":"<c723qefcwrq5vfuh6i4zir2wyqtbkqapjo3sqtjfk6ygtjspgq@4pg7krrq2yow>","References":"<20241127081212.16543-1-jacopo.mondi@ideasonboard.com>\n\t<173279123855.1605529.10685710347616084410@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<173279123855.1605529.10685710347616084410@ping.linuxembedded.co.uk>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]