[{"id":11060,"web_url":"https://patchwork.libcamera.org/comment/11060/","msgid":"<20200701165641.GP2399385@oden.dyn.berto.se>","date":"2020-07-01T16:56:41","subject":"Re: [libcamera-devel] [PATCH 15/15] libcamera: ipu3: Pass cio2\n\tfourcc to ImgUDevice::configure()","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2020-07-01 14:30:36 +0200, Jacopo Mondi wrote:\n> Only the CIO2 4cc code is required for ImgUDevice::configure(), as the\n> input frame sizes are now reported through the ImgUDevice::Pipe\n> structure.\n> \n> Add the CIO2 pixel format to ImguDevice::Pipe instead of passing the\n> whole CIO2 V4L2DeviceFormat to ImgUDevice::configure().\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/ipu3/imgu.cpp | 19 ++++++++++++++-----\n>  src/libcamera/pipeline/ipu3/imgu.h   |  3 ++-\n>  src/libcamera/pipeline/ipu3/ipu3.cpp |  3 ++-\n>  3 files changed, 18 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> index f580c1d2ff6c..59e63644d22f 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> @@ -26,11 +26,16 @@ LOG_DECLARE_CATEGORY(IPU3)\n>   * The ImgU unit processes images through several components, which have\n>   * to be properly configured inspecting the input image size and the desired\n>   * output sizes. This structure collects the ImgU input configuration and the\n> - * requested main output and viewfinder configurations.\n> + * requested main output and viewfinder configurations, along with the\n> + * pixel format to be applied to the ImgU input, which is the same as the\n> + * one used by the CIO2 unit.\n>   *\n>   * \\var Pipe::input\n>   * \\brief The input image size\n>   *\n> + * \\var Pipe::cio2Fourcc\n> + * \\brief The CIO2 pixel format to be applied to ImgU input\n> + *\n>   * \\var Pipe::output\n>   * \\brief The requested main output size\n>   *\n> @@ -96,17 +101,21 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index)\n>  /**\n>   * \\brief Configure the ImgU unit input\n>   * \\param[in] pipe The ImgU pipe configuration\n> - * \\param[in] inputFormat The format to be applied to ImgU input\n>   * \\return 0 on success or a negative error code otherwise\n>   */\n> -int ImgUDevice::configure(struct Pipe *pipe, V4L2DeviceFormat *inputFormat)\n> +int ImgUDevice::configure(struct Pipe *pipe)\n>  {\n>  \t/* Configure the ImgU input video device with the requested sizes. */\n> -\tint ret = input_->setFormat(inputFormat);\n> +\tV4L2DeviceFormat inputFormat = {\n> +\t\t.fourcc = pipe->cio2Fourcc,\n> +\t\t.size = pipe->input,\n> +\t\t.planesCount = 1,\n> +\t};\n> +\tint ret = input_->setFormat(&inputFormat);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -\tLOG(IPU3, Debug) << \"ImgU input format = \" << inputFormat->toString();\n> +\tLOG(IPU3, Debug) << \"ImgU input format = \" << inputFormat.toString();\n>  \n>  \t/*\n>  \t * \\todo The IPU3 driver implementation shall be changed to use the\n> diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\n> index 45c5cc1ce8e6..b0ed228756c7 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.h\n> +++ b/src/libcamera/pipeline/ipu3/imgu.h\n> @@ -25,13 +25,14 @@ class ImgUDevice\n>  public:\n>  \tstruct Pipe {\n>  \t\tSize input;\n> +\t\tV4L2PixelFormat cio2Fourcc;\n\nWould it make sens to name this inputFourcc ?\n\n>  \t\tSize output;\n>  \t\tSize viewfinder;\n>  \t};\n>  \n>  \tint init(MediaDevice *media, unsigned int index);\n>  \n> -\tint configure(struct Pipe *pipe, V4L2DeviceFormat *inputFormat);\n> +\tint configure(struct Pipe *pipe);\n>  \n>  \tint configureOutput(const StreamConfiguration &cfg,\n>  \t\t\t    V4L2DeviceFormat *outputFormat)\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 317e78155ebb..79ec492341b2 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -410,6 +410,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n>  \tImgUDevice::Pipe imguPipe{};\n>  \timguPipe.input.width = cio2Format.size.width;\n>  \timguPipe.input.height = cio2Format.size.height;\n> +\timguPipe.cio2Fourcc = cio2Format.fourcc;\n>  \n>  \tfor (unsigned int i = 0; i < config->size(); ++i) {\n>  \t\tStreamConfiguration &cfg = (*config)[i];\n> @@ -459,7 +460,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n>  \t * Configure the ImgU with the collected pipe configuration and the\n>  \t * CIO2 unit format.\n>  \t */\n> -\tret = imgu->configure(&imguPipe, &cio2Format);\n> +\tret = imgu->configure(&imguPipe);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -- \n> 2.27.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":"<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 D8416BE905\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Jul 2020 16:56:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7B69B609A9;\n\tWed,  1 Jul 2020 18:56:43 +0200 (CEST)","from mail-lj1-x242.google.com (mail-lj1-x242.google.com\n\t[IPv6:2a00:1450:4864:20::242])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CF78A609A9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Jul 2020 18:56:42 +0200 (CEST)","by mail-lj1-x242.google.com with SMTP id z24so3115450ljn.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Jul 2020 09:56:42 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tr25sm2231870ljg.9.2020.07.01.09.56.41\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Jul 2020 09:56:41 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"lcL/V8NA\"; dkim-atps=neutral","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=T5S6pPqDVhbL+y8c2Z+2d0nsqWPgu1Vai3XnIuKXEfg=;\n\tb=lcL/V8NAoCHu6c6P+kyIz/Y/NvyUQooINqKsjsa0dho78RtrBETSXQ/Gf/LZIv6VPz\n\t+ONnTnGbnzOvLrg5AjDt4+j7Hs6YPd16OAqjooFOpShXQThDveniZh+sebWNbKeL8qAS\n\tQzRJmVD3tRzCu6Fm1moRWScZD7WCeL+HKrKyh6mED7CwtTCMiShZBrA1DSoe1Hk+UZV6\n\tKwp+SmDTjZ677y2vAC7p1kcTiWQBOLvM2XxGwV+X8gnguPyZnvgumRtGllaPAFNhP3QH\n\to7SKFGbbxp06otZ4bZ+wd+2HpZaBkDxOwGFQJgZ5xA2ky1VRbdgzJrqrVv3xSi/MiTKf\n\tZ0Lw==","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=T5S6pPqDVhbL+y8c2Z+2d0nsqWPgu1Vai3XnIuKXEfg=;\n\tb=oiys598iHNoYAG1wjqFhMcpqBRmh1ZIZLHCSdrTjFqV44vSmYU5JYJ3hpaRDq5kQ7P\n\trsW1Oc1qtMCSWtm1IRH4hKDluLXu6VVW0K6JAfcilCunFwDImdHIhUkqjg9E3wi21qUU\n\tdV45ANSdkk5qL/ko1yuVmTBmMIFDxFS2fC0rctHEcUD+xEEN1sFmObaGLtzzTfG6zUfl\n\tTB0JTe/V7TFiUwyp4nesLgY2Juy4eOeNCDmPFc3UtEnMM5XBkfHMGkBgBM8lFocq5oRA\n\tk+53eRI6tHtWMxQTRMCq2HelXCNDs9R9YESqFegG81tt5D4KIxyAfAfirZvNAc56uwGM\n\ttaiQ==","X-Gm-Message-State":"AOAM531oYHBFKuatiWQ9ncCm+BCx2pvE/Omx9cPRp0BTyGP1gLS6HjTL\n\t/qWdYQ2A17Y1NsVwTQwx4N02QhSAX1k=","X-Google-Smtp-Source":"ABdhPJy+PjiBhaYGHw3bW0fvXZ+3JpFU5B8zIbB5E7XAsg3cQ4IDYfSEr6dDe2OXjgHdqwpdaPAV3w==","X-Received":"by 2002:a05:651c:120d:: with SMTP id\n\ti13mr10338649lja.153.1593622602147; \n\tWed, 01 Jul 2020 09:56:42 -0700 (PDT)","Date":"Wed, 1 Jul 2020 18:56:41 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200701165641.GP2399385@oden.dyn.berto.se>","References":"<20200701123036.51922-1-jacopo@jmondi.org>\n\t<20200701123036.51922-16-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200701123036.51922-16-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 15/15] libcamera: ipu3: Pass cio2\n\tfourcc to ImgUDevice::configure()","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@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":11067,"web_url":"https://patchwork.libcamera.org/comment/11067/","msgid":"<20200702073645.eldvyp2muoeyeqp3@uno.localdomain>","date":"2020-07-02T07:36:45","subject":"Re: [libcamera-devel] [PATCH 15/15] libcamera: ipu3: Pass cio2\n\tfourcc to ImgUDevice::configure()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Wed, Jul 01, 2020 at 06:56:41PM +0200, Niklas Söderlund wrote:\n> Hi Jacopo,\n>\n> Thanks for your work.\n>\n> On 2020-07-01 14:30:36 +0200, Jacopo Mondi wrote:\n> > Only the CIO2 4cc code is required for ImgUDevice::configure(), as the\n> > input frame sizes are now reported through the ImgUDevice::Pipe\n> > structure.\n> >\n> > Add the CIO2 pixel format to ImguDevice::Pipe instead of passing the\n> > whole CIO2 V4L2DeviceFormat to ImgUDevice::configure().\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/pipeline/ipu3/imgu.cpp | 19 ++++++++++++++-----\n> >  src/libcamera/pipeline/ipu3/imgu.h   |  3 ++-\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp |  3 ++-\n> >  3 files changed, 18 insertions(+), 7 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > index f580c1d2ff6c..59e63644d22f 100644\n> > --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > @@ -26,11 +26,16 @@ LOG_DECLARE_CATEGORY(IPU3)\n> >   * The ImgU unit processes images through several components, which have\n> >   * to be properly configured inspecting the input image size and the desired\n> >   * output sizes. This structure collects the ImgU input configuration and the\n> > - * requested main output and viewfinder configurations.\n> > + * requested main output and viewfinder configurations, along with the\n> > + * pixel format to be applied to the ImgU input, which is the same as the\n> > + * one used by the CIO2 unit.\n> >   *\n> >   * \\var Pipe::input\n> >   * \\brief The input image size\n> >   *\n> > + * \\var Pipe::cio2Fourcc\n> > + * \\brief The CIO2 pixel format to be applied to ImgU input\n> > + *\n> >   * \\var Pipe::output\n> >   * \\brief The requested main output size\n> >   *\n> > @@ -96,17 +101,21 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index)\n> >  /**\n> >   * \\brief Configure the ImgU unit input\n> >   * \\param[in] pipe The ImgU pipe configuration\n> > - * \\param[in] inputFormat The format to be applied to ImgU input\n> >   * \\return 0 on success or a negative error code otherwise\n> >   */\n> > -int ImgUDevice::configure(struct Pipe *pipe, V4L2DeviceFormat *inputFormat)\n> > +int ImgUDevice::configure(struct Pipe *pipe)\n> >  {\n> >  \t/* Configure the ImgU input video device with the requested sizes. */\n> > -\tint ret = input_->setFormat(inputFormat);\n> > +\tV4L2DeviceFormat inputFormat = {\n> > +\t\t.fourcc = pipe->cio2Fourcc,\n> > +\t\t.size = pipe->input,\n> > +\t\t.planesCount = 1,\n> > +\t};\n> > +\tint ret = input_->setFormat(&inputFormat);\n> >  \tif (ret)\n> >  \t\treturn ret;\n> >\n> > -\tLOG(IPU3, Debug) << \"ImgU input format = \" << inputFormat->toString();\n> > +\tLOG(IPU3, Debug) << \"ImgU input format = \" << inputFormat.toString();\n> >\n> >  \t/*\n> >  \t * \\todo The IPU3 driver implementation shall be changed to use the\n> > diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\n> > index 45c5cc1ce8e6..b0ed228756c7 100644\n> > --- a/src/libcamera/pipeline/ipu3/imgu.h\n> > +++ b/src/libcamera/pipeline/ipu3/imgu.h\n> > @@ -25,13 +25,14 @@ class ImgUDevice\n> >  public:\n> >  \tstruct Pipe {\n> >  \t\tSize input;\n> > +\t\tV4L2PixelFormat cio2Fourcc;\n>\n> Would it make sens to name this inputFourcc ?\n>\n\nTo pair it with \"Size input\" ? I really think so, yes!\n\n> >  \t\tSize output;\n> >  \t\tSize viewfinder;\n> >  \t};\n> >\n> >  \tint init(MediaDevice *media, unsigned int index);\n> >\n> > -\tint configure(struct Pipe *pipe, V4L2DeviceFormat *inputFormat);\n> > +\tint configure(struct Pipe *pipe);\n> >\n> >  \tint configureOutput(const StreamConfiguration &cfg,\n> >  \t\t\t    V4L2DeviceFormat *outputFormat)\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index 317e78155ebb..79ec492341b2 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -410,6 +410,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n> >  \tImgUDevice::Pipe imguPipe{};\n> >  \timguPipe.input.width = cio2Format.size.width;\n> >  \timguPipe.input.height = cio2Format.size.height;\n> > +\timguPipe.cio2Fourcc = cio2Format.fourcc;\n> >\n> >  \tfor (unsigned int i = 0; i < config->size(); ++i) {\n> >  \t\tStreamConfiguration &cfg = (*config)[i];\n> > @@ -459,7 +460,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n> >  \t * Configure the ImgU with the collected pipe configuration and the\n> >  \t * CIO2 unit format.\n> >  \t */\n> > -\tret = imgu->configure(&imguPipe, &cio2Format);\n> > +\tret = imgu->configure(&imguPipe);\n> >  \tif (ret)\n> >  \t\treturn ret;\n> >\n> > --\n> > 2.27.0\n> >\n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel\n>\n> --\n> Regards,\n> Niklas Söderlund","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 2C22EBFFE2\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Jul 2020 07:33:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0855460C53;\n\tThu,  2 Jul 2020 09:33:15 +0200 (CEST)","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 62748603AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Jul 2020 09:33:13 +0200 (CEST)","from uno.localdomain (93-34-118-233.ip49.fastwebnet.it\n\t[93.34.118.233]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id DE4F11C0006;\n\tThu,  2 Jul 2020 07:33:12 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Thu, 2 Jul 2020 09:36:45 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200702073645.eldvyp2muoeyeqp3@uno.localdomain>","References":"<20200701123036.51922-1-jacopo@jmondi.org>\n\t<20200701123036.51922-16-jacopo@jmondi.org>\n\t<20200701165641.GP2399385@oden.dyn.berto.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200701165641.GP2399385@oden.dyn.berto.se>","Subject":"Re: [libcamera-devel] [PATCH 15/15] libcamera: ipu3: Pass cio2\n\tfourcc to ImgUDevice::configure()","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@lists.libcamera.org","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]