{"id":16056,"url":"https://patchwork.libcamera.org/api/patches/16056/?format=json","web_url":"https://patchwork.libcamera.org/patch/16056/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220526082737.1081262-8-chenghaoyang@google.com>","date":"2022-05-26T08:27:35","name":"[libcamera-devel,v2,7/9] ipu3: Assign |outCaptureStream| to StillCapture configuration","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"64254e205cc5c738944395388085e2005d0b4d17","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/people/117/?format=json","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16056/mbox/","series":[{"id":3141,"url":"https://patchwork.libcamera.org/api/series/3141/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3141","date":"2022-05-26T08:27:28","name":"Use two imgus in ipu3 pipeline handler","version":2,"mbox":"https://patchwork.libcamera.org/series/3141/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16056/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16056/checks/","tags":{},"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 D527CC326E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 May 2022 08:28:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1202B65664;\n\tThu, 26 May 2022 10:28:01 +0200 (CEST)","from mail-pf1-x433.google.com (mail-pf1-x433.google.com\n\t[IPv6:2607:f8b0:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5EAD165673\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 May 2022 10:27:58 +0200 (CEST)","by mail-pf1-x433.google.com with SMTP id c65so566293pfb.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 May 2022 01:27:58 -0700 (PDT)","from chenghaoyang-low.c.googlers.com.com\n\t(21.160.199.104.bc.googleusercontent.com. [104.199.160.21])\n\tby smtp.gmail.com with ESMTPSA id\n\tm2-20020a170902bb8200b0016191b843e2sm834429pls.235.2022.05.26.01.27.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 26 May 2022 01:27:55 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1653553681;\n\tbh=5DWQPKQJNZ3aN5Ll1FqAzZ3Y6qxHFg+oJJ2OYbVcQP0=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Sgt1ccCdXCk14a+sinZjG4i8hbEnVi0wQWzyk4YaI8IlMu6c3WVSlImzDT57/nkbp\n\ty133ocxmaiXB6nSZcV9plMHUkPcK1vIVg7naWDAXDoc1W+3EnUj54Lo6vWBr8ncdVY\n\t3Ey31f1SU3eM6REqVChYZergJaYkaSM4W4wNKL86tZVRPTGHz/JUNyM5DzL0VZaYem\n\tB1kifyI1wqEDI3i0HHMYjINzA5cgzdsKxVzXqF5AjwiDMfuT9YujmT7jcs/izBCAZX\n\tIrh85R0jtBead3BACuOve0K1EgfujFkhYykg9YBYMWQ7bqyw4kwEHTOh3/R7WxWZRe\n\tfIpj79FeBmYAw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=br19rRUuI9uyuNQeeSthuD63ktHSskA8R1maEa7PYJ4=;\n\tb=J4wbGulQGvxghZx3kz5mv5KjT3I3MJC8Xhbz8SxnQOiZQzWBpV8EG/939RmowJ9h41\n\tm0gv8RxS77oiH3ubuhHsl+cGMW6ablVS1ASvEd71x/FazmF8chhU1TGvM8bnquPpAys7\n\tv5HFm0O9A5XAS17jQ47fGdH7ztlRB5VXcWTSU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"J4wbGulQ\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=br19rRUuI9uyuNQeeSthuD63ktHSskA8R1maEa7PYJ4=;\n\tb=rfwnUWvk2uCKjAux9aaoYwLw6RNceygEpN7fV+TeGeGibsHbcCwUXLOgZ4eVZxi5zo\n\tu3odiHr3G5+LOLKwmWeO2huP5ooiYeLEOVfvn+8oZPyu9kT2PngYMLKOG/1ZyabDpmOE\n\t2KRpQg6hkvYfnClxODvbkrDQ6SmbHaOgyhO7LFlwkh24L3kjo/t/ikNSyFXYIh1ILXj+\n\t3xeMo0sPaPIThc5QdGQ8+Ofb690jcyrOgSBNwrbbAW1usdF4qdDjCttxnT7UD/mEKFI/\n\tFqEK7VXrxuLvCqfOwXLvwL9DblweSHQJ3RUkHqGBje2IBRAXynpn0LzphkHuBUVRhlMA\n\t1NLw==","X-Gm-Message-State":"AOAM530fNXlNawPr4Ny3dH6VOOkEp++skCW+56quyPFuGu4+Z7eeHfD9\n\tFF+1uAMr0RFLhpeKL1tU1HNJehW+v5kruOhH","X-Google-Smtp-Source":"ABdhPJx1LRZX4rvMeyUwyS0su+m0XDZF3zFOVFnTbJyQToijONMaRxO7j270A1Sjm68YYWLN0kcykg==","X-Received":"by 2002:a63:864a:0:b0:3fa:dca8:ef5e with SMTP id\n\tx71-20020a63864a000000b003fadca8ef5emr6279809pgd.38.1653553676574; \n\tThu, 26 May 2022 01:27:56 -0700 (PDT)","X-Google-Original-From":"Harvey Yang <chenghaoyang@google.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 26 May 2022 08:27:35 +0000","Message-Id":"<20220526082737.1081262-8-chenghaoyang@google.com>","X-Mailer":"git-send-email 2.36.1.124.g0e6072fb45-goog","In-Reply-To":"<20220526082737.1081262-1-chenghaoyang@google.com>","References":"<20220526082737.1081262-1-chenghaoyang@google.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 7/9] ipu3: Assign |outCaptureStream| to\n\tStillCapture 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>","From":"Harvey Yang via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Harvey Yang <chenghaoyang@chromium.org>","Cc":"Harvey Yang <chenghaoyang@google.com>,\n\tHarvey Yang <chenghaoyang@chromium.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"When StillCapture and other non-raw configurations are requested,\nassigns |outCaptureStream| instead of |outStream| to the StillCapture\nconfiguration.\n\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 50 +++++++++++++++++++++++-----\n 1 file changed, 42 insertions(+), 8 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex ec9d14d1..e26c2736 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -254,8 +254,10 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t * \\todo Clarify the IF and BDS margins requirements.\n \t */\n \tunsigned int rawCount = 0;\n-\tunsigned int yuvCount = 0;\n+\tunsigned int videoCount = 0;\n+\tunsigned int stillCount = 0;\n \tSize maxYuvSize;\n+\tSize maxVideoSize;\n \tSize rawSize;\n \n \tfor (const StreamConfiguration &cfg : config_) {\n@@ -264,16 +266,29 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t\tif (info.colourEncoding == PixelFormatInfo::ColourEncodingRAW) {\n \t\t\trawCount++;\n \t\t\trawSize.expandTo(cfg.size);\n+\t\t} else if (cfg.streamRole == StreamRole::StillCapture) {\n+\t\t\tif (stillCount != 0)\n+\t\t\t\treturn Invalid;\n+\n+\t\t\tstillCount++;\n+\t\t\tmaxYuvSize.expandTo(cfg.size);\n \t\t} else {\n-\t\t\tyuvCount++;\n+\t\t\tvideoCount++;\n \t\t\tmaxYuvSize.expandTo(cfg.size);\n+\t\t\tmaxVideoSize.expandTo(cfg.size);\n \t\t}\n \t}\n \n-\tif (rawCount > 1 || yuvCount > 2) {\n+\tif (videoCount == 0 && stillCount == 1) {\n+\t\tstillCount = 0;\n+\t\tvideoCount = 1;\n+\t\tmaxVideoSize.expandTo(maxYuvSize);\n+\t}\n+\n+\tif (rawCount > 1 || videoCount > 2) {\n \t\tLOG(IPU3, Debug) << \"Camera configuration not supported\";\n \t\treturn Invalid;\n-\t} else if (rawCount && !yuvCount) {\n+\t} else if (rawCount && !stillCount && !videoCount) {\n \t\t/*\n \t\t * Disallow raw-only camera configuration. Currently, ImgU does\n \t\t * not get configured for raw-only streams and has early return\n@@ -316,6 +331,9 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \tImgUDevice::Pipe pipe{};\n \tpipe.input = cio2Configuration_.size;\n \n+\tImgUDevice::Pipe pipe1{};\n+\tpipe1.input = cio2Configuration_.size;\n+\n \t/*\n \t * Adjust the configurations if needed and assign streams while\n \t * iterating them.\n@@ -380,18 +398,34 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t\t\tcfg->stride = info.stride(cfg->size.width, 0, 1);\n \t\t\tcfg->frameSize = info.frameSize(cfg->size, 1);\n \n+\t\t\tif (stillCount == 1 && cfg->streamRole == StreamRole::StillCapture) {\n+\t\t\t\tLOG(IPU3, Debug) << \"Assigned \"\n+\t\t\t\t\t\t << cfg->toString()\n+\t\t\t\t\t\t << \" to the imgu1 main output\";\n+\t\t\t\tcfg->setStream(const_cast<Stream *>(&data_->outCaptureStream_));\n+\n+\t\t\t\tpipe1.main = cfg->size;\n+\t\t\t\tpipe1.viewfinder = pipe1.main;\n+\n+\t\t\t\tpipeConfig1_ = data_->imgu1_->calculatePipeConfig(&pipe1);\n+\t\t\t\tif (pipeConfig1_.isNull()) {\n+\t\t\t\t\tLOG(IPU3, Error) << \"Failed to calculate pipe configuration: \"\n+\t\t\t\t\t\t\t << \"unsupported resolutions.\";\n+\t\t\t\t\treturn Invalid;\n+\t\t\t\t}\n \t\t\t/*\n \t\t\t * Use the main output stream in case only one stream is\n \t\t\t * requested or if the current configuration is the one\n \t\t\t * with the maximum YUV output size.\n \t\t\t */\n-\t\t\tif (mainOutputAvailable &&\n-\t\t\t    (originalCfg.size == maxYuvSize || yuvCount == 1)) {\n+\t\t\t} else if (mainOutputAvailable &&\n+\t\t\t\t   (originalCfg.size == maxVideoSize ||\n+\t\t\t\t    videoCount == 1)) {\n \t\t\t\tcfg->setStream(const_cast<Stream *>(&data_->outStream_));\n \t\t\t\tmainOutputAvailable = false;\n \n \t\t\t\tpipe.main = cfg->size;\n-\t\t\t\tif (yuvCount == 1)\n+\t\t\t\tif (videoCount == 1)\n \t\t\t\t\tpipe.viewfinder = pipe.main;\n \n \t\t\t\tLOG(IPU3, Debug) << \"Assigned \" << cfg->toString()\n@@ -415,7 +449,7 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t}\n \n \t/* Only compute the ImgU configuration if a YUV stream has been requested. */\n-\tif (yuvCount) {\n+\tif (videoCount) {\n \t\tpipeConfig0_ = data_->imgu0_->calculatePipeConfig(&pipe);\n \t\tif (pipeConfig0_.isNull()) {\n \t\t\tLOG(IPU3, Error) << \"Failed to calculate pipe configuration: \"\n","prefixes":["libcamera-devel","v2","7/9"]}