[{"id":11290,"web_url":"https://patchwork.libcamera.org/comment/11290/","msgid":"<20200709140556.GR3875643@oden.dyn.berto.se>","date":"2020-07-09T14:05:56","subject":"Re: [libcamera-devel] [PATCH v2 18/20] libcamera: ipu3: Calculate\n\tImgU pipe configuration","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2020-07-09 10:41:26 +0200, Jacopo Mondi wrote:\n> Collect the ImgU device desired pipe configuration while assigning\n> streams in the pipeline handler validate() function and ask the\n> ImgUDevice class to calculate the pipe configuration parameters.\n> \n> If the requested pipe configuration results in a non-valid\n> configuration, return an error from the validate() function.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 13 +++++++++++++\n>  1 file changed, 13 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 9a6e71514c90..72261d16e9f8 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -71,6 +71,7 @@ private:\n>  \tIPU3CameraData *data_;\n>  \n>  \tStreamConfiguration cio2Configuration_;\n> +\tImgUDevice::PipeConfig pipeConfig_;\n>  };\n>  \n>  class PipelineHandlerIPU3 : public PipelineHandler\n> @@ -179,6 +180,9 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \n>  \tLOG(IPU3, Debug) << \"CIO2 configuration: \" << cio2Configuration_.toString();\n>  \n> +\tImgUDevice::Pipe pipe{};\n> +\tpipe.input = cio2Configuration_.size;\n> +\n>  \t/*\n>  \t * Adjust the configurations if needed and assign streams while\n>  \t * iterating them.\n> @@ -250,11 +254,13 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t    (oldCfg.size == yuvSize || outCount == 1)) {\n>  \t\t\tcfg.setStream(&data_->outStream_);\n>  \t\t\tmainOutputAvailable = false;\n> +\t\t\tpipe.output = cfg.size;\n>  \n>  \t\t\tLOG(IPU3, Debug) << \"Assigned \" << cfg.toString()\n>  \t\t\t\t\t << \" to the main output\";\n>  \t\t} else {\n>  \t\t\tcfg.setStream(&data_->vfStream_);\n> +\t\t\tpipe.viewfinder = cfg.size;\n>  \n>  \t\t\tLOG(IPU3, Debug) << \"Assigned \" << cfg.toString()\n>  \t\t\t\t\t << \" to the viewfinder output\";\n> @@ -269,6 +275,13 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t}\n>  \t}\n>  \n> +\tpipeConfig_ = data_->imgu_->calculatePipeConfig(&pipe);\n> +\tif (pipeConfig_.isNull()) {\n> +\t\tLOG(IPU3, Error) << \"Failed to calculate pipe configuration: \"\n> +\t\t\t\t << \"unsupported resolutions.\";\n> +\t\treturn Invalid;\n> +\t}\n> +\n>  \treturn status;\n>  }\n>  \n> -- \n> 2.27.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BD708BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Jul 2020 14:05:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33D69612EA;\n\tThu,  9 Jul 2020 16:05:59 +0200 (CEST)","from mail-lj1-x244.google.com (mail-lj1-x244.google.com\n\t[IPv6:2a00:1450:4864:20::244])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 40D3F611B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Jul 2020 16:05:58 +0200 (CEST)","by mail-lj1-x244.google.com with SMTP id q4so2563639lji.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 09 Jul 2020 07:05:58 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tx18sm833792ljd.123.2020.07.09.07.05.56\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 09 Jul 2020 07:05:56 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"yeSvAPpf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=W1mdEdYckX+dox3EAIjsfbzbKa8eaFFBJ0kQXOkrv8E=;\n\tb=yeSvAPpfyO1ngaOKNotGTiIIKrb4QzfPiadx765q6bGOeIrRsyVFNqZgRUZLy6XXm4\n\tRes1LECTuLzUqhOYREqvQShU8O7Au0xOK7pC1K9gZ6d4mhwZwsdajkjwuaCUNVDdVIEy\n\tr31I74YHPX2i+lNZbZJ8N9VT9K4aMK2NPWxHXoKFX/4IudWdl0IZ+Ar4ZmzojIJXSwX/\n\twJid1ieqcpWgJqNvFemf9t91CT8+quZN3JVcoQrD8LXUfxTGdu7YTvV7Uc528nxDnmAx\n\tTFiI5DlG1pVgqNIzk9MgugbgcN6qwe0FCuhk2ril3qpmEvZoFwZbbH6RQthMArwCpSaX\n\tIgRA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=W1mdEdYckX+dox3EAIjsfbzbKa8eaFFBJ0kQXOkrv8E=;\n\tb=CrbAdaa9GV9AB7hnRTekaLsul2jc2eO0rplaxlBMMCDx27J/NGJJlgKyjB/HhBIipW\n\t+cdIfZq/Lnvcy/GOHBGWKIZbi/P/BppvqzmcuZ4VQP6IdslKqgdvDwoRRokPDRFoZ59W\n\tumjkyNRvY58NsyJ6duxgroGv5Uotq9AJl9uSHX/MnwwnWTYa9WQGpWwhoi1U83v2+7Ev\n\tLvM5ggVJ4xL2EQMRUOxGJaswIVFp90oPUtURNxjgxrmA3j0HoCCtwcNoocolDFlU+A4R\n\tYSQJwbcuVVNqpVpJFULyCQf+x28N7N29qcwnxfN7RAtaXyzOps4I16qDspJqTvduN3kF\n\telrQ==","X-Gm-Message-State":"AOAM533LUqSN2dFq6fwQDaTSrlQEuiAC8CZtOO16MYn2JG1sTBf226th\n\tdlgo3OdiD/avP2IqZIoXxw6CTA==","X-Google-Smtp-Source":"ABdhPJzYbbNwRZiTDRlq5ykogTdm/wKe2Jp+lapBWhwYYmeVA/t5/UAAUlMKbzfvj1xQfcFSf4n8zA==","X-Received":"by 2002:a2e:7a1a:: with SMTP id\n\tv26mr20668335ljc.104.1594303557606; \n\tThu, 09 Jul 2020 07:05:57 -0700 (PDT)","Date":"Thu, 9 Jul 2020 16:05:56 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200709140556.GR3875643@oden.dyn.berto.se>","References":"<20200709084128.5316-1-jacopo@jmondi.org>\n\t<20200709084128.5316-19-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200709084128.5316-19-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v2 18/20] libcamera: ipu3: Calculate\n\tImgU pipe configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"iso-8859-1\"","Content-Transfer-Encoding":"quoted-printable","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":11333,"web_url":"https://patchwork.libcamera.org/comment/11333/","msgid":"<20200710124640.GV5964@pendragon.ideasonboard.com>","date":"2020-07-10T12:46:40","subject":"Re: [libcamera-devel] [PATCH v2 18/20] libcamera: ipu3: Calculate\n\tImgU pipe configuration","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Thu, Jul 09, 2020 at 10:41:26AM +0200, Jacopo Mondi wrote:\n> Collect the ImgU device desired pipe configuration while assigning\n> streams in the pipeline handler validate() function and ask the\n> ImgUDevice class to calculate the pipe configuration parameters.\n> \n> If the requested pipe configuration results in a non-valid\n> configuration, return an error from the validate() function.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nalthough I wonder if the Pipe and PipeConfig structures shouldn't be\nmerged, but that's a topic for another patch.\n\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 13 +++++++++++++\n>  1 file changed, 13 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 9a6e71514c90..72261d16e9f8 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -71,6 +71,7 @@ private:\n>  \tIPU3CameraData *data_;\n>  \n>  \tStreamConfiguration cio2Configuration_;\n> +\tImgUDevice::PipeConfig pipeConfig_;\n>  };\n>  \n>  class PipelineHandlerIPU3 : public PipelineHandler\n> @@ -179,6 +180,9 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \n>  \tLOG(IPU3, Debug) << \"CIO2 configuration: \" << cio2Configuration_.toString();\n>  \n> +\tImgUDevice::Pipe pipe{};\n> +\tpipe.input = cio2Configuration_.size;\n> +\n>  \t/*\n>  \t * Adjust the configurations if needed and assign streams while\n>  \t * iterating them.\n> @@ -250,11 +254,13 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t    (oldCfg.size == yuvSize || outCount == 1)) {\n>  \t\t\tcfg.setStream(&data_->outStream_);\n>  \t\t\tmainOutputAvailable = false;\n> +\t\t\tpipe.output = cfg.size;\n>  \n>  \t\t\tLOG(IPU3, Debug) << \"Assigned \" << cfg.toString()\n>  \t\t\t\t\t << \" to the main output\";\n>  \t\t} else {\n>  \t\t\tcfg.setStream(&data_->vfStream_);\n> +\t\t\tpipe.viewfinder = cfg.size;\n>  \n>  \t\t\tLOG(IPU3, Debug) << \"Assigned \" << cfg.toString()\n>  \t\t\t\t\t << \" to the viewfinder output\";\n> @@ -269,6 +275,13 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t}\n>  \t}\n>  \n> +\tpipeConfig_ = data_->imgu_->calculatePipeConfig(&pipe);\n> +\tif (pipeConfig_.isNull()) {\n> +\t\tLOG(IPU3, Error) << \"Failed to calculate pipe configuration: \"\n> +\t\t\t\t << \"unsupported resolutions.\";\n> +\t\treturn Invalid;\n> +\t}\n> +\n>  \treturn status;\n>  }\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id EC7A5BD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Jul 2020 12:46:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6AFFE613CB;\n\tFri, 10 Jul 2020 14:46:48 +0200 (CEST)","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 D1EDF611BA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Jul 2020 14:46:47 +0200 (CEST)","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 4E6042C0;\n\tFri, 10 Jul 2020 14:46:47 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"KriIFRnq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594385207;\n\tbh=oA50RtWEUEnolM073viuwyIYbMysT/7rkW8K6bKqyo8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KriIFRnqYUkK5Jg5kRuuoOlE23JTakIi99LKxwwH/GdsVkJQAMpQ9JbHVe/PQVr2x\n\tAbfT5sgbxMC7P8rpGWRt2RIHMMqjvPkU6tLGUY8veMj0CZOAMmIPZeTF2F4HDC9yzm\n\tVj3t58sjSe+brVapML8bcR9iX94VbcjQVVLemzUU=","Date":"Fri, 10 Jul 2020 15:46:40 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200710124640.GV5964@pendragon.ideasonboard.com>","References":"<20200709084128.5316-1-jacopo@jmondi.org>\n\t<20200709084128.5316-19-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200709084128.5316-19-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH v2 18/20] libcamera: ipu3: Calculate\n\tImgU pipe configuration","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]