[{"id":11058,"web_url":"https://patchwork.libcamera.org/comment/11058/","msgid":"<20200701165424.GN2399385@oden.dyn.berto.se>","date":"2020-07-01T16:54:24","subject":"Re: [libcamera-devel] [PATCH 13/15] libcamera: ipu3: Collect ImgU\n\tpipe configuration","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:34 +0200, Jacopo Mondi wrote:\n> Break the stream assignement and ImgU configuration performed at\n> IPU3PipelineHandler::configure() time in two parts, to collect the\n> ImgU pipe configuration.\n> \n> The first pass collects the desired ImgU pipe configuration and assigns\n> streams to configurations. The second pass, which is performed after the\n> ImgU pipe has been configured, programs the computed sizes to the ImgU\n> output video devices.\n> \n> Use the collected pipe configuration in ImgUDevice::configureInput() as\n> it will be used to compute the pipe configuration parameters.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/ipu3/imgu.cpp | 11 ++--\n>  src/libcamera/pipeline/ipu3/imgu.h   |  2 +-\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 80 +++++++++++++++++++---------\n>  3 files changed, 60 insertions(+), 33 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> index 7e9047cc8dc1..49201157eb07 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> @@ -95,12 +95,11 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index)\n>  \n>  /**\n>   * \\brief Configure the ImgU unit input\n> - * \\param[in] size The ImgU input frame size\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::configureInput(const Size &size,\n> -\t\t\t       V4L2DeviceFormat *inputFormat)\n> +int ImgUDevice::configureInput(struct Pipe *pipe, V4L2DeviceFormat *inputFormat)\n>  {\n>  \t/* Configure the ImgU input video device with the requested sizes. */\n>  \tint ret = input_->setFormat(inputFormat);\n> @@ -122,8 +121,8 @@ int ImgUDevice::configureInput(const Size &size,\n>  \tRectangle rect = {\n>  \t\t.x = 0,\n>  \t\t.y = 0,\n> -\t\t.width = inputFormat->size.width,\n> -\t\t.height = inputFormat->size.height,\n> +\t\t.width = pipe->input.width,\n> +\t\t.height = pipe->input.height,\n>  \t};\n>  \tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n>  \tif (ret)\n> @@ -138,7 +137,7 @@ int ImgUDevice::configureInput(const Size &size,\n>  \n>  \tV4L2SubdeviceFormat imguFormat = {};\n>  \timguFormat.mbus_code = MEDIA_BUS_FMT_FIXED;\n> -\timguFormat.size = size;\n> +\timguFormat.size = pipe->input;\n>  \n>  \tret = imgu_->setFormat(PAD_INPUT, &imguFormat);\n>  \tif (ret)\n> diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\n> index 8fb271fb8350..c0353955ea43 100644\n> --- a/src/libcamera/pipeline/ipu3/imgu.h\n> +++ b/src/libcamera/pipeline/ipu3/imgu.h\n> @@ -31,7 +31,7 @@ public:\n>  \n>  \tint init(MediaDevice *media, unsigned int index);\n>  \n> -\tint configureInput(const Size &size, V4L2DeviceFormat *inputFormat);\n> +\tint configureInput(struct Pipe *pipe, V4L2DeviceFormat *inputFormat);\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 16bda97a3cc3..9499c127ef79 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -396,32 +396,26 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n>  \t\toutCount++;\n>  \t}\n>  \n> -\t/*\n> -\t * Configure the CIO2 unit with the format computed during validation\n> -\t * and apply the same format to the ImgU input.\n> -\t */\n> +\t/* Configure the CIO2 unit with the format computed during validation. */\n>  \tconst Size &sensorSize = config->cio2Format().size;\n>  \tV4L2DeviceFormat cio2Format = {};\n>  \tret = data->cio2_.configure(sensorSize, &cio2Format);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -\tret = imgu->configureInput(sensorSize, &cio2Format);\n> -\tif (ret)\n> -\t\treturn ret;\n> +\t/*\n> +\t * Collect the input, output and viewfinder sizes to configure the\n> +\t * ImgU pipe and assign streams to configurations while iterating them.\n> +\t */\n> +\tImgUDevice::Pipe imguPipe{};\n> +\timguPipe.input.width = cio2Format.size.width;\n> +\timguPipe.input.height = cio2Format.size.height;\n\nWould not 'imguPipe.input = cio2Format.size' work here and below? With \nthis fixed,\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n>  \n> -\t/* Apply the format to the configured streams output devices. */\n> -\tbool outActive = false;\n> -\tbool vfActive = false;\n>  \tfor (unsigned int i = 0; i < config->size(); ++i) {\n>  \t\tStreamConfiguration &cfg = (*config)[i];\n>  \t\tconst PixelFormatInfo &info =\n>  \t\t\tPixelFormatInfo::info(cfg.pixelFormat);\n>  \t\tif (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) {\n> -\t\t\t/*\n> -\t\t\t * The RAW stream is configured as part of the CIO2 and\n> -\t\t\t * no configuration is needed for the ImgU.\n> -\t\t\t */\n>  \t\t\tcfg.setStream(&data->rawStream_);\n>  \t\t\tcfg.stride = cio2Format.planes[0].bpl;\n>  \n> @@ -437,13 +431,9 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n>  \t\t * requested.\n>  \t\t */\n>  \t\tif (cfg.size == maxOut && outCount > 1) {\n> -\t\t\tret = imgu->configureOutput(cfg, &outputFormat);\n> -\t\t\tif (ret)\n> -\t\t\t\treturn ret;\n> -\n> -\t\t\tcfg.stride = outputFormat.planes[0].bpl;\n>  \t\t\tcfg.setStream(&data->outStream_);\n> -\t\t\toutActive = true;\n> +\t\t\timguPipe.output.width = cfg.size.width;\n> +\t\t\timguPipe.output.height = cfg.size.height;\n>  \n>  \t\t\tLOG(IPU3, Debug) << \"Assigned \" << cfg.toString()\n>  \t\t\t\t\t << \" to the main output\";\n> @@ -457,18 +447,56 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n>  \t\t * the smaller one to reduce the cropping required (if any) on\n>  \t\t * the main output.\n>  \t\t */\n> -\t\tret = imgu->configureViewfinder(cfg, &outputFormat);\n> -\t\tif (ret)\n> -\t\t\treturn ret;\n> -\n> -\t\tcfg.stride = outputFormat.planes[0].bpl;\n>  \t\tcfg.setStream(&data->vfStream_);\n> -\t\tvfActive = true;\n> +\t\timguPipe.viewfinder.width = cfg.size.width;\n> +\t\timguPipe.viewfinder.height = cfg.size.height;\n>  \n>  \t\tLOG(IPU3, Debug) << \"Assigned \" << cfg.toString()\n>  \t\t\t\t << \" to the viewfinder output\";\n>  \t}\n>  \n> +\t/*\n> +\t * Configure the ImgU with the collected pipe configuration and the\n> +\t * CIO2 unit format.\n> +\t */\n> +\tret = imgu->configureInput(&imguPipe, &cio2Format);\n> +\tif (ret)\n> +\t\treturn ret;\n> +\n> +\t/* Apply the format to the ImgU output devices. */\n> +\tbool outActive = false;\n> +\tbool vfActive = false;\n> +\tfor (unsigned int i = 0; i < config->size(); ++i) {\n> +\t\tStreamConfiguration &cfg = (*config)[i];\n> +\t\tStream *stream = cfg.stream();\n> +\n> +\t\tif (stream == &data->rawStream_) {\n> +\t\t\t/*\n> +\t\t\t * The RAW stream is configured as part of the CIO2 and\n> +\t\t\t * no configuration is needed for the ImgU.\n> +\t\t\t */\n> +\t\t\tcontinue;\n> +\t\t}\n> +\n> +\t\tif (stream == &data->outStream_) {\n> +\t\t\tret = imgu->configureOutput(cfg, &outputFormat);\n> +\t\t\tif (ret)\n> +\t\t\t\treturn ret;\n> +\n> +\t\t\toutActive = true;\n> +\t\t\tcfg.stride = outputFormat.planes[0].bpl;\n> +\t\t}\n> +\n> +\t\tif (stream == &data->vfStream_) {\n> +\t\t\tret = imgu->configureViewfinder(cfg, &outputFormat);\n> +\t\t\tif (ret)\n> +\t\t\t\treturn ret;\n> +\n> +\t\t\tvfActive = true;\n> +\t\t\tcfg.stride = outputFormat.planes[0].bpl;\n> +\t\t}\n> +\t}\n> +\n>  \t/*\n>  \t * As we need to set format also on the non-active streams, use\n>  \t * the configuration of the active one for that purpose (there should\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 E7B3BBE905\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Jul 2020 16:54:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 87BE060C57;\n\tWed,  1 Jul 2020 18:54:27 +0200 (CEST)","from mail-lj1-x244.google.com (mail-lj1-x244.google.com\n\t[IPv6:2a00:1450:4864:20::244])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 68323609A9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Jul 2020 18:54:26 +0200 (CEST)","by mail-lj1-x244.google.com with SMTP id d17so13296211ljl.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Jul 2020 09:54:26 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\ty26sm2009081ljm.46.2020.07.01.09.54.24\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Jul 2020 09:54:24 -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=\"erOo5z2s\"; 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=XeZ56oEQd64B8NSKKdVyqrHqTjibfKt2KVKW2w+eWZA=;\n\tb=erOo5z2sb88I09nOLZxsC+cLCi+Oq8VlGOQKeCSoaYqHtgeEvScJ4FV8p2oP7GcfEC\n\tOCv5gGqO5BmMiUDZONj+1184VTPtEsXNzpGjQ7raGQHqIqChlHj6DXba6RghYYcUNEqc\n\tLzgHvMWcb+Wxqlmd3KJQ2987T19zkuBWijRYq9zZ0DNshn9RhEPlsaL84wbiXaI983Ym\n\tOuT57+bbzHTZgBnQ6SZGXaYEDSk1A+sWEoLs8AAGwIc267G/00SOEF1J9RiTV7yzY4Ga\n\tbnk4sgTOh8hinJceFRFFCplsFR0JqaiGV92hB1rfbqKg+Ho8HH8LCBvYJlKpKEhGD6WP\n\tn1Cw==","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=XeZ56oEQd64B8NSKKdVyqrHqTjibfKt2KVKW2w+eWZA=;\n\tb=ZiuNl8RGJntmeRPrmlMn96L3iTbZUzP5yF9dpEq4n/3YguSSL3HQwpR6yVOHkOTPlV\n\tAPYL9hW8RV67tvOXOgD6gS2Lih/r+v0qt5Jp6IhaCBNRoEyU2htZYM0rDpItBcvQQnoq\n\tAZPqvgbHYLXB/zHt7/KEPAqtUgKgNiZGMBc/FH9VFhPQeiakkg7N3zNR4cowC8QVOKNo\n\tv8fQIswxE0p/faVHt4DXm64H8eWAg5j7KeRE3ti1DAjwa0CrSMciq1KRc2ZCp30F4kWo\n\tRPci7a7EJ6K3a1DPpDyfxB4iw6tmBFgPx33iSkq5GS65irI+hDVNr1P3s/p8XjRIOomq\n\t296A==","X-Gm-Message-State":"AOAM530HLiCUMPj3svEiNTMPw4qNOKAUJb7+ErluQtPmyaWVSJLgoKNF\n\tdrSH9IwTfHuB7nl3qKYzHUBJIus6Eg8=","X-Google-Smtp-Source":"ABdhPJwkKS12S4oZ4GMMGhdswYlgEbHXzSSGsmuOvSR3A1d1aF5ml1/gooSHjO6B8HZ9XCXQyKXYmw==","X-Received":"by 2002:a2e:9397:: with SMTP id\n\tg23mr14812214ljh.185.1593622465661; \n\tWed, 01 Jul 2020 09:54:25 -0700 (PDT)","Date":"Wed, 1 Jul 2020 18:54:24 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200701165424.GN2399385@oden.dyn.berto.se>","References":"<20200701123036.51922-1-jacopo@jmondi.org>\n\t<20200701123036.51922-14-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200701123036.51922-14-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 13/15] libcamera: ipu3: Collect ImgU\n\tpipe configuration","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":11066,"web_url":"https://patchwork.libcamera.org/comment/11066/","msgid":"<20200702073604.b4ro6u2sznrcrade@uno.localdomain>","date":"2020-07-02T07:36:04","subject":"Re: [libcamera-devel] [PATCH 13/15] libcamera: ipu3: Collect ImgU\n\tpipe configuration","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:54:24PM +0200, Niklas Söderlund wrote:\n> Hi Jacopo,\n>\n> Thanks for your work.\n>\n> On 2020-07-01 14:30:34 +0200, Jacopo Mondi wrote:\n> > Break the stream assignement and ImgU configuration performed at\n> > IPU3PipelineHandler::configure() time in two parts, to collect the\n> > ImgU pipe configuration.\n> >\n> > The first pass collects the desired ImgU pipe configuration and assigns\n> > streams to configurations. The second pass, which is performed after the\n> > ImgU pipe has been configured, programs the computed sizes to the ImgU\n> > output video devices.\n> >\n> > Use the collected pipe configuration in ImgUDevice::configureInput() as\n> > it will be used to compute the pipe configuration parameters.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/pipeline/ipu3/imgu.cpp | 11 ++--\n> >  src/libcamera/pipeline/ipu3/imgu.h   |  2 +-\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp | 80 +++++++++++++++++++---------\n> >  3 files changed, 60 insertions(+), 33 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > index 7e9047cc8dc1..49201157eb07 100644\n> > --- a/src/libcamera/pipeline/ipu3/imgu.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n> > @@ -95,12 +95,11 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index)\n> >\n> >  /**\n> >   * \\brief Configure the ImgU unit input\n> > - * \\param[in] size The ImgU input frame size\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::configureInput(const Size &size,\n> > -\t\t\t       V4L2DeviceFormat *inputFormat)\n> > +int ImgUDevice::configureInput(struct Pipe *pipe, V4L2DeviceFormat *inputFormat)\n> >  {\n> >  \t/* Configure the ImgU input video device with the requested sizes. */\n> >  \tint ret = input_->setFormat(inputFormat);\n> > @@ -122,8 +121,8 @@ int ImgUDevice::configureInput(const Size &size,\n> >  \tRectangle rect = {\n> >  \t\t.x = 0,\n> >  \t\t.y = 0,\n> > -\t\t.width = inputFormat->size.width,\n> > -\t\t.height = inputFormat->size.height,\n> > +\t\t.width = pipe->input.width,\n> > +\t\t.height = pipe->input.height,\n> >  \t};\n> >  \tret = imgu_->setSelection(PAD_INPUT, V4L2_SEL_TGT_CROP, &rect);\n> >  \tif (ret)\n> > @@ -138,7 +137,7 @@ int ImgUDevice::configureInput(const Size &size,\n> >\n> >  \tV4L2SubdeviceFormat imguFormat = {};\n> >  \timguFormat.mbus_code = MEDIA_BUS_FMT_FIXED;\n> > -\timguFormat.size = size;\n> > +\timguFormat.size = pipe->input;\n> >\n> >  \tret = imgu_->setFormat(PAD_INPUT, &imguFormat);\n> >  \tif (ret)\n> > diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\n> > index 8fb271fb8350..c0353955ea43 100644\n> > --- a/src/libcamera/pipeline/ipu3/imgu.h\n> > +++ b/src/libcamera/pipeline/ipu3/imgu.h\n> > @@ -31,7 +31,7 @@ public:\n> >\n> >  \tint init(MediaDevice *media, unsigned int index);\n> >\n> > -\tint configureInput(const Size &size, V4L2DeviceFormat *inputFormat);\n> > +\tint configureInput(struct Pipe *pipe, V4L2DeviceFormat *inputFormat);\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 16bda97a3cc3..9499c127ef79 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -396,32 +396,26 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n> >  \t\toutCount++;\n> >  \t}\n> >\n> > -\t/*\n> > -\t * Configure the CIO2 unit with the format computed during validation\n> > -\t * and apply the same format to the ImgU input.\n> > -\t */\n> > +\t/* Configure the CIO2 unit with the format computed during validation. */\n> >  \tconst Size &sensorSize = config->cio2Format().size;\n> >  \tV4L2DeviceFormat cio2Format = {};\n> >  \tret = data->cio2_.configure(sensorSize, &cio2Format);\n> >  \tif (ret)\n> >  \t\treturn ret;\n> >\n> > -\tret = imgu->configureInput(sensorSize, &cio2Format);\n> > -\tif (ret)\n> > -\t\treturn ret;\n> > +\t/*\n> > +\t * Collect the input, output and viewfinder sizes to configure the\n> > +\t * ImgU pipe and assign streams to configurations while iterating them.\n> > +\t */\n> > +\tImgUDevice::Pipe imguPipe{};\n> > +\timguPipe.input.width = cio2Format.size.width;\n> > +\timguPipe.input.height = cio2Format.size.height;\n>\n> Would not 'imguPipe.input = cio2Format.size' work here and below? With\n> this fixed,\n\nAh yes!\nI started wit ImgUPipe having Rectangles, then I moved to use Size but\nforgot to update this.\n\nThanks for spotting\n\n>\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>\n> >\n> > -\t/* Apply the format to the configured streams output devices. */\n> > -\tbool outActive = false;\n> > -\tbool vfActive = false;\n> >  \tfor (unsigned int i = 0; i < config->size(); ++i) {\n> >  \t\tStreamConfiguration &cfg = (*config)[i];\n> >  \t\tconst PixelFormatInfo &info =\n> >  \t\t\tPixelFormatInfo::info(cfg.pixelFormat);\n> >  \t\tif (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) {\n> > -\t\t\t/*\n> > -\t\t\t * The RAW stream is configured as part of the CIO2 and\n> > -\t\t\t * no configuration is needed for the ImgU.\n> > -\t\t\t */\n> >  \t\t\tcfg.setStream(&data->rawStream_);\n> >  \t\t\tcfg.stride = cio2Format.planes[0].bpl;\n> >\n> > @@ -437,13 +431,9 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n> >  \t\t * requested.\n> >  \t\t */\n> >  \t\tif (cfg.size == maxOut && outCount > 1) {\n> > -\t\t\tret = imgu->configureOutput(cfg, &outputFormat);\n> > -\t\t\tif (ret)\n> > -\t\t\t\treturn ret;\n> > -\n> > -\t\t\tcfg.stride = outputFormat.planes[0].bpl;\n> >  \t\t\tcfg.setStream(&data->outStream_);\n> > -\t\t\toutActive = true;\n> > +\t\t\timguPipe.output.width = cfg.size.width;\n> > +\t\t\timguPipe.output.height = cfg.size.height;\n> >\n> >  \t\t\tLOG(IPU3, Debug) << \"Assigned \" << cfg.toString()\n> >  \t\t\t\t\t << \" to the main output\";\n> > @@ -457,18 +447,56 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n> >  \t\t * the smaller one to reduce the cropping required (if any) on\n> >  \t\t * the main output.\n> >  \t\t */\n> > -\t\tret = imgu->configureViewfinder(cfg, &outputFormat);\n> > -\t\tif (ret)\n> > -\t\t\treturn ret;\n> > -\n> > -\t\tcfg.stride = outputFormat.planes[0].bpl;\n> >  \t\tcfg.setStream(&data->vfStream_);\n> > -\t\tvfActive = true;\n> > +\t\timguPipe.viewfinder.width = cfg.size.width;\n> > +\t\timguPipe.viewfinder.height = cfg.size.height;\n> >\n> >  \t\tLOG(IPU3, Debug) << \"Assigned \" << cfg.toString()\n> >  \t\t\t\t << \" to the viewfinder output\";\n> >  \t}\n> >\n> > +\t/*\n> > +\t * Configure the ImgU with the collected pipe configuration and the\n> > +\t * CIO2 unit format.\n> > +\t */\n> > +\tret = imgu->configureInput(&imguPipe, &cio2Format);\n> > +\tif (ret)\n> > +\t\treturn ret;\n> > +\n> > +\t/* Apply the format to the ImgU output devices. */\n> > +\tbool outActive = false;\n> > +\tbool vfActive = false;\n> > +\tfor (unsigned int i = 0; i < config->size(); ++i) {\n> > +\t\tStreamConfiguration &cfg = (*config)[i];\n> > +\t\tStream *stream = cfg.stream();\n> > +\n> > +\t\tif (stream == &data->rawStream_) {\n> > +\t\t\t/*\n> > +\t\t\t * The RAW stream is configured as part of the CIO2 and\n> > +\t\t\t * no configuration is needed for the ImgU.\n> > +\t\t\t */\n> > +\t\t\tcontinue;\n> > +\t\t}\n> > +\n> > +\t\tif (stream == &data->outStream_) {\n> > +\t\t\tret = imgu->configureOutput(cfg, &outputFormat);\n> > +\t\t\tif (ret)\n> > +\t\t\t\treturn ret;\n> > +\n> > +\t\t\toutActive = true;\n> > +\t\t\tcfg.stride = outputFormat.planes[0].bpl;\n> > +\t\t}\n> > +\n> > +\t\tif (stream == &data->vfStream_) {\n> > +\t\t\tret = imgu->configureViewfinder(cfg, &outputFormat);\n> > +\t\t\tif (ret)\n> > +\t\t\t\treturn ret;\n> > +\n> > +\t\t\tvfActive = true;\n> > +\t\t\tcfg.stride = outputFormat.planes[0].bpl;\n> > +\t\t}\n> > +\t}\n> > +\n> >  \t/*\n> >  \t * As we need to set format also on the non-active streams, use\n> >  \t * the configuration of the active one for that purpose (there should\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 42C14BE905\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Jul 2020 07:32:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D005D60C56;\n\tThu,  2 Jul 2020 09:32:33 +0200 (CEST)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AC050603AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Jul 2020 09:32:32 +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 relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 11DD640007;\n\tThu,  2 Jul 2020 07:32:31 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","Date":"Thu, 2 Jul 2020 09:36:04 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200702073604.b4ro6u2sznrcrade@uno.localdomain>","References":"<20200701123036.51922-1-jacopo@jmondi.org>\n\t<20200701123036.51922-14-jacopo@jmondi.org>\n\t<20200701165424.GN2399385@oden.dyn.berto.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200701165424.GN2399385@oden.dyn.berto.se>","Subject":"Re: [libcamera-devel] [PATCH 13/15] libcamera: ipu3: Collect ImgU\n\tpipe configuration","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>"}}]