{"id":18712,"url":"https://patchwork.libcamera.org/api/1.1/patches/18712/?format=json","web_url":"https://patchwork.libcamera.org/patch/18712/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20230606103336.17782-5-jacopo.mondi@ideasonboard.com>","date":"2023-06-06T10:33:36","name":"[libcamera-devel,v5,4/4] libcamera: rkisp1: Fix enumeration of RAW formats","commit_ref":"e58121cfc13f570818a98fc79275021635c39782","pull_url":null,"state":"accepted","archived":false,"hash":"ab47e54b902bd29ad405bd9f8541e59a757a20c8","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/1.1/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18712/mbox/","series":[{"id":3909,"url":"https://patchwork.libcamera.org/api/1.1/series/3909/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3909","date":"2023-06-06T10:33:32","name":"libcamera: rkisp1: Fix generateConfiguration","version":5,"mbox":"https://patchwork.libcamera.org/series/3909/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18712/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18712/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 ADDA1C32AA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  6 Jun 2023 10:33:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 438306289B;\n\tTue,  6 Jun 2023 12:33:58 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1D9F46289F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  6 Jun 2023 12:33:54 +0200 (CEST)","from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9159DA38;\n\tTue,  6 Jun 2023 12:33:28 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1686047638;\n\tbh=996YIff6sc44emvGZn/JSjG5uaRBA99VXNCAIIBveF0=;\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=VUhLiWlBhu7rWvLxyvUSbZWG+N9xS3QEEhX75o1Eky3PgDCQ+WdQrsM5wuR898//E\n\teUra4gLC2xlkUsDRbrter1QK0eUa4pFz6hpJtjHM/Ztt2axh3z9lwrPbdtYfYrt/z7\n\tdLYjJ8msyOFQzLEUbTN6isfMHLAQH+atUxcBkX89qkh3BDPE+/AV/mjjnmbF3MFBA5\n\tkzhB1eFUyltbKTLxFmDILX48cdE/MZwFvN0hlyY77BhcJzcjUUZCOzlXMfYcJ9EfLg\n\tTGRjLDIdBMIe+CGBaEbxGOI1JcuBd/LyviVYp+mNVmMsxcsweHBGecW/E2HMmrMvjO\n\tQb3enBRCkgEFw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1686047608;\n\tbh=996YIff6sc44emvGZn/JSjG5uaRBA99VXNCAIIBveF0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=N+ly4Je1myDyCbj8UdS+m0IvSxZwaHyWguCgfd6fkQhw7R+/BV43ReHpjTXJjMjrD\n\t9ZMg7YPPBmB7M0YK7ZhpK/LU5FbX0FOR1ew5dzDvnjoSI7RfeI1Xup9MYoyM/e+FMr\n\tRFtpdOvRp/ZxZqqcR/9FS6FC9NlHlDurEYeYjlMI="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"N+ly4Je1\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  6 Jun 2023 12:33:36 +0200","Message-Id":"<20230606103336.17782-5-jacopo.mondi@ideasonboard.com>","X-Mailer":"git-send-email 2.40.1","In-Reply-To":"<20230606103336.17782-1-jacopo.mondi@ideasonboard.com>","References":"<20230606103336.17782-1-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 4/4] libcamera: rkisp1: Fix enumeration\n\tof RAW formats","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, libcamera@luigi311.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The current implementation enumerates a single RAW format (the sensor's\nresolution) and does that regardless of what role the\nCameraConfiguration has been generated for.\n\nFix this by:\n- Enumerate RAW StreamFormats only when the requested role is\n  StreamRole::Raw\n- Add all the sensor's provided resolutions that fit the video device\n  output maximum size\n\nBefore this patch, a single RAW size was enumerated in stream formats\n\n * Pixelformat: SRGGB10 (4208x3120)-(4208x3120)/(+1,+1)\n  - 4208x3120\n\nWith this patch applied all sensor's supported resolutions are\nenumerated but only when the stream role RAW is explicitly requested\n\n * Pixelformat: SRGGB10 (1048x780)-(4208x3120)/(+0,+0)\n  - 1048x780\n  - 2104x1560\n  - 4032x3024\n  - 4208x3120\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 20 +++++++++++++++++--\n 1 file changed, 18 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\nindex 89fb6596b0be..b62b645cae24 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n@@ -149,18 +149,34 @@ RkISP1Path::generateConfiguration(const CameraSensor *sensor, const Size &size,\n \tfor (const auto &format : streamFormats_) {\n \t\tconst PixelFormatInfo &info = PixelFormatInfo::info(format);\n \n+\t\t/* Populate stream formats for non-RAW configurations. */\n \t\tif (info.colourEncoding != PixelFormatInfo::ColourEncodingRAW) {\n+\t\t\tif (role == StreamRole::Raw)\n+\t\t\t\tcontinue;\n+\n \t\t\tstreamFormats[format] = { { minResolution, maxResolution } };\n \t\t\tcontinue;\n \t\t}\n \n-\t\t/* Skip raw formats not supported by the sensor. */\n+\t\t/* Skip RAW formats for non-raw roles. */\n+\t\tif (role != StreamRole::Raw)\n+\t\t\tcontinue;\n+\n+\t\t/* Populate stream formats for RAW configurations. */\n \t\tuint32_t mbusCode = formatToMediaBus.at(format);\n \t\tif (std::find(mbusCodes.begin(), mbusCodes.end(), mbusCode) ==\n \t\t    mbusCodes.end())\n+\t\t\t/* Skip formats not supported by sensor. */\n \t\t\tcontinue;\n \n-\t\tstreamFormats[format] = { { resolution, resolution } };\n+\t\t/* Add all the RAW sizes the sensor can produce for this code. */\n+\t\tfor (const auto &rawSize : sensor->sizes(mbusCode)) {\n+\t\t\tif (rawSize.width > maxResolution_.width ||\n+\t\t\t    rawSize.height > maxResolution_.height)\n+\t\t\t\tcontinue;\n+\n+\t\t\tstreamFormats[format].push_back({ rawSize, rawSize });\n+\t\t}\n \n \t\t/*\n \t\t * Store the raw format with the highest bits per pixel for\n","prefixes":["libcamera-devel","v5","4/4"]}