[{"id":3165,"web_url":"https://patchwork.libcamera.org/comment/3165/","msgid":"<20191202101202.ppmzsghcecuxj5x2@uno.localdomain>","date":"2019-12-02T10:12:02","subject":"Re: [libcamera-devel] [PATCH 17/30] libcamera: v4l2_videodevice:\n\tAdd support for multi plane output buffers","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Wed, Nov 27, 2019 at 12:36:07AM +0100, Niklas Söderlund wrote:\n> When queuing an output buffer it was assumed it only had one plane. With\n> the recent rework of the buffer code it's now trivial to add support\n> multi plane output buffers, add support for it.\n>\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/v4l2_videodevice.cpp | 12 +++++++++++-\n>  1 file changed, 11 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 8f962c7e9d0c7d01..a05dd6a1f7d86eaa 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1014,7 +1014,17 @@ int V4L2VideoDevice::queueBuffer(Buffer *buffer)\n>  \tif (V4L2_TYPE_IS_OUTPUT(buf.type)) {\n>  \t\tconst BufferInfo &info = buffer->info();\n>\n> -\t\tbuf.bytesused = info.planes()[0].bytesused;\n> +\t\tif (multiPlanar) {\n> +\t\t\tunsigned int nplane = 0;\n> +\t\t\tfor (const BufferInfo::Plane &plane : info.planes()) {\n> +\t\t\t\tv4l2Planes[nplane].bytesused = plane.bytesused;\n\nNit: if you nplane++ here you can save the 2 following lines\n\n> +\t\t\t\tnplane++;\n> +\t\t\t}\n> +\t\t} else {\n> +\t\t\tif (info.planes().size())\n\nCan we have 0 planes?\n\n> +\t\t\t\tbuf.bytesused = info.planes()[0].bytesused;\n> +\t\t}\n> +\n\nAll nits\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n>  \t\tbuf.sequence = info.sequence();\n>  \t\tbuf.timestamp.tv_sec = info.timestamp() / 1000000000;\n>  \t\tbuf.timestamp.tv_usec = (info.timestamp() / 1000) % 1000000;\n> --\n> 2.24.0\n>\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 relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B49660BFF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  2 Dec 2019 11:09:53 +0100 (CET)","from uno.localdomain (93-34-114-233.ip49.fastwebnet.it\n\t[93.34.114.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id DD8FB1C0012;\n\tMon,  2 Dec 2019 10:09:52 +0000 (UTC)"],"X-Originating-IP":"93.34.114.233","Date":"Mon, 2 Dec 2019 11:12:02 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191202101202.ppmzsghcecuxj5x2@uno.localdomain>","References":"<20191126233620.1695316-1-niklas.soderlund@ragnatech.se>\n\t<20191126233620.1695316-18-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"zzbb2k3cqtogbiuq\"","Content-Disposition":"inline","In-Reply-To":"<20191126233620.1695316-18-niklas.soderlund@ragnatech.se>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 17/30] libcamera: v4l2_videodevice:\n\tAdd support for multi plane output 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":"Mon, 02 Dec 2019 10:09:53 -0000"}},{"id":3238,"web_url":"https://patchwork.libcamera.org/comment/3238/","msgid":"<20191210003923.GJ18060@pendragon.ideasonboard.com>","date":"2019-12-10T00:39:23","subject":"Re: [libcamera-devel] [PATCH 17/30] libcamera: v4l2_videodevice:\n\tAdd support for multi plane output 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 Mon, Dec 02, 2019 at 11:12:02AM +0100, Jacopo Mondi wrote:\n> On Wed, Nov 27, 2019 at 12:36:07AM +0100, Niklas Söderlund wrote:\n> > When queuing an output buffer it was assumed it only had one plane. With\n> > the recent rework of the buffer code it's now trivial to add support\n> > multi plane output buffers, add support for it.\n> >\n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > ---\n> >  src/libcamera/v4l2_videodevice.cpp | 12 +++++++++++-\n> >  1 file changed, 11 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > index 8f962c7e9d0c7d01..a05dd6a1f7d86eaa 100644\n> > --- a/src/libcamera/v4l2_videodevice.cpp\n> > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > @@ -1014,7 +1014,17 @@ int V4L2VideoDevice::queueBuffer(Buffer *buffer)\n> >  \tif (V4L2_TYPE_IS_OUTPUT(buf.type)) {\n> >  \t\tconst BufferInfo &info = buffer->info();\n> >\n> > -\t\tbuf.bytesused = info.planes()[0].bytesused;\n> > +\t\tif (multiPlanar) {\n> > +\t\t\tunsigned int nplane = 0;\n> > +\t\t\tfor (const BufferInfo::Plane &plane : info.planes()) {\n> > +\t\t\t\tv4l2Planes[nplane].bytesused = plane.bytesused;\n> \n> Nit: if you nplane++ here you can save the 2 following lines\n> \n> > +\t\t\t\tnplane++;\n> > +\t\t\t}\n> > +\t\t} else {\n> > +\t\t\tif (info.planes().size())\n> \n> Can we have 0 planes?\n> \n> > +\t\t\t\tbuf.bytesused = info.planes()[0].bytesused;\n> > +\t\t}\n> > +\n> \n> All nits\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nAdditionally, the subject line should mention that this covers queuing\nbuffers only.\n\n\"libcamera: v4l2_videodevice: Add support for queuing multi plane output buffers\"\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nBut I think you should also handle V4L2VideoDevice::dequeueBuffer(),\neither here or in a separate patch.\n\n> >  \t\tbuf.sequence = info.sequence();\n> >  \t\tbuf.timestamp.tv_sec = info.timestamp() / 1000000000;\n> >  \t\tbuf.timestamp.tv_usec = (info.timestamp() / 1000) % 1000000;","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 A1A9260BDB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 Dec 2019 01:39:31 +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 0292657E;\n\tTue, 10 Dec 2019 01:39:30 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1575938371;\n\tbh=M5VVzscDqwYNVL4ycqLzB38ua4kMkWUMnpz9iizUL5w=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=gus7nxOVdrLiHoq3a3cTTreb6tOxkTevi86shgS5uZvxcxlw0UHDPfl98ubu0rDrW\n\tMi4hWnabIawlBa/k/Kktv+cuxAg72jOUixiDeeOkqJETXCMlC9zKcKMUe++EnPi5Ct\n\tR4IZbjDVF8Gljk6i6vOr0RrbuJWNc+EwaaYV2efk=","Date":"Tue, 10 Dec 2019 02:39:23 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<20191210003923.GJ18060@pendragon.ideasonboard.com>","References":"<20191126233620.1695316-1-niklas.soderlund@ragnatech.se>\n\t<20191126233620.1695316-18-niklas.soderlund@ragnatech.se>\n\t<20191202101202.ppmzsghcecuxj5x2@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191202101202.ppmzsghcecuxj5x2@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 17/30] libcamera: v4l2_videodevice:\n\tAdd support for multi plane output 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":"Tue, 10 Dec 2019 00:39:31 -0000"}}]