[{"id":19397,"web_url":"https://patchwork.libcamera.org/comment/19397/","msgid":"<891ceebf-a6cb-a102-a229-52be9ca1358b@ideasonboard.com>","date":"2021-09-06T07:11:28","subject":"Re: [libcamera-devel] [PATCH v2 11/27] libcamera: v4l2_videodevice:\n\tDocument plane handling in createBuffer()","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 06/09/2021 04:00, Laurent Pinchart wrote:\n> The V4L2VideoDevice::createBuffer() calculates offsets manually when\n> using a multi-planar pixel format and a single-planar V4L2 format. The\n> process isn't trivial, document it.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n> ---\n>  src/libcamera/v4l2_videodevice.cpp | 9 +++++++++\n>  1 file changed, 9 insertions(+)\n> \n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 1483181a0856..88535f5a07c7 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1334,10 +1334,19 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)\n>  \t}\n>  \n>  \t/*\n> +\t * If we have a multi-planar format with a V4L2 single-planar buffer,\n> +\t * split the single V4L2 plane into multiple FrameBuffer planes by\n> +\t * computing the offsets manually.\n> +\t *\n>  \t * The format info is not guaranteed to be valid, as there are no\n>  \t * PixelFormatInfo for metadata formats, so check it first.\n>  \t */\n>  \tif (formatInfo_->isValid() && formatInfo_->numPlanes() != numPlanes) {\n> +\t\t/*\n> +\t\t * There's no valid situation where the number of colour planes\n> +\t\t * differs from the number of V4L2 planes and the V4L2 buffer\n> +\t\t * has more than one plane.\n> +\t\t */\n>  \t\tASSERT(numPlanes == 1u);\n>  \n>  \t\tplanes.resize(formatInfo_->numPlanes());\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 384A0BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Sep 2021 07:11:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AE4FD6916A;\n\tMon,  6 Sep 2021 09:11:31 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E64960503\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Sep 2021 09:11:30 +0200 (CEST)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:eb18:8e30:9b7:f998])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DDF0317;\n\tMon,  6 Sep 2021 09:11:30 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Ejaj/6B1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630912290;\n\tbh=6YTcsygFAAFQNywoGj33791X3qJ9U+v1JmqF+zDE1Gw=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=Ejaj/6B11P87MDJiFkJ9GB98B49z80StZI/Lxy6WHiq4glMC2nDEwzqyQ3aXCPUje\n\ts/pt6UPKcrinD7TRKeWdd9pTSHUeIVjTCtRzDbtz5UvUQrkse4FIyq+1pBGmOkLzWz\n\tIndzRjV4epwAns5Q0eDRWZPaA2IgcZKxQfj2s9q8=","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>\n\t<20210906020100.14430-12-laurent.pinchart@ideasonboard.com>","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Message-ID":"<891ceebf-a6cb-a102-a229-52be9ca1358b@ideasonboard.com>","Date":"Mon, 6 Sep 2021 09:11:28 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.13.0","MIME-Version":"1.0","In-Reply-To":"<20210906020100.14430-12-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 11/27] libcamera: v4l2_videodevice:\n\tDocument plane handling in createBuffer()","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":19441,"web_url":"https://patchwork.libcamera.org/comment/19441/","msgid":"<CAO5uPHP8imvGCb8o=zKU0AEP1jT4MS4tcz78vxNJXT6eLaUF3g@mail.gmail.com>","date":"2021-09-06T12:53:48","subject":"Re: [libcamera-devel] [PATCH v2 11/27] libcamera: v4l2_videodevice:\n\tDocument plane handling in createBuffer()","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent,\n\nOn Mon, Sep 6, 2021 at 4:11 PM Jean-Michel Hautbois\n<jeanmichel.hautbois@ideasonboard.com> wrote:\n>\n> Hi Laurent,\n>\n> On 06/09/2021 04:00, Laurent Pinchart wrote:\n> > The V4L2VideoDevice::createBuffer() calculates offsets manually when\n> > using a multi-planar pixel format and a single-planar V4L2 format. The\n> > process isn't trivial, document it.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n> > ---\n> >  src/libcamera/v4l2_videodevice.cpp | 9 +++++++++\n> >  1 file changed, 9 insertions(+)\n> >\n> > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > index 1483181a0856..88535f5a07c7 100644\n> > --- a/src/libcamera/v4l2_videodevice.cpp\n> > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > @@ -1334,10 +1334,19 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)\n> >       }\n> >\n> >       /*\n> > +      * If we have a multi-planar format with a V4L2 single-planar buffer,\n> > +      * split the single V4L2 plane into multiple FrameBuffer planes by\n> > +      * computing the offsets manually.\n> > +      *\n> >        * The format info is not guaranteed to be valid, as there are no\n> >        * PixelFormatInfo for metadata formats, so check it first.\n> >        */\n> >       if (formatInfo_->isValid() && formatInfo_->numPlanes() != numPlanes) {\n> > +             /*\n> > +              * There's no valid situation where the number of colour planes\n> > +              * differs from the number of V4L2 planes and the V4L2 buffer\n> > +              * has more than one plane.\n> > +              */\n> >               ASSERT(numPlanes == 1u);\n> >\n> >               planes.resize(formatInfo_->numPlanes());\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 F129FBD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Sep 2021 12:54:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4F7DF6916A;\n\tMon,  6 Sep 2021 14:54:01 +0200 (CEST)","from mail-ej1-x634.google.com (mail-ej1-x634.google.com\n\t[IPv6:2a00:1450:4864:20::634])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D84E360137\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Sep 2021 14:53:59 +0200 (CEST)","by mail-ej1-x634.google.com with SMTP id i21so13367233ejd.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 06 Sep 2021 05:53:59 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"TUGRXAVi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=ZocyLGgC9oqtbJIhMne27iZEToJ7az4ydd95jy85C4c=;\n\tb=TUGRXAVivNlrr/k3hMDd+LLtUlhbvNUUb8IgnM8z/cCN0/6Qu4g3dCGE+id9biSRx8\n\tjcfUfWMWNVD+rnAmLKbuCnxfYdSKnInbg6jdCRCigEsAL+3QNOdUxx0Q9hOnU/dnYI82\n\tMByRlMjvmgfxfwiKTkSiIN2HFZSkc8u1Qamvs=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=ZocyLGgC9oqtbJIhMne27iZEToJ7az4ydd95jy85C4c=;\n\tb=qf8fF/oidWxAmnTyilzLAEnealrucAaI/h9n0RTt+S5+D1KKUyYL9Ga7ZX12prvbnX\n\tYE6J8dYHZW/0kqE5vJ+H+nKNCoubTwMhFshOkZoSTmf00ZAaVjVsHK4P6QhSgkLOl+Au\n\tgUfv/taLmtqd62TriA3kOwY37TxerOI9owjUyegZ8Kil/sgv27rANfZXpWHd/MLytwGR\n\tYLlEHZj1zP4JPBtT6DY7HUQwmLoE6YEbvOLwnQAIRdq2YajaGd1BUWm5unn2JXnys7W6\n\tVdDS63j+4XfurLpiSJhB9svHxzmhmDsDQSRxFLuSlKRSrTgDzJ094oCzD2lgycK9AYXl\n\twdlQ==","X-Gm-Message-State":"AOAM5333lOsfgPtYF/npR2bid5bxNDtbxGCRhXCmBCembnPUZBLbKhxa\n\tbOYNW1AjsZZrRHkr0AVAtqENvlYEbxZbgZ1eP2AvUA==","X-Google-Smtp-Source":"ABdhPJxYXDAftKS0xKG5o7vHXKD87aFNP3oc+ALoAxzYz0TCoS37jGYj/MegSA57iUDbo6fyGQ8BwXwUgI3g5MCG/OA=","X-Received":"by 2002:a17:906:f289:: with SMTP id\n\tgu9mr13203531ejb.559.1630932839304; \n\tMon, 06 Sep 2021 05:53:59 -0700 (PDT)","MIME-Version":"1.0","References":"<20210906020100.14430-1-laurent.pinchart@ideasonboard.com>\n\t<20210906020100.14430-12-laurent.pinchart@ideasonboard.com>\n\t<891ceebf-a6cb-a102-a229-52be9ca1358b@ideasonboard.com>","In-Reply-To":"<891ceebf-a6cb-a102-a229-52be9ca1358b@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 6 Sep 2021 21:53:48 +0900","Message-ID":"<CAO5uPHP8imvGCb8o=zKU0AEP1jT4MS4tcz78vxNJXT6eLaUF3g@mail.gmail.com>","To":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 11/27] libcamera: v4l2_videodevice:\n\tDocument plane handling in createBuffer()","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]