[{"id":833,"web_url":"https://patchwork.libcamera.org/comment/833/","msgid":"<20190221155835.GH11484@bigcity.dyn.berto.se>","date":"2019-02-21T15:58:35","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default 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 patch.\n\nOn 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> Return default configuration for the output stream produced by the imgu\n> 'output' video node.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n>  1 file changed, 3 insertions(+), 13 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 9694d0ce51ab..9065073913a2 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera *camera,\n>  {\n>  \tIPU3CameraData *data = cameraData(camera);\n>  \tstd::map<Stream *, StreamConfiguration> configs;\n> -\tV4L2SubdeviceFormat format = {};\n> -\n> -\t/*\n> -\t * FIXME: As of now, return the image format reported by the sensor.\n> -\t * In future good defaults should be provided for each stream.\n> -\t */\n> -\tif (data->sensor_->getFormat(0, &format)) {\n> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> -\t\treturn configs;\n> -\t}\n>  \n>  \tStreamConfiguration config = {};\n> -\tconfig.width = format.width;\n> -\tconfig.height = format.height;\n> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> +\tconfig.width = 2560;\n> +\tconfig.height = 1920;\n> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n\nThis is a good change and trust that the format you selected are the \ncorrect one so I have not verified it by reading or testing on the IPU3.  \n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nI'm just curious why the pixelformat changes, did something change in \nthe upstream driver or is this in preparation of some later change?\n\n>  \tconfig.bufferCount = 4;\n>  \n>  \tconfigs[&data->stream_] = config;\n> -- \n> 2.20.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["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 B0990600FB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Feb 2019 16:58:37 +0100 (CET)","by mail-lj1-x244.google.com with SMTP id z25so16603606ljk.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Feb 2019 07:58:37 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tv8sm5424534lji.51.2019.02.21.07.58.36\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 21 Feb 2019 07:58:36 -0800 (PST)"],"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\t:user-agent; bh=A1SqeTzPsRDUt/FtKrmaw5yGEe4U6Ju0hDav2cbitYY=;\n\tb=UKET00Sl6Eb+Krncjy0/UDiLcYcxEx31SpIUQnQeOpRtgeV4Y0Ld9+gMNCnA07YrhC\n\twgmltkDXdolfnaHicyCojOamnkr6iuk/ZOgtI979JhB6semhFxnusLdX5B1aB5HrPfYv\n\tO+EqsHdY0YlujJ3WTXjOqhGJisin3RpoCxP/q5hxuEGPS+Q7FOWjZEcf/U2lw527QP9S\n\tidVQFL3vuEaoJZdZICQ4a1oIrsUL+xWRNI4kfgFTXpgG2ux3YtjN1TK0C0o5MPZokHkz\n\tK97T/3EpLjZkZ4SvjSnowvTQzkuKf2funLd/OkopHAea04zXLUgO00GUL3oo9vyYv15G\n\tlhIQ==","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:user-agent;\n\tbh=A1SqeTzPsRDUt/FtKrmaw5yGEe4U6Ju0hDav2cbitYY=;\n\tb=EwC46/Kn2ZCvMR9h7HF8Zb2umz/n7SD4lGkTIvaEUTb+aPBZirymftFlpBYwfdVOMy\n\t33eFYoiMfLwrOJ+FEIP9oxhW0G6CfPLZ+UFbJLo5sDsZtzxtG//XYHMhpBYxlNeRpjIR\n\tu3WBStcQcOhZbg83iTwmDTUyGJt7m6MAAZ91AY2RuzogYFZOwAT90mYQ9neYoXZZHPSt\n\t3V+FW6BZq68drTGZrJ9QQx6pvdRDMdcy7pwr6ASWS9Cx4RlaqgkDpDGlXFDAvtoQWo8u\n\ttqlMNybOf722uE+USLAsZfvUrJXZc/bKsBdPwp0bOLizV3Fr4oaIrNKTPy6StIz8MldL\n\tftgg==","X-Gm-Message-State":"AHQUAuYCsUvqoNdxLjlaVeVOBA53qNkaOzRmgKCcUmhZZeHSitAG8SPS\n\ttrtmEyMfVyoqliK1OLzT1O/PEQ==","X-Google-Smtp-Source":"AHgI3IYX7BnSiCFNjadtghK1/AzFZjZ6zQpOFW+CUejqPoWuPkqAhxID9v+Mbrvnz7AqQuSEcqOAjg==","X-Received":"by 2002:a2e:9c09:: with SMTP id s9mr5179062lji.83.1550764717013; \n\tThu, 21 Feb 2019 07:58:37 -0800 (PST)","Date":"Thu, 21 Feb 2019 16:58:35 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190221155835.GH11484@bigcity.dyn.berto.se>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190220131757.14004-3-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Thu, 21 Feb 2019 15:58:38 -0000"}},{"id":835,"web_url":"https://patchwork.libcamera.org/comment/835/","msgid":"<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>","date":"2019-02-21T16:21:16","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> Hi Jacopo,\n>\n> Thanks for your patch.\n>\n> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> > Return default configuration for the output stream produced by the imgu\n> > 'output' video node.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> >  1 file changed, 3 insertions(+), 13 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index 9694d0ce51ab..9065073913a2 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera *camera,\n> >  {\n> >  \tIPU3CameraData *data = cameraData(camera);\n> >  \tstd::map<Stream *, StreamConfiguration> configs;\n> > -\tV4L2SubdeviceFormat format = {};\n> > -\n> > -\t/*\n> > -\t * FIXME: As of now, return the image format reported by the sensor.\n> > -\t * In future good defaults should be provided for each stream.\n> > -\t */\n> > -\tif (data->sensor_->getFormat(0, &format)) {\n> > -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> > -\t\treturn configs;\n> > -\t}\n> >\n> >  \tStreamConfiguration config = {};\n> > -\tconfig.width = format.width;\n> > -\tconfig.height = format.height;\n> > -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> > +\tconfig.width = 2560;\n> > +\tconfig.height = 1920;\n> > +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n>\n> This is a good change and trust that the format you selected are the\n> correct one so I have not verified it by reading or testing on the IPU3.\n>\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>\n> I'm just curious why the pixelformat changes, did something change in\n> the upstream driver or is this in preparation of some later change?\n>\n\nWe're preparing to provide frames to the application from the IMGU not\nfrom the CIO2 unit. The output format of the two is different.\n\nThanks\n  j\n\n> >  \tconfig.bufferCount = 4;\n> >\n> >  \tconfigs[&data->stream_] = config;\n> > --\n> > 2.20.1\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":"<jacopo@jmondi.org>","Received":["from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D33B600FB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Feb 2019 17:20:51 +0100 (CET)","from uno.localdomain (unknown [37.176.227.16])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id B83671BF209;\n\tThu, 21 Feb 2019 16:20:50 +0000 (UTC)"],"X-Originating-IP":"37.176.227.16","Date":"Thu, 21 Feb 2019 17:21:16 +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":"<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"abnknnrlkz6oatx6\"","Content-Disposition":"inline","In-Reply-To":"<20190221155835.GH11484@bigcity.dyn.berto.se>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Thu, 21 Feb 2019 16:20:51 -0000"}},{"id":840,"web_url":"https://patchwork.libcamera.org/comment/840/","msgid":"<20190221233608.GK3485@pendragon.ideasonboard.com>","date":"2019-02-21T23:36:08","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Thu, Feb 21, 2019 at 05:21:16PM +0100, Jacopo Mondi wrote:\n> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> > On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> >> Return default configuration for the output stream produced by the imgu\n> >> 'output' video node.\n> >>\n> >> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> >> ---\n> >>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> >>  1 file changed, 3 insertions(+), 13 deletions(-)\n> >>\n> >> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >> index 9694d0ce51ab..9065073913a2 100644\n> >> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera *camera,\n> >>  {\n> >>  \tIPU3CameraData *data = cameraData(camera);\n> >>  \tstd::map<Stream *, StreamConfiguration> configs;\n> >> -\tV4L2SubdeviceFormat format = {};\n> >> -\n> >> -\t/*\n> >> -\t * FIXME: As of now, return the image format reported by the sensor.\n> >> -\t * In future good defaults should be provided for each stream.\n> >> -\t */\n> >> -\tif (data->sensor_->getFormat(0, &format)) {\n> >> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> >> -\t\treturn configs;\n> >> -\t}\n> >>\n> >>  \tStreamConfiguration config = {};\n> >> -\tconfig.width = format.width;\n> >> -\tconfig.height = format.height;\n> >> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> >> +\tconfig.width = 2560;\n> >> +\tconfig.height = 1920;\n> >> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >\n> > This is a good change and trust that the format you selected are the\n> > correct one so I have not verified it by reading or testing on the IPU3.\n> >\n> > Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >\n> > I'm just curious why the pixelformat changes, did something change in\n> > the upstream driver or is this in preparation of some later change?\n> \n> We're preparing to provide frames to the application from the IMGU not\n> from the CIO2 unit. The output format of the two is different.\n\nBut until we get that, this patch breaks capture with the IPU3, doesn't\nit ? I think it should be squashed with the patch that will add ImgU\nsupport, not get merged separately.\n\n> >>  \tconfig.bufferCount = 4;\n> >>\n> >>  \tconfigs[&data->stream_] = config;","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 ECD4F600FB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 00:36:21 +0100 (CET)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F0FDE255;\n\tFri, 22 Feb 2019 00:36:18 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550792181;\n\tbh=9gRFVziPxa01YXf5W5XkrfBN8pJe6POGg+qus1SVMfk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=riqnxN2JYJ3NtEpKc5MObIsT+B1G+IG28KtLCVW9/TXhH8hHWT6yriXWN6+q6xv2e\n\tYG5219HT1/1JSaQWJ/MytPRgVTgOM6T/eAPF55fN8Q2pDqGEfsx1hxI1IoouVcEbeM\n\tTkgrbJyPZkdg9imdPOmyemFYvQ3V5t/CF6NfKm9Q=","Date":"Fri, 22 Feb 2019 01:36:08 +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":"<20190221233608.GK3485@pendragon.ideasonboard.com>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Thu, 21 Feb 2019 23:36:22 -0000"}},{"id":850,"web_url":"https://patchwork.libcamera.org/comment/850/","msgid":"<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>","date":"2019-02-22T02:30:09","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":10,"url":"https://patchwork.libcamera.org/api/people/10/","name":"Hu, Jerry W","email":"jerry.w.hu@intel.com"},"content":"Hi,\n\nMay I know why hard coded the width and height? \n> > +\tconfig.width = 2560;\n> > +\tconfig.height = 1920;\n> > +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n\nThanks,\n-Jerry\n\n-----Original Message-----\nFrom: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\nSent: Friday, February 22, 2019 12:21 AM\nTo: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nCc: libcamera-devel@lists.libcamera.org\nSubject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n\nHi Niklas,\n\nOn Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> Hi Jacopo,\n>\n> Thanks for your patch.\n>\n> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> > Return default configuration for the output stream produced by the \n> > imgu 'output' video node.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > ---\n> >  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> >  1 file changed, 3 insertions(+), 13 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp \n> > b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > index 9694d0ce51ab..9065073913a2 100644\n> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera \n> > *camera,  {\n> >  \tIPU3CameraData *data = cameraData(camera);\n> >  \tstd::map<Stream *, StreamConfiguration> configs;\n> > -\tV4L2SubdeviceFormat format = {};\n> > -\n> > -\t/*\n> > -\t * FIXME: As of now, return the image format reported by the sensor.\n> > -\t * In future good defaults should be provided for each stream.\n> > -\t */\n> > -\tif (data->sensor_->getFormat(0, &format)) {\n> > -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> > -\t\treturn configs;\n> > -\t}\n> >\n> >  \tStreamConfiguration config = {};\n> > -\tconfig.width = format.width;\n> > -\tconfig.height = format.height;\n> > -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> > +\tconfig.width = 2560;\n> > +\tconfig.height = 1920;\n> > +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n>\n> This is a good change and trust that the format you selected are the \n> correct one so I have not verified it by reading or testing on the IPU3.\n>\n> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>\n> I'm just curious why the pixelformat changes, did something change in \n> the upstream driver or is this in preparation of some later change?\n>\n\nWe're preparing to provide frames to the application from the IMGU not from the CIO2 unit. The output format of the two is different.\n\nThanks\n  j\n\n> >  \tconfig.bufferCount = 4;\n> >\n> >  \tconfigs[&data->stream_] = config;\n> > --\n> > 2.20.1\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":"<jerry.w.hu@intel.com>","Received":["from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D8CC1600FF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 03:30:22 +0100 (CET)","from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Feb 2019 18:30:14 -0800","from fmsmsx106.amr.corp.intel.com ([10.18.124.204])\n\tby fmsmga002.fm.intel.com with ESMTP; 21 Feb 2019 18:30:14 -0800","from fmsmsx155.amr.corp.intel.com (10.18.116.71) by\n\tFMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP\n\tServer (TLS) id 14.3.408.0; Thu, 21 Feb 2019 18:30:13 -0800","from shsmsx106.ccr.corp.intel.com (10.239.4.159) by\n\tFMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP\n\tServer (TLS) id 14.3.408.0; Thu, 21 Feb 2019 18:30:11 -0800","from shsmsx104.ccr.corp.intel.com ([169.254.5.102]) by\n\tSHSMSX106.ccr.corp.intel.com ([169.254.10.174]) with mapi id\n\t14.03.0415.000; Fri, 22 Feb 2019 10:30:10 +0800"],"X-Amp-Result":"SKIPPED(no attachment in message)","X-Amp-File-Uploaded":"False","X-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.58,397,1544515200\"; d=\"scan'208\";a=\"145547943\"","From":"\"Hu, Jerry W\" <jerry.w.hu@intel.com>","To":"Jacopo Mondi <jacopo@jmondi.org>, =?utf-8?q?Niklas_S=C3=B6derlund?=\n\t<niklas.soderlund@ragnatech.se>","CC":"\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","Thread-Topic":"[libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","Thread-Index":"AQHUyR69JeR4OCRcqUCyO535sbi4FqXp5ECAgAAGVgCAATAIQA==","Date":"Fri, 22 Feb 2019 02:30:09 +0000","Message-ID":"<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>","In-Reply-To":"<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","x-ctpclassification":"CTP_NT","x-titus-metadata-40":"eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGMxZjFhNGMtYzZmYS00MzhhLTljZmEtNDY5ZTQ2YmJjYjVmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiU1wvbXRKbkVkd2s4NGhRYVZWXC9mQkYzeEZiV3hYYnhHSDNjak5mNXdVSk9oQWloRU9zNFZBNUNMd0RRUDhMXC90SyJ9","dlp-product":"dlpe-windows","dlp-version":"11.0.400.15","dlp-reaction":"no-action","x-originating-ip":"[10.239.127.40]","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","MIME-Version":"1.0","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 02:30:23 -0000"}},{"id":853,"web_url":"https://patchwork.libcamera.org/comment/853/","msgid":"<20190222103305.3abbtblm2lksdmqu@uno.localdomain>","date":"2019-02-22T10:33:05","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Jerry,\n        thanks for your comment\n\nOn Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n> Hi,\n>\n> May I know why hard coded the width and height?\n> > > +\tconfig.width = 2560;\n> > > +\tconfig.height = 1920;\n> > > +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n>\n\n\nThis happens in the 'streamConfiguration()' methods, which\napplications use to obtain a known good default resolution and image\nformat the camera can provide. In this case I've selected 2560x1920\nNV12 format as \"default\" for the single stream the IPU3 camera\nprovides at the moment.\n\nOnce application receives a known default format it is then free to\nchange any parameter of that, and provide it to libcamera using the\nCamera::configureStreams() methods. The Camera instance will pass the\nconfigurations to the pipeline handlers, that wil try to apply it to\nthe hardware.\n\nTo sum up: we need to provide to applications a default configuration\nsuitable for the hardware, and that's why we hardcode those values\nhere. Starting from that default configuration, applications can\nconfigure streams with the desired width, height and pixel format and\nask libcamera to apply it to the hardware.\n\nDoes this clarify your concerns?\nThanks\n   j\n\n> Thanks,\n> -Jerry\n>\n> -----Original Message-----\n> From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n> Sent: Friday, February 22, 2019 12:21 AM\n> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> Cc: libcamera-devel@lists.libcamera.org\n> Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n>\n> Hi Niklas,\n>\n> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> > Hi Jacopo,\n> >\n> > Thanks for your patch.\n> >\n> > On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> > > Return default configuration for the output stream produced by the\n> > > imgu 'output' video node.\n> > >\n> > > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > > ---\n> > >  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> > >  1 file changed, 3 insertions(+), 13 deletions(-)\n> > >\n> > > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > index 9694d0ce51ab..9065073913a2 100644\n> > > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > > @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n> > > *camera,  {\n> > >  \tIPU3CameraData *data = cameraData(camera);\n> > >  \tstd::map<Stream *, StreamConfiguration> configs;\n> > > -\tV4L2SubdeviceFormat format = {};\n> > > -\n> > > -\t/*\n> > > -\t * FIXME: As of now, return the image format reported by the sensor.\n> > > -\t * In future good defaults should be provided for each stream.\n> > > -\t */\n> > > -\tif (data->sensor_->getFormat(0, &format)) {\n> > > -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> > > -\t\treturn configs;\n> > > -\t}\n> > >\n> > >  \tStreamConfiguration config = {};\n> > > -\tconfig.width = format.width;\n> > > -\tconfig.height = format.height;\n> > > -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> > > +\tconfig.width = 2560;\n> > > +\tconfig.height = 1920;\n> > > +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >\n> > This is a good change and trust that the format you selected are the\n> > correct one so I have not verified it by reading or testing on the IPU3.\n> >\n> > Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >\n> > I'm just curious why the pixelformat changes, did something change in\n> > the upstream driver or is this in preparation of some later change?\n> >\n>\n> We're preparing to provide frames to the application from the IMGU not from the CIO2 unit. The output format of the two is different.\n>\n> Thanks\n>   j\n>\n> > >  \tconfig.bufferCount = 4;\n> > >\n> > >  \tconfigs[&data->stream_] = config;\n> > > --\n> > > 2.20.1\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":"<jacopo@jmondi.org>","Received":["from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 061A1600FD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 11:32:39 +0100 (CET)","from uno.localdomain (unknown [31.157.247.153])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 11AB6FF807;\n\tFri, 22 Feb 2019 10:32:37 +0000 (UTC)"],"X-Originating-IP":"31.157.247.153","Date":"Fri, 22 Feb 2019 11:33:05 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"\"Hu, Jerry W\" <jerry.w.hu@intel.com>","Cc":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","Message-ID":"<20190222103305.3abbtblm2lksdmqu@uno.localdomain>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"vcnqtaqznci2kkcw\"","Content-Disposition":"inline","In-Reply-To":"<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 10:32:39 -0000"}},{"id":858,"web_url":"https://patchwork.libcamera.org/comment/858/","msgid":"<20190222105604.GH3522@pendragon.ideasonboard.com>","date":"2019-02-22T10:56:04","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Fri, Feb 22, 2019 at 11:33:05AM +0100, Jacopo Mondi wrote:\n> Hi Jerry,\n>         thanks for your comment\n> \n> On Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n> > Hi,\n> >\n> > May I know why hard coded the width and height?\n> >>> +\tconfig.width = 2560;\n> >>> +\tconfig.height = 1920;\n> >>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >\n> \n> \n> This happens in the 'streamConfiguration()' methods, which\n> applications use to obtain a known good default resolution and image\n> format the camera can provide. In this case I've selected 2560x1920\n> NV12 format as \"default\" for the single stream the IPU3 camera\n> provides at the moment.\n> \n> Once application receives a known default format it is then free to\n> change any parameter of that, and provide it to libcamera using the\n> Camera::configureStreams() methods. The Camera instance will pass the\n> configurations to the pipeline handlers, that wil try to apply it to\n> the hardware.\n> \n> To sum up: we need to provide to applications a default configuration\n> suitable for the hardware, and that's why we hardcode those values\n> here. Starting from that default configuration, applications can\n> configure streams with the desired width, height and pixel format and\n> ask libcamera to apply it to the hardware.\n\nAs mentioned in a previous e-mail I think you will have to make this\ndynamic. The above resolution may be fine on the hardware we use for\ntesting the IPU3, but it needs to be sensor-dependent.\n\n> Does this clarify your concerns?\n> \n> > -----Original Message-----\n> > From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n> > Sent: Friday, February 22, 2019 12:21 AM\n> > To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > Cc: libcamera-devel@lists.libcamera.org\n> > Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n> >\n> > Hi Niklas,\n> >\n> > On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> >> Hi Jacopo,\n> >>\n> >> Thanks for your patch.\n> >>\n> >> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> >>> Return default configuration for the output stream produced by the\n> >>> imgu 'output' video node.\n> >>>\n> >>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> >>> ---\n> >>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> >>>  1 file changed, 3 insertions(+), 13 deletions(-)\n> >>>\n> >>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>> index 9694d0ce51ab..9065073913a2 100644\n> >>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n> >>> *camera,  {\n> >>>  \tIPU3CameraData *data = cameraData(camera);\n> >>>  \tstd::map<Stream *, StreamConfiguration> configs;\n> >>> -\tV4L2SubdeviceFormat format = {};\n> >>> -\n> >>> -\t/*\n> >>> -\t * FIXME: As of now, return the image format reported by the sensor.\n> >>> -\t * In future good defaults should be provided for each stream.\n> >>> -\t */\n> >>> -\tif (data->sensor_->getFormat(0, &format)) {\n> >>> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> >>> -\t\treturn configs;\n> >>> -\t}\n> >>>\n> >>>  \tStreamConfiguration config = {};\n> >>> -\tconfig.width = format.width;\n> >>> -\tconfig.height = format.height;\n> >>> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> >>> +\tconfig.width = 2560;\n> >>> +\tconfig.height = 1920;\n> >>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >>\n> >> This is a good change and trust that the format you selected are the\n> >> correct one so I have not verified it by reading or testing on the IPU3.\n> >>\n> >> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >>\n> >> I'm just curious why the pixelformat changes, did something change in\n> >> the upstream driver or is this in preparation of some later change?\n> >>\n> >\n> > We're preparing to provide frames to the application from the IMGU\n> > not from the CIO2 unit. The output format of the two is different.\n> >\n> >>>  \tconfig.bufferCount = 4;\n> >>>\n> >>>  \tconfigs[&data->stream_] = config;","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 9C00F600FD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 11:56:09 +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 EFC61255;\n\tFri, 22 Feb 2019 11:56:08 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550832969;\n\tbh=LD7i6jGRUvOS3odaoJGjvjDa/B7C+LwhJVp1mOAnb64=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=L+kAD8bQFEk6DqY7woJDbULuJmO59ysSonLly5DAF74aPL9q54FNwdG7DIHOK9Ps5\n\tWNsDHLK524IdQ0FirRUMa4CRoWCcbucDAscGO8WlBgxU6rwjVOkV0bYTtShuY+TSQ8\n\tqoLnMr7QVIc4k03cwT4FI11RU+1CNQGsBAENEq2Y=","Date":"Fri, 22 Feb 2019 12:56:04 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"\"Hu, Jerry W\" <jerry.w.hu@intel.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","Message-ID":"<20190222105604.GH3522@pendragon.ideasonboard.com>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>\n\t<20190222103305.3abbtblm2lksdmqu@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190222103305.3abbtblm2lksdmqu@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 10:56:09 -0000"}},{"id":859,"web_url":"https://patchwork.libcamera.org/comment/859/","msgid":"<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>","date":"2019-02-22T10:57:35","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn 22/02/2019 10:33, Jacopo Mondi wrote:\n> Hi Jerry,\n>         thanks for your comment\n> \n> On Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n>> Hi,\n>>\n>> May I know why hard coded the width and height?\n>>>> +\tconfig.width = 2560;\n>>>> +\tconfig.height = 1920;\n>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n>>\n> \n> \n> This happens in the 'streamConfiguration()' methods, which\n> applications use to obtain a known good default resolution and image\n> format the camera can provide. In this case I've selected 2560x1920\n> NV12 format as \"default\" for the single stream the IPU3 camera\n> provides at the moment.\n> \n> Once application receives a known default format it is then free to\n> change any parameter of that, and provide it to libcamera using the\n> Camera::configureStreams() methods. The Camera instance will pass the\n> configurations to the pipeline handlers, that wil try to apply it to\n> the hardware.\n> \n> To sum up: we need to provide to applications a default configuration\n> suitable for the hardware, and that's why we hardcode those values\n> here. Starting from that default configuration, applications can\n> configure streams with the desired width, height and pixel format and\n> ask libcamera to apply it to the hardware.\n> \n> Does this clarify your concerns?\n\nI think it was discussed somewhere but I'm not sure where, but what is\nthe reason why we can't ask the hardware for it's \"current\" format to\nset the 'default' ?\n\nI feel like anything we define statically in the pipeline is just as\nwrong as any initial default provided by the hardware ..\n\n--\nKieran\n\n\n\n\n> Thanks\n>    j\n> \n>> Thanks,\n>> -Jerry\n>>\n>> -----Original Message-----\n>> From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n>> Sent: Friday, February 22, 2019 12:21 AM\n>> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>> Cc: libcamera-devel@lists.libcamera.org\n>> Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n>>\n>> Hi Niklas,\n>>\n>> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n>>> Hi Jacopo,\n>>>\n>>> Thanks for your patch.\n>>>\n>>> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n>>>> Return default configuration for the output stream produced by the\n>>>> imgu 'output' video node.\n>>>>\n>>>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n>>>> ---\n>>>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n>>>>  1 file changed, 3 insertions(+), 13 deletions(-)\n>>>>\n>>>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n>>>> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n>>>> index 9694d0ce51ab..9065073913a2 100644\n>>>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n>>>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n>>>> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n>>>> *camera,  {\n>>>>  \tIPU3CameraData *data = cameraData(camera);\n>>>>  \tstd::map<Stream *, StreamConfiguration> configs;\n>>>> -\tV4L2SubdeviceFormat format = {};\n>>>> -\n>>>> -\t/*\n>>>> -\t * FIXME: As of now, return the image format reported by the sensor.\n>>>> -\t * In future good defaults should be provided for each stream.\n>>>> -\t */\n>>>> -\tif (data->sensor_->getFormat(0, &format)) {\n>>>> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n>>>> -\t\treturn configs;\n>>>> -\t}\n>>>>\n>>>>  \tStreamConfiguration config = {};\n>>>> -\tconfig.width = format.width;\n>>>> -\tconfig.height = format.height;\n>>>> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n>>>> +\tconfig.width = 2560;\n>>>> +\tconfig.height = 1920;\n>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n>>>\n>>> This is a good change and trust that the format you selected are the\n>>> correct one so I have not verified it by reading or testing on the IPU3.\n>>>\n>>> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>>>\n>>> I'm just curious why the pixelformat changes, did something change in\n>>> the upstream driver or is this in preparation of some later change?\n>>>\n>>\n>> We're preparing to provide frames to the application from the IMGU not from the CIO2 unit. The output format of the two is different.\n>>\n>> Thanks\n>>   j\n>>\n>>>>  \tconfig.bufferCount = 4;\n>>>>\n>>>>  \tconfigs[&data->stream_] = config;\n>>>> --\n>>>> 2.20.1\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\n>>>\n>>> _______________________________________________\n>>> libcamera-devel mailing list\n>>> libcamera-devel@lists.libcamera.org\n>>> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<kieran.bingham@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 9616C600FD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 11:57:38 +0100 (CET)","from [192.168.0.21]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 17CC2255;\n\tFri, 22 Feb 2019 11:57:38 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550833058;\n\tbh=v4jnjrlw6skJ5jWWe3JYCBWUdPZCJpvpae/EcU1gF+k=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=YJmjzHbZ5bhH5TYlDRA/8WAaU7Xz35do9bau7mrAQ1vop/u7K+nxnQQ0z71NbfXvX\n\t/uMH0QhCq0TsJDFTLI7qGNak4RGZEdPZCIfcvMPLNSlARZfV0XkAvBN+FxClbDMbM/\n\t8lPODRE+hjAAO18duaQtMwccJN/H4lMHEJSYxXHs=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Jacopo Mondi <jacopo@jmondi.org>, \"Hu, Jerry W\" <jerry.w.hu@intel.com>","Cc":"\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>\n\t<20190222103305.3abbtblm2lksdmqu@uno.localdomain>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\t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\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>","Date":"Fri, 22 Feb 2019 10:57:35 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.4.0","MIME-Version":"1.0","In-Reply-To":"<20190222103305.3abbtblm2lksdmqu@uno.localdomain>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 10:57:38 -0000"}},{"id":860,"web_url":"https://patchwork.libcamera.org/comment/860/","msgid":"<20190222110532.GI3522@pendragon.ideasonboard.com>","date":"2019-02-22T11:05:32","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Fri, Feb 22, 2019 at 10:57:35AM +0000, Kieran Bingham wrote:\n> On 22/02/2019 10:33, Jacopo Mondi wrote:\n> > On Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n> >> Hi,\n> >>\n> >> May I know why hard coded the width and height?\n> >>>> +\tconfig.width = 2560;\n> >>>> +\tconfig.height = 1920;\n> >>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> > \n> > This happens in the 'streamConfiguration()' methods, which\n> > applications use to obtain a known good default resolution and image\n> > format the camera can provide. In this case I've selected 2560x1920\n> > NV12 format as \"default\" for the single stream the IPU3 camera\n> > provides at the moment.\n> > \n> > Once application receives a known default format it is then free to\n> > change any parameter of that, and provide it to libcamera using the\n> > Camera::configureStreams() methods. The Camera instance will pass the\n> > configurations to the pipeline handlers, that wil try to apply it to\n> > the hardware.\n> > \n> > To sum up: we need to provide to applications a default configuration\n> > suitable for the hardware, and that's why we hardcode those values\n> > here. Starting from that default configuration, applications can\n> > configure streams with the desired width, height and pixel format and\n> > ask libcamera to apply it to the hardware.\n> > \n> > Does this clarify your concerns?\n> \n> I think it was discussed somewhere but I'm not sure where, but what is\n> the reason why we can't ask the hardware for it's \"current\" format to\n> set the 'default' ?\n\nThe current format isn't a good idea, as it can vary based on the\nhistory of device usage, and is thus not suitable as a default. I\nhowever agree that we should compute a reasonable default based on the\nhardware capabilities.\n\n> I feel like anything we define statically in the pipeline is just as\n> wrong as any initial default provided by the hardware ..\n> \n> >> -----Original Message-----\n> >> From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n> >> Sent: Friday, February 22, 2019 12:21 AM\n> >> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >> Cc: libcamera-devel@lists.libcamera.org\n> >> Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n> >>\n> >> Hi Niklas,\n> >>\n> >> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> >>> Hi Jacopo,\n> >>>\n> >>> Thanks for your patch.\n> >>>\n> >>> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> >>>> Return default configuration for the output stream produced by the\n> >>>> imgu 'output' video node.\n> >>>>\n> >>>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> >>>> ---\n> >>>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> >>>>  1 file changed, 3 insertions(+), 13 deletions(-)\n> >>>>\n> >>>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>> index 9694d0ce51ab..9065073913a2 100644\n> >>>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n> >>>> *camera,  {\n> >>>>  \tIPU3CameraData *data = cameraData(camera);\n> >>>>  \tstd::map<Stream *, StreamConfiguration> configs;\n> >>>> -\tV4L2SubdeviceFormat format = {};\n> >>>> -\n> >>>> -\t/*\n> >>>> -\t * FIXME: As of now, return the image format reported by the sensor.\n> >>>> -\t * In future good defaults should be provided for each stream.\n> >>>> -\t */\n> >>>> -\tif (data->sensor_->getFormat(0, &format)) {\n> >>>> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> >>>> -\t\treturn configs;\n> >>>> -\t}\n> >>>>\n> >>>>  \tStreamConfiguration config = {};\n> >>>> -\tconfig.width = format.width;\n> >>>> -\tconfig.height = format.height;\n> >>>> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> >>>> +\tconfig.width = 2560;\n> >>>> +\tconfig.height = 1920;\n> >>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >>>\n> >>> This is a good change and trust that the format you selected are the\n> >>> correct one so I have not verified it by reading or testing on the IPU3.\n> >>>\n> >>> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >>>\n> >>> I'm just curious why the pixelformat changes, did something change in\n> >>> the upstream driver or is this in preparation of some later change?\n> >>>\n> >>\n> >> We're preparing to provide frames to the application from the IMGU\n> >> not from the CIO2 unit. The output format of the two is different.\n> >>\n> >>>>  \tconfig.bufferCount = 4;\n> >>>>\n> >>>>  \tconfigs[&data->stream_] = config;","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 9837E600FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 12:05:37 +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 C990F255;\n\tFri, 22 Feb 2019 12:05:36 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550833537;\n\tbh=z8KTROTfZ8teDPLrywGsEe8EOoFRuIS/hCRKggN3R4E=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Sb01M0Jc0AN76mrsTk+hluxcC4AIbhnIj7LenHsijDuG0FI3+ySHf6nj9v/MoYDQu\n\tr/i3F9Lwc9sdXZwBhdE4A6Xd+c9vYaVTloxXEYLVrjbzMKWDNO9c+UFG0TPHXdkmw/\n\toyMdSNI1axtntRPASFmaRQh+QIWUUCil61XcJ4Qk=","Date":"Fri, 22 Feb 2019 13:05:32 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo@jmondi.org>, \"Hu, Jerry W\" <jerry.w.hu@intel.com>, \n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","Message-ID":"<20190222110532.GI3522@pendragon.ideasonboard.com>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>\n\t<20190222103305.3abbtblm2lksdmqu@uno.localdomain>\n\t<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 11:05:37 -0000"}},{"id":861,"web_url":"https://patchwork.libcamera.org/comment/861/","msgid":"<20190222110842.nsuk76cfcnj6uktz@uno.localdomain>","date":"2019-02-22T11:08:42","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Kieran, Laurent,\n\nOn Fri, Feb 22, 2019 at 10:57:35AM +0000, Kieran Bingham wrote:\n> Hi Jacopo,\n>\n> On 22/02/2019 10:33, Jacopo Mondi wrote:\n> > Hi Jerry,\n> >         thanks for your comment\n> >\n> > On Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n> >> Hi,\n> >>\n> >> May I know why hard coded the width and height?\n> >>>> +\tconfig.width = 2560;\n> >>>> +\tconfig.height = 1920;\n> >>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >>\n> >\n> >\n> > This happens in the 'streamConfiguration()' methods, which\n> > applications use to obtain a known good default resolution and image\n> > format the camera can provide. In this case I've selected 2560x1920\n> > NV12 format as \"default\" for the single stream the IPU3 camera\n> > provides at the moment.\n> >\n> > Once application receives a known default format it is then free to\n> > change any parameter of that, and provide it to libcamera using the\n> > Camera::configureStreams() methods. The Camera instance will pass the\n> > configurations to the pipeline handlers, that wil try to apply it to\n> > the hardware.\n> >\n> > To sum up: we need to provide to applications a default configuration\n> > suitable for the hardware, and that's why we hardcode those values\n> > here. Starting from that default configuration, applications can\n> > configure streams with the desired width, height and pixel format and\n> > ask libcamera to apply it to the hardware.\n> >\n> > Does this clarify your concerns?\n>\n> I think it was discussed somewhere but I'm not sure where, but what is\n> the reason why we can't ask the hardware for it's \"current\" format to\n> set the 'default' ?\n>\n\nBecause at the current stage the 'hardware' is both the sensor\nprovided resolution and the output resolution provided by the ImgU,\nwhich do not match, if we use their defaults. And as images will be\nprovided from ImgU not the CIO2 as before, I cannot just claim the\nformat applied on the sensor and report that.\n\nThat resolution is known to work for the current use case, and I put\nit there not to break capture. Later on, with full ImgU support should\nwestart from the sensor resolution and adjust it to one the ImgU can\nprovide, or start from the default one applied to the ImgU unit, and\nmake sure the sensor can provide something big enough to fit into\nthat?\n\nAlso, I know realize this was probably what Jerry was asking in is\nemail, not an explanation of the stream format negotiation\nprocedure...\n\n> I feel like anything we define statically in the pipeline is just as\n> wrong as any initial default provided by the hardware ..\n>\n\nWhy do you consider initial defaults provided by the hardware wrong? I\nmean, the issue here to me is \"which default\", but somewhere it has to\nbe defined, right?\n\nThanks\n  j\n\n> --\n> Kieran\n>\n>\n>\n>\n> > Thanks\n> >    j\n> >\n> >> Thanks,\n> >> -Jerry\n> >>\n> >> -----Original Message-----\n> >> From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n> >> Sent: Friday, February 22, 2019 12:21 AM\n> >> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >> Cc: libcamera-devel@lists.libcamera.org\n> >> Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n> >>\n> >> Hi Niklas,\n> >>\n> >> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> >>> Hi Jacopo,\n> >>>\n> >>> Thanks for your patch.\n> >>>\n> >>> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> >>>> Return default configuration for the output stream produced by the\n> >>>> imgu 'output' video node.\n> >>>>\n> >>>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> >>>> ---\n> >>>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> >>>>  1 file changed, 3 insertions(+), 13 deletions(-)\n> >>>>\n> >>>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>> index 9694d0ce51ab..9065073913a2 100644\n> >>>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n> >>>> *camera,  {\n> >>>>  \tIPU3CameraData *data = cameraData(camera);\n> >>>>  \tstd::map<Stream *, StreamConfiguration> configs;\n> >>>> -\tV4L2SubdeviceFormat format = {};\n> >>>> -\n> >>>> -\t/*\n> >>>> -\t * FIXME: As of now, return the image format reported by the sensor.\n> >>>> -\t * In future good defaults should be provided for each stream.\n> >>>> -\t */\n> >>>> -\tif (data->sensor_->getFormat(0, &format)) {\n> >>>> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> >>>> -\t\treturn configs;\n> >>>> -\t}\n> >>>>\n> >>>>  \tStreamConfiguration config = {};\n> >>>> -\tconfig.width = format.width;\n> >>>> -\tconfig.height = format.height;\n> >>>> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> >>>> +\tconfig.width = 2560;\n> >>>> +\tconfig.height = 1920;\n> >>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >>>\n> >>> This is a good change and trust that the format you selected are the\n> >>> correct one so I have not verified it by reading or testing on the IPU3.\n> >>>\n> >>> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >>>\n> >>> I'm just curious why the pixelformat changes, did something change in\n> >>> the upstream driver or is this in preparation of some later change?\n> >>>\n> >>\n> >> We're preparing to provide frames to the application from the IMGU not from the CIO2 unit. The output format of the two is different.\n> >>\n> >> Thanks\n> >>   j\n> >>\n> >>>>  \tconfig.bufferCount = 4;\n> >>>>\n> >>>>  \tconfigs[&data->stream_] = config;\n> >>>> --\n> >>>> 2.20.1\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\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> --\n> Kieran","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DE4F6600FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 12:08:16 +0100 (CET)","from uno.localdomain (unknown [31.157.247.153])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 83888240011;\n\tFri, 22 Feb 2019 11:08:15 +0000 (UTC)"],"X-Originating-IP":"31.157.247.153","Date":"Fri, 22 Feb 2019 12:08:42 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"\"Hu, Jerry W\" <jerry.w.hu@intel.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","Message-ID":"<20190222110842.nsuk76cfcnj6uktz@uno.localdomain>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>\n\t<20190222103305.3abbtblm2lksdmqu@uno.localdomain>\n\t<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"h4pfxxyz4udgimoe\"","Content-Disposition":"inline","In-Reply-To":"<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 11:08:17 -0000"}},{"id":862,"web_url":"https://patchwork.libcamera.org/comment/862/","msgid":"<20190222114414.GR3522@pendragon.ideasonboard.com>","date":"2019-02-22T11:44:14","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Fri, Feb 22, 2019 at 12:08:42PM +0100, Jacopo Mondi wrote:\n> On Fri, Feb 22, 2019 at 10:57:35AM +0000, Kieran Bingham wrote:\n> > On 22/02/2019 10:33, Jacopo Mondi wrote:\n> >> On Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n> >>> Hi,\n> >>>\n> >>> May I know why hard coded the width and height?\n> >>>>> +\tconfig.width = 2560;\n> >>>>> +\tconfig.height = 1920;\n> >>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >>\n> >> This happens in the 'streamConfiguration()' methods, which\n> >> applications use to obtain a known good default resolution and image\n> >> format the camera can provide. In this case I've selected 2560x1920\n> >> NV12 format as \"default\" for the single stream the IPU3 camera\n> >> provides at the moment.\n> >>\n> >> Once application receives a known default format it is then free to\n> >> change any parameter of that, and provide it to libcamera using the\n> >> Camera::configureStreams() methods. The Camera instance will pass the\n> >> configurations to the pipeline handlers, that wil try to apply it to\n> >> the hardware.\n> >>\n> >> To sum up: we need to provide to applications a default configuration\n> >> suitable for the hardware, and that's why we hardcode those values\n> >> here. Starting from that default configuration, applications can\n> >> configure streams with the desired width, height and pixel format and\n> >> ask libcamera to apply it to the hardware.\n> >>\n> >> Does this clarify your concerns?\n> >\n> > I think it was discussed somewhere but I'm not sure where, but what is\n> > the reason why we can't ask the hardware for it's \"current\" format to\n> > set the 'default' ?\n> \n> Because at the current stage the 'hardware' is both the sensor\n> provided resolution and the output resolution provided by the ImgU,\n> which do not match, if we use their defaults. And as images will be\n> provided from ImgU not the CIO2 as before, I cannot just claim the\n> format applied on the sensor and report that.\n\nThe ImgU is a memory to memory device, it can operate on pretty much any\ninput resolution, includes a scaler, and can crop. The default\nresolution should come from the sensor, not the ImgU.\n\n> That resolution is known to work for the current use case, and I put\n> it there not to break capture. Later on, with full ImgU support should\n> westart from the sensor resolution and adjust it to one the ImgU can\n> provide, or start from the default one applied to the ImgU unit, and\n> make sure the sensor can provide something big enough to fit into\n> that?\n> \n> Also, I know realize this was probably what Jerry was asking in is\n> email, not an explanation of the stream format negotiation\n> procedure...\n> \n> > I feel like anything we define statically in the pipeline is just as\n> > wrong as any initial default provided by the hardware ..\n> \n> Why do you consider initial defaults provided by the hardware wrong? I\n> mean, the issue here to me is \"which default\", but somewhere it has to\n> be defined, right?\n> \n> >>> -----Original Message-----\n> >>> From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n> >>> Sent: Friday, February 22, 2019 12:21 AM\n> >>> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >>> Cc: libcamera-devel@lists.libcamera.org\n> >>> Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n> >>>\n> >>> Hi Niklas,\n> >>>\n> >>> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> >>>> Hi Jacopo,\n> >>>>\n> >>>> Thanks for your patch.\n> >>>>\n> >>>> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> >>>>> Return default configuration for the output stream produced by the\n> >>>>> imgu 'output' video node.\n> >>>>>\n> >>>>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> >>>>> ---\n> >>>>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> >>>>>  1 file changed, 3 insertions(+), 13 deletions(-)\n> >>>>>\n> >>>>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>> index 9694d0ce51ab..9065073913a2 100644\n> >>>>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n> >>>>> *camera,  {\n> >>>>>  \tIPU3CameraData *data = cameraData(camera);\n> >>>>>  \tstd::map<Stream *, StreamConfiguration> configs;\n> >>>>> -\tV4L2SubdeviceFormat format = {};\n> >>>>> -\n> >>>>> -\t/*\n> >>>>> -\t * FIXME: As of now, return the image format reported by the sensor.\n> >>>>> -\t * In future good defaults should be provided for each stream.\n> >>>>> -\t */\n> >>>>> -\tif (data->sensor_->getFormat(0, &format)) {\n> >>>>> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> >>>>> -\t\treturn configs;\n> >>>>> -\t}\n> >>>>>\n> >>>>>  \tStreamConfiguration config = {};\n> >>>>> -\tconfig.width = format.width;\n> >>>>> -\tconfig.height = format.height;\n> >>>>> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> >>>>> +\tconfig.width = 2560;\n> >>>>> +\tconfig.height = 1920;\n> >>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >>>>\n> >>>> This is a good change and trust that the format you selected are the\n> >>>> correct one so I have not verified it by reading or testing on the IPU3.\n> >>>>\n> >>>> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >>>>\n> >>>> I'm just curious why the pixelformat changes, did something change in\n> >>>> the upstream driver or is this in preparation of some later change?\n> >>>>\n> >>>\n> >>> We're preparing to provide frames to the application from the IMGU not from the CIO2 unit. The output format of the two is different.\n> >>>\n> >>>>>  \tconfig.bufferCount = 4;\n> >>>>>\n> >>>>>  \tconfigs[&data->stream_] = config;","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 1CE84600FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 12:44:20 +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 475EA2D2;\n\tFri, 22 Feb 2019 12:44:19 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550835859;\n\tbh=lq+4UqcFx56H9Z28H9nubP0TnK4PlTCazLJOMDmMXMs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=aLVCgYv7/aheUQjx8x26olN/qyd6PiNjEdjttjidrYrOfqwESZmEGuBqaY1XZjcDY\n\t9yUJG8AsFYHZ3lFraxCKhULvptRCujuVgHQVlOkZhWO00xCj9YoSYpuyz6V1jIGY/n\n\tseZun1RrgtwGRCHwW4u0l+dTkZgudFQ7fignplN4=","Date":"Fri, 22 Feb 2019 13:44:14 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","Message-ID":"<20190222114414.GR3522@pendragon.ideasonboard.com>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>\n\t<20190222103305.3abbtblm2lksdmqu@uno.localdomain>\n\t<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>\n\t<20190222110842.nsuk76cfcnj6uktz@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190222110842.nsuk76cfcnj6uktz@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 11:44:20 -0000"}},{"id":863,"web_url":"https://patchwork.libcamera.org/comment/863/","msgid":"<20190222120515.y7e5yzfwr2wjoksp@uno.localdomain>","date":"2019-02-22T12:05:15","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Fri, Feb 22, 2019 at 01:44:14PM +0200, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> On Fri, Feb 22, 2019 at 12:08:42PM +0100, Jacopo Mondi wrote:\n> > On Fri, Feb 22, 2019 at 10:57:35AM +0000, Kieran Bingham wrote:\n> > > On 22/02/2019 10:33, Jacopo Mondi wrote:\n> > >> On Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n> > >>> Hi,\n> > >>>\n> > >>> May I know why hard coded the width and height?\n> > >>>>> +\tconfig.width = 2560;\n> > >>>>> +\tconfig.height = 1920;\n> > >>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> > >>\n> > >> This happens in the 'streamConfiguration()' methods, which\n> > >> applications use to obtain a known good default resolution and image\n> > >> format the camera can provide. In this case I've selected 2560x1920\n> > >> NV12 format as \"default\" for the single stream the IPU3 camera\n> > >> provides at the moment.\n> > >>\n> > >> Once application receives a known default format it is then free to\n> > >> change any parameter of that, and provide it to libcamera using the\n> > >> Camera::configureStreams() methods. The Camera instance will pass the\n> > >> configurations to the pipeline handlers, that wil try to apply it to\n> > >> the hardware.\n> > >>\n> > >> To sum up: we need to provide to applications a default configuration\n> > >> suitable for the hardware, and that's why we hardcode those values\n> > >> here. Starting from that default configuration, applications can\n> > >> configure streams with the desired width, height and pixel format and\n> > >> ask libcamera to apply it to the hardware.\n> > >>\n> > >> Does this clarify your concerns?\n> > >\n> > > I think it was discussed somewhere but I'm not sure where, but what is\n> > > the reason why we can't ask the hardware for it's \"current\" format to\n> > > set the 'default' ?\n> >\n> > Because at the current stage the 'hardware' is both the sensor\n> > provided resolution and the output resolution provided by the ImgU,\n> > which do not match, if we use their defaults. And as images will be\n> > provided from ImgU not the CIO2 as before, I cannot just claim the\n> > format applied on the sensor and report that.\n>\n> The ImgU is a memory to memory device, it can operate on pretty much any\n> input resolution, includes a scaler, and can crop. The default\n> resolution should come from the sensor, not the ImgU.\n>\n\nTrue indeed, but if I'm not mistaken, the ImgU has a default\nprogrammed to be 1920x1080, not all sensors can provide that\nresolution (yes, I understand, it's a corner\ncase, most modern sensors can, but I feel this is worth checking,\nisn't it?)\n\nThanks\n  j\n\n\n> > That resolution is known to work for the current use case, and I put\n> > it there not to break capture. Later on, with full ImgU support should\n> > westart from the sensor resolution and adjust it to one the ImgU can\n> > provide, or start from the default one applied to the ImgU unit, and\n> > make sure the sensor can provide something big enough to fit into\n> > that?\n> >\n> > Also, I know realize this was probably what Jerry was asking in is\n> > email, not an explanation of the stream format negotiation\n> > procedure...\n> >\n> > > I feel like anything we define statically in the pipeline is just as\n> > > wrong as any initial default provided by the hardware ..\n> >\n> > Why do you consider initial defaults provided by the hardware wrong? I\n> > mean, the issue here to me is \"which default\", but somewhere it has to\n> > be defined, right?\n> >\n> > >>> -----Original Message-----\n> > >>> From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n> > >>> Sent: Friday, February 22, 2019 12:21 AM\n> > >>> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > >>> Cc: libcamera-devel@lists.libcamera.org\n> > >>> Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n> > >>>\n> > >>> Hi Niklas,\n> > >>>\n> > >>> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> > >>>> Hi Jacopo,\n> > >>>>\n> > >>>> Thanks for your patch.\n> > >>>>\n> > >>>> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> > >>>>> Return default configuration for the output stream produced by the\n> > >>>>> imgu 'output' video node.\n> > >>>>>\n> > >>>>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> > >>>>> ---\n> > >>>>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> > >>>>>  1 file changed, 3 insertions(+), 13 deletions(-)\n> > >>>>>\n> > >>>>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > >>>>> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > >>>>> index 9694d0ce51ab..9065073913a2 100644\n> > >>>>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > >>>>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> > >>>>> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n> > >>>>> *camera,  {\n> > >>>>>  \tIPU3CameraData *data = cameraData(camera);\n> > >>>>>  \tstd::map<Stream *, StreamConfiguration> configs;\n> > >>>>> -\tV4L2SubdeviceFormat format = {};\n> > >>>>> -\n> > >>>>> -\t/*\n> > >>>>> -\t * FIXME: As of now, return the image format reported by the sensor.\n> > >>>>> -\t * In future good defaults should be provided for each stream.\n> > >>>>> -\t */\n> > >>>>> -\tif (data->sensor_->getFormat(0, &format)) {\n> > >>>>> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> > >>>>> -\t\treturn configs;\n> > >>>>> -\t}\n> > >>>>>\n> > >>>>>  \tStreamConfiguration config = {};\n> > >>>>> -\tconfig.width = format.width;\n> > >>>>> -\tconfig.height = format.height;\n> > >>>>> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> > >>>>> +\tconfig.width = 2560;\n> > >>>>> +\tconfig.height = 1920;\n> > >>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> > >>>>\n> > >>>> This is a good change and trust that the format you selected are the\n> > >>>> correct one so I have not verified it by reading or testing on the IPU3.\n> > >>>>\n> > >>>> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > >>>>\n> > >>>> I'm just curious why the pixelformat changes, did something change in\n> > >>>> the upstream driver or is this in preparation of some later change?\n> > >>>>\n> > >>>\n> > >>> We're preparing to provide frames to the application from the IMGU not from the CIO2 unit. The output format of the two is different.\n> > >>>\n> > >>>>>  \tconfig.bufferCount = 4;\n> > >>>>>\n> > >>>>>  \tconfigs[&data->stream_] = config;\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 04DC6600FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 13:04:49 +0100 (CET)","from uno.localdomain (unknown [31.157.247.153])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 1A7A1FF80B;\n\tFri, 22 Feb 2019 12:04:47 +0000 (UTC)"],"X-Originating-IP":"31.157.247.153","Date":"Fri, 22 Feb 2019 13:05:15 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","Message-ID":"<20190222120515.y7e5yzfwr2wjoksp@uno.localdomain>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>\n\t<20190222103305.3abbtblm2lksdmqu@uno.localdomain>\n\t<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>\n\t<20190222110842.nsuk76cfcnj6uktz@uno.localdomain>\n\t<20190222114414.GR3522@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"q2ytptgs6epxoex7\"","Content-Disposition":"inline","In-Reply-To":"<20190222114414.GR3522@pendragon.ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 12:04:50 -0000"}},{"id":864,"web_url":"https://patchwork.libcamera.org/comment/864/","msgid":"<1d341ec2-baae-2f66-c013-3f7e22446e71@ideasonboard.com>","date":"2019-02-22T12:05:40","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Laurent, Jacopo,\n\nOn 22/02/2019 11:44, Laurent Pinchart wrote:\n> Hi Jacopo,\n> \n> On Fri, Feb 22, 2019 at 12:08:42PM +0100, Jacopo Mondi wrote:\n>> On Fri, Feb 22, 2019 at 10:57:35AM +0000, Kieran Bingham wrote:\n>>> On 22/02/2019 10:33, Jacopo Mondi wrote:\n>>>> On Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n>>>>> Hi,\n>>>>>\n>>>>> May I know why hard coded the width and height?\n>>>>>>> +\tconfig.width = 2560;\n>>>>>>> +\tconfig.height = 1920;\n>>>>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n>>>>\n>>>> This happens in the 'streamConfiguration()' methods, which\n>>>> applications use to obtain a known good default resolution and image\n>>>> format the camera can provide. In this case I've selected 2560x1920\n>>>> NV12 format as \"default\" for the single stream the IPU3 camera\n>>>> provides at the moment.\n>>>>\n>>>> Once application receives a known default format it is then free to\n>>>> change any parameter of that, and provide it to libcamera using the\n>>>> Camera::configureStreams() methods. The Camera instance will pass the\n>>>> configurations to the pipeline handlers, that wil try to apply it to\n>>>> the hardware.\n>>>>\n>>>> To sum up: we need to provide to applications a default configuration\n>>>> suitable for the hardware, and that's why we hardcode those values\n>>>> here. Starting from that default configuration, applications can\n>>>> configure streams with the desired width, height and pixel format and\n>>>> ask libcamera to apply it to the hardware.\n>>>>\n>>>> Does this clarify your concerns?\n>>>\n>>> I think it was discussed somewhere but I'm not sure where, but what is\n>>> the reason why we can't ask the hardware for it's \"current\" format to\n>>> set the 'default' ?\n>>\n>> Because at the current stage the 'hardware' is both the sensor\n>> provided resolution and the output resolution provided by the ImgU,\n>> which do not match, if we use their defaults. And as images will be\n>> provided from ImgU not the CIO2 as before, I cannot just claim the\n>> format applied on the sensor and report that.\n> \n> The ImgU is a memory to memory device, it can operate on pretty much any\n> input resolution, includes a scaler, and can crop. The default\n> resolution should come from the sensor, not the ImgU.\n\nHow about to provide a default, we obtain the resolution from the\nSensor, (I assume this is constant-ish?) and the rest from the ImgU ?\n\nSo we would return a default of a non-scaled capture but with a pixel\nformat supported by the ImgU output?\n\n\n>> That resolution is known to work for the current use case, and I put\n>> it there not to break capture. Later on, with full ImgU support should\n>> westart from the sensor resolution and adjust it to one the ImgU can\n>> provide, or start from the default one applied to the ImgU unit, and\n>> make sure the sensor can provide something big enough to fit into\n>> that?\n>>\n>> Also, I know realize this was probably what Jerry was asking in is\n>> email, not an explanation of the stream format negotiation\n>> procedure...\n>>\n>>> I feel like anything we define statically in the pipeline is just as\n>>> wrong as any initial default provided by the hardware ..\n>>\n>> Why do you consider initial defaults provided by the hardware wrong? I\n>> mean, the issue here to me is \"which default\", but somewhere it has to\n>> be defined, right?\n\nYes, I think I was essentially saying the same thing as Laurent in\nanother e-mail ...\n\n(\n> The current format isn't a good idea, as it can vary based on the\n> history of device usage, and is thus not suitable as a default. I\n> however agree that we should compute a reasonable default based on the\n> hardware capabilities.\n)\n\n\n\n\n>>\n>>>>> -----Original Message-----\n>>>>> From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n>>>>> Sent: Friday, February 22, 2019 12:21 AM\n>>>>> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>>>>> Cc: libcamera-devel@lists.libcamera.org\n>>>>> Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n>>>>>\n>>>>> Hi Niklas,\n>>>>>\n>>>>> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n>>>>>> Hi Jacopo,\n>>>>>>\n>>>>>> Thanks for your patch.\n>>>>>>\n>>>>>> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n>>>>>>> Return default configuration for the output stream produced by the\n>>>>>>> imgu 'output' video node.\n>>>>>>>\n>>>>>>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n>>>>>>> ---\n>>>>>>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n>>>>>>>  1 file changed, 3 insertions(+), 13 deletions(-)\n>>>>>>>\n>>>>>>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n>>>>>>> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n>>>>>>> index 9694d0ce51ab..9065073913a2 100644\n>>>>>>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n>>>>>>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n>>>>>>> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n>>>>>>> *camera,  {\n>>>>>>>  \tIPU3CameraData *data = cameraData(camera);\n>>>>>>>  \tstd::map<Stream *, StreamConfiguration> configs;\n>>>>>>> -\tV4L2SubdeviceFormat format = {};\n>>>>>>> -\n>>>>>>> -\t/*\n>>>>>>> -\t * FIXME: As of now, return the image format reported by the sensor.\n>>>>>>> -\t * In future good defaults should be provided for each stream.\n>>>>>>> -\t */\n>>>>>>> -\tif (data->sensor_->getFormat(0, &format)) {\n>>>>>>> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n>>>>>>> -\t\treturn configs;\n>>>>>>> -\t}\n>>>>>>>\n>>>>>>>  \tStreamConfiguration config = {};\n>>>>>>> -\tconfig.width = format.width;\n>>>>>>> -\tconfig.height = format.height;\n>>>>>>> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n>>>>>>> +\tconfig.width = 2560;\n>>>>>>> +\tconfig.height = 1920;\n>>>>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n>>>>>>\n>>>>>> This is a good change and trust that the format you selected are the\n>>>>>> correct one so I have not verified it by reading or testing on the IPU3.\n>>>>>>\n>>>>>> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n>>>>>>\n>>>>>> I'm just curious why the pixelformat changes, did something change in\n>>>>>> the upstream driver or is this in preparation of some later change?\n>>>>>>\n>>>>>\n>>>>> We're preparing to provide frames to the application from the IMGU not from the CIO2 unit. The output format of the two is different.\n>>>>>\n>>>>>>>  \tconfig.bufferCount = 4;\n>>>>>>>\n>>>>>>>  \tconfigs[&data->stream_] = config;\n>","headers":{"Return-Path":"<kieran.bingham@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 1C797600FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 13:05:44 +0100 (CET)","from [192.168.0.21]\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 738BD2D2;\n\tFri, 22 Feb 2019 13:05:42 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550837142;\n\tbh=WzVO11aRaHBq1LvM/+ChyrX6yvkcYcE/6/pDtr19BAo=;\n\th=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From;\n\tb=tIDXC6eKhCsIRe5HHd6TrvDpod0BByGkVwxYb5Lu+JlgYxGfcvgxQ/cLLuJM+fceU\n\tVAy80dnhS3aSDfDCZlfOqDrKsYIob1sYrksg2siTqQLuHGQ5MMs1xtdDMWFJ02HMci\n\tArJviQDQlqddIg/IQoIDaHv27Jor56BKDb+4En6M=","Reply-To":"kieran.bingham@ideasonboard.com","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tJacopo Mondi <jacopo@jmondi.org>","Cc":"\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>\n\t<20190222103305.3abbtblm2lksdmqu@uno.localdomain>\n\t<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>\n\t<20190222110842.nsuk76cfcnj6uktz@uno.localdomain>\n\t<20190222114414.GR3522@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Openpgp":"preference=signencrypt","Autocrypt":"addr=kieran.bingham@ideasonboard.com; keydata=\n\t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\n\tsbsRB8KNNvVXBOVNwko86rQqF9drZuw=","Organization":"Ideas on Board","Message-ID":"<1d341ec2-baae-2f66-c013-3f7e22446e71@ideasonboard.com>","Date":"Fri, 22 Feb 2019 12:05:40 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101\n\tThunderbird/60.4.0","MIME-Version":"1.0","In-Reply-To":"<20190222114414.GR3522@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 12:05:44 -0000"}},{"id":865,"web_url":"https://patchwork.libcamera.org/comment/865/","msgid":"<20190222121350.GT3522@pendragon.ideasonboard.com>","date":"2019-02-22T12:13:50","subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Fri, Feb 22, 2019 at 01:05:15PM +0100, Jacopo Mondi wrote:\n> On Fri, Feb 22, 2019 at 01:44:14PM +0200, Laurent Pinchart wrote:\n> > On Fri, Feb 22, 2019 at 12:08:42PM +0100, Jacopo Mondi wrote:\n> >> On Fri, Feb 22, 2019 at 10:57:35AM +0000, Kieran Bingham wrote:\n> >>> On 22/02/2019 10:33, Jacopo Mondi wrote:\n> >>>> On Fri, Feb 22, 2019 at 02:30:09AM +0000, Hu, Jerry W wrote:\n> >>>>> Hi,\n> >>>>>\n> >>>>> May I know why hard coded the width and height?\n> >>>>>>> +\tconfig.width = 2560;\n> >>>>>>> +\tconfig.height = 1920;\n> >>>>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >>>>\n> >>>> This happens in the 'streamConfiguration()' methods, which\n> >>>> applications use to obtain a known good default resolution and image\n> >>>> format the camera can provide. In this case I've selected 2560x1920\n> >>>> NV12 format as \"default\" for the single stream the IPU3 camera\n> >>>> provides at the moment.\n> >>>>\n> >>>> Once application receives a known default format it is then free to\n> >>>> change any parameter of that, and provide it to libcamera using the\n> >>>> Camera::configureStreams() methods. The Camera instance will pass the\n> >>>> configurations to the pipeline handlers, that wil try to apply it to\n> >>>> the hardware.\n> >>>>\n> >>>> To sum up: we need to provide to applications a default configuration\n> >>>> suitable for the hardware, and that's why we hardcode those values\n> >>>> here. Starting from that default configuration, applications can\n> >>>> configure streams with the desired width, height and pixel format and\n> >>>> ask libcamera to apply it to the hardware.\n> >>>>\n> >>>> Does this clarify your concerns?\n> >>>\n> >>> I think it was discussed somewhere but I'm not sure where, but what is\n> >>> the reason why we can't ask the hardware for it's \"current\" format to\n> >>> set the 'default' ?\n> >>\n> >> Because at the current stage the 'hardware' is both the sensor\n> >> provided resolution and the output resolution provided by the ImgU,\n> >> which do not match, if we use their defaults. And as images will be\n> >> provided from ImgU not the CIO2 as before, I cannot just claim the\n> >> format applied on the sensor and report that.\n> >\n> > The ImgU is a memory to memory device, it can operate on pretty much any\n> > input resolution, includes a scaler, and can crop. The default\n> > resolution should come from the sensor, not the ImgU.\n> \n> True indeed, but if I'm not mistaken, the ImgU has a default\n> programmed to be 1920x1080, not all sensors can provide that\n> resolution (yes, I understand, it's a corner\n> case, most modern sensors can, but I feel this is worth checking,\n> isn't it?)\n\nBut the default ImgU settings don't matter at all :-) From an\napplication point of view the ImgU isn't visible, we have one or more\ncameras, with one or more streams each, and we need to report a default\nconfiguration for those streams. That's only dependent on the sensor,\nnot the ImgU (or, to be exact, the only dependencies on the ImgU are\nmin/max resolution and min/max scaling factor).\n\n> >> That resolution is known to work for the current use case, and I put\n> >> it there not to break capture. Later on, with full ImgU support should\n> >> westart from the sensor resolution and adjust it to one the ImgU can\n> >> provide, or start from the default one applied to the ImgU unit, and\n> >> make sure the sensor can provide something big enough to fit into\n> >> that?\n> >>\n> >> Also, I know realize this was probably what Jerry was asking in is\n> >> email, not an explanation of the stream format negotiation\n> >> procedure...\n> >>\n> >>> I feel like anything we define statically in the pipeline is just as\n> >>> wrong as any initial default provided by the hardware ..\n> >>\n> >> Why do you consider initial defaults provided by the hardware wrong? I\n> >> mean, the issue here to me is \"which default\", but somewhere it has to\n> >> be defined, right?\n> >>\n> >>>>> -----Original Message-----\n> >>>>> From: libcamera-devel [mailto:libcamera-devel-bounces@lists.libcamera.org] On Behalf Of Jacopo Mondi\n> >>>>> Sent: Friday, February 22, 2019 12:21 AM\n> >>>>> To: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >>>>> Cc: libcamera-devel@lists.libcamera.org\n> >>>>> Subject: Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video output default configuration\n> >>>>>\n> >>>>> Hi Niklas,\n> >>>>>\n> >>>>> On Thu, Feb 21, 2019 at 04:58:35PM +0100, Niklas Söderlund wrote:\n> >>>>>> Hi Jacopo,\n> >>>>>>\n> >>>>>> Thanks for your patch.\n> >>>>>>\n> >>>>>> On 2019-02-20 14:17:54 +0100, Jacopo Mondi wrote:\n> >>>>>>> Return default configuration for the output stream produced by the\n> >>>>>>> imgu 'output' video node.\n> >>>>>>>\n> >>>>>>> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> >>>>>>> ---\n> >>>>>>>  src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +++-------------\n> >>>>>>>  1 file changed, 3 insertions(+), 13 deletions(-)\n> >>>>>>>\n> >>>>>>> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>>>> b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>>>> index 9694d0ce51ab..9065073913a2 100644\n> >>>>>>> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>>>> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> >>>>>>> @@ -99,21 +99,11 @@ PipelineHandlerIPU3::streamConfiguration(Camera\n> >>>>>>> *camera,  {\n> >>>>>>>  \tIPU3CameraData *data = cameraData(camera);\n> >>>>>>>  \tstd::map<Stream *, StreamConfiguration> configs;\n> >>>>>>> -\tV4L2SubdeviceFormat format = {};\n> >>>>>>> -\n> >>>>>>> -\t/*\n> >>>>>>> -\t * FIXME: As of now, return the image format reported by the sensor.\n> >>>>>>> -\t * In future good defaults should be provided for each stream.\n> >>>>>>> -\t */\n> >>>>>>> -\tif (data->sensor_->getFormat(0, &format)) {\n> >>>>>>> -\t\tLOG(IPU3, Error) << \"Failed to create stream configurations\";\n> >>>>>>> -\t\treturn configs;\n> >>>>>>> -\t}\n> >>>>>>>\n> >>>>>>>  \tStreamConfiguration config = {};\n> >>>>>>> -\tconfig.width = format.width;\n> >>>>>>> -\tconfig.height = format.height;\n> >>>>>>> -\tconfig.pixelFormat = V4L2_PIX_FMT_IPU3_SGRBG10;\n> >>>>>>> +\tconfig.width = 2560;\n> >>>>>>> +\tconfig.height = 1920;\n> >>>>>>> +\tconfig.pixelFormat = V4L2_PIX_FMT_NV12;\n> >>>>>>\n> >>>>>> This is a good change and trust that the format you selected are the\n> >>>>>> correct one so I have not verified it by reading or testing on the IPU3.\n> >>>>>>\n> >>>>>> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> >>>>>>\n> >>>>>> I'm just curious why the pixelformat changes, did something change in\n> >>>>>> the upstream driver or is this in preparation of some later change?\n> >>>>>>\n> >>>>>\n> >>>>> We're preparing to provide frames to the application from the IMGU not from the CIO2 unit. The output format of the two is different.\n> >>>>>\n> >>>>>>>  \tconfig.bufferCount = 4;\n> >>>>>>>\n> >>>>>>>  \tconfigs[&data->stream_] = config;","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["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 B1DEF600FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Feb 2019 13:13:55 +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 0E23C2D2;\n\tFri, 22 Feb 2019 13:13:54 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1550837635;\n\tbh=LDf8dSzNEKwh+vty14eIILf9MVhuqr9wMbNVysvXaSs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=nlzi+n9eZhAAM9iK6CYVmHLShG7HCfUDGdQ7Y74DGteyVCNOwNyRnxdzQCAGKj9Mp\n\t/wIWGx5CxPOcdImOOHV77XbgtqRyEsJOJhCSbz6/sKwyJvUh/a6p5+aZskY/Hx54+b\n\ty62ijil5wFz3WnLwhJasuU0vxuEDhosk6wDNTHv0=","Date":"Fri, 22 Feb 2019 14:13:50 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\t\"libcamera-devel@lists.libcamera.org\"\n\t<libcamera-devel@lists.libcamera.org>","Message-ID":"<20190222121350.GT3522@pendragon.ideasonboard.com>","References":"<20190220131757.14004-1-jacopo@jmondi.org>\n\t<20190220131757.14004-3-jacopo@jmondi.org>\n\t<20190221155835.GH11484@bigcity.dyn.berto.se>\n\t<20190221162116.pt3nb5gsq4pxsa2c@uno.localdomain>\n\t<B5AE59A43178D14F83DD17844DD29B694D0C400F@SHSMSX104.ccr.corp.intel.com>\n\t<20190222103305.3abbtblm2lksdmqu@uno.localdomain>\n\t<be4935e3-0939-6309-17f1-366ac8c15a25@ideasonboard.com>\n\t<20190222110842.nsuk76cfcnj6uktz@uno.localdomain>\n\t<20190222114414.GR3522@pendragon.ideasonboard.com>\n\t<20190222120515.y7e5yzfwr2wjoksp@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190222120515.y7e5yzfwr2wjoksp@uno.localdomain>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 2/5] libcamera: ipu3: Return video\n\toutput default configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 22 Feb 2019 12:13:55 -0000"}}]