[{"id":11053,"web_url":"https://patchwork.libcamera.org/comment/11053/","msgid":"<20200701164501.GI2399385@oden.dyn.berto.se>","date":"2020-07-01T16:45:01","subject":"Re: [libcamera-devel] [PATCH 07/15] libcamera: ipu3: Refuse\n\tunsupported configuration","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2020-07-01 14:30:28 +0200, Jacopo Mondi wrote:\n> Make sure in the validate() function that the number of raw and\n> processed streams requested by applications is supported by the\n> platform.\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 | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index daa6d71dae72..651e0c93a7ab 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -213,6 +213,8 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \tassignStreams();\n>  \n>  \t/* Verify and adjust configuration if needed. */\n> +\tunsigned int rawCount = 0;\n> +\tunsigned int outCount = 0;\n>  \tfor (unsigned int i = 0; i < config_.size(); ++i) {\n>  \t\tStreamConfiguration &cfg = config_[i];\n>  \t\tconst StreamConfiguration oldCfg = cfg;\n> @@ -223,6 +225,7 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t\tcfg.size = cio2Configuration_.size;\n>  \t\t\tcfg.pixelFormat = cio2Configuration_.pixelFormat;\n>  \t\t\tcfg.bufferCount = cio2Configuration_.bufferCount;\n> +\t\t\trawCount++;\n>  \t\t} else {\n>  \t\t\t/*\n>  \t\t\t * Clamp the size to match the ImgU alignment\n> @@ -242,6 +245,7 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t\t}\n>  \t\t\tcfg.pixelFormat = formats::NV12;\n>  \t\t\tcfg.bufferCount = IPU3_BUFFER_COUNT;\n> +\t\t\toutCount++;\n>  \n>  \t\t\t/*\n>  \t\t\t * \\todo: Handle the scaler (BDS) restrictions. The BDS\n> @@ -254,6 +258,13 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n>  \t\t\t */\n>  \t\t}\n>  \n> +\t\tif (rawCount > 1 || outCount > 2) {\n> +\t\t\tLOG(IPU3, Error)\n> +\t\t\t\t<< \"Camera configuration not supported: \"\n> +\t\t\t\t<< \"the platform supports up to one raw stream and two processed ones.\";\n> +\t\t\treturn Invalid;\n> +\t\t}\n> +\n>  \t\tif (cfg.pixelFormat != oldCfg.pixelFormat || cfg.size != oldCfg.size) {\n>  \t\t\tLOG(IPU3, Debug)\n>  \t\t\t\t<< \"Stream \" << i << \" configuration adjusted to \"\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 337A1BE905\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Jul 2020 16:45:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F281160C56;\n\tWed,  1 Jul 2020 18:45:04 +0200 (CEST)","from mail-lf1-x144.google.com (mail-lf1-x144.google.com\n\t[IPv6:2a00:1450:4864:20::144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 675B460C53\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Jul 2020 18:45:03 +0200 (CEST)","by mail-lf1-x144.google.com with SMTP id y18so14065402lfh.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Jul 2020 09:45:03 -0700 (PDT)","from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203])\n\tby smtp.gmail.com with ESMTPSA id\n\tx16sm2224169lfc.76.2020.07.01.09.45.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Jul 2020 09:45:02 -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=\"p7ClAMah\"; 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=vaZ4QPLJi2SC2kTqDdZOm5Os7GQacenBvNBfbMTN6hE=;\n\tb=p7ClAMahEQhVEMdotjnrR6tHXjN2ZCgfm2XOT7Z+M6nJ6K5GZw6T19NC1gfNHLSceB\n\tIN3b2KYRrtE5VglBW56Rz88H4zPynF85AMoG1yH0sExwY0yKD3TolMD2FLzvp/v4LAiH\n\tFlwTjKuhnZH8qpNzonfyRgASCryMBNjny/ZAwRCjuPlBPZQuDgCDW4fLr5JpkwYRvpnH\n\tmGebLApKXhGbx3SxsiTJX/zQ8e13YM2eN1EZRNlKkaginHxMYScIUKXgoofDPZKfuwMw\n\t08GsfsY/DaXKotqrFrNRuhkPK+0g7q3VZqvYqAssW3Qt5p7wNNoN8ZOEXSI/MT+bt0AL\n\tUBJQ==","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=vaZ4QPLJi2SC2kTqDdZOm5Os7GQacenBvNBfbMTN6hE=;\n\tb=cjUIGXLoXSZfkWXu9vJhf7Y76fZHxed/EvcU3DlGtxvcq4dTwqQhOBes9WDp0LDszY\n\tcQhiS97DKcahtTbUecgBLgg5tJE4rCjR0IRoM3jaHdusbUb5HvkDz3BA1VG2hRDOJvWD\n\tReA0Ne1RlJJ+Mrqlmns4krrRN9NZbb7OEJvUv1IftouARA21uLBO6ha/Ktxul15zo3H1\n\tDwSGWiPr/lURJnv6yd7ZO9qXuExv77Yn0W9VS9MMFELTvJgculOrblk34X+M0HRECObP\n\tKmcjjOROf86svwlG5Dbgt6h+NNZuod2KB9iMV7wD1Mb78m7i8+q/OK4Vsfo5guAlsV/F\n\tSnrg==","X-Gm-Message-State":"AOAM5325rqi28GHbgaBA9ShnOVVvLCnSXvXlXI7qVz/TgOhjDONHQI4X\n\tbfdaZ2ynxDIagvwH0kr8L/PizC9UGJg=","X-Google-Smtp-Source":"ABdhPJxyUHeo7NxqNcoiEq+P5hpD4o9ClBGWyktVzrC7oLzIJBbNjNv5a6+iIu/PNWROnsRqY+a/eA==","X-Received":"by 2002:ac2:4829:: with SMTP id 9mr15689044lft.41.1593621902860; \n\tWed, 01 Jul 2020 09:45:02 -0700 (PDT)","Date":"Wed, 1 Jul 2020 18:45:01 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20200701164501.GI2399385@oden.dyn.berto.se>","References":"<20200701123036.51922-1-jacopo@jmondi.org>\n\t<20200701123036.51922-8-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200701123036.51922-8-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 07/15] libcamera: ipu3: Refuse\n\tunsupported 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>"}}]