{"id":18426,"url":"https://patchwork.libcamera.org/api/1.1/patches/18426/?format=json","web_url":"https://patchwork.libcamera.org/patch/18426/","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":"<20230321172004.176852-5-jacopo.mondi@ideasonboard.com>","date":"2023-03-21T17:20:04","name":"[libcamera-devel,v4,4/4] libcamera: rkisp1: Fix enumeration of RAW formats","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"3e64abc4bade64a65c74161151d6a1ce9dd555a3","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/18426/mbox/","series":[{"id":3809,"url":"https://patchwork.libcamera.org/api/1.1/series/3809/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3809","date":"2023-03-21T17:20:00","name":"libcamera: rkisp1: Fix generateConfiguration","version":4,"mbox":"https://patchwork.libcamera.org/series/3809/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18426/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18426/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 06D28C329D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 21 Mar 2023 17:20:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 850166270F;\n\tTue, 21 Mar 2023 18:20:18 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CBC6D62718\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Mar 2023 18:20:14 +0100 (CET)","from uno.homenet.telecomitalia.it\n\t(host-87-18-61-243.retail.telecomitalia.it [87.18.61.243])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 17ED61207;\n\tTue, 21 Mar 2023 18:20:14 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1679419218;\n\tbh=SvlGingAbuAk31teNuj37mbGpJeg0IqJ0mjlriIz96k=;\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=CimfvsJtBPQnMmH0+ekXxk2idiLzRnTb1ZRRnWepi1H4fyVVUXRPJEJoDGqhvsjwH\n\tSddSugu1QrVQSAOYT/MePZWDfejxEWDVVw+89BHpoNFjfnQ2MzPQgNcEJoeR2fTQA3\n\tlHMXa35a8iADs6inEZaBRHqLKlGGpRkmVstQ19EB77mcnG99SfMRWizPCz2UgnveEf\n\tprjb7iPBmMrNt2E/vo8kJzgmW0ic7N3bp1fZFHT7xZ/PatT3QGQTQSSPqxFuogbh95\n\tbecnVYpF3yCIQgzWFNYoQxMxJz5CJS/3TTTstw23hOB0Ob3OONQXCsnR1DVp7xY9YR\n\tlDY4597JzH0IQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1679419214;\n\tbh=SvlGingAbuAk31teNuj37mbGpJeg0IqJ0mjlriIz96k=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=TUikQCqHsBDrRN+3G3XEscG/1OheljUEK2a51pPSEJruFws16B0vkbGttFZ9fS8Q1\n\tb2jR+53xgCNZtJKnGZRXY3lurBTXl4FfDi3MZAkGco0vlYLYCtMEGhVj3p+YB+fINz\n\tjZkw4YLpxov6UsCrhqSVg9g0V+Yy58uAV5MNXB68="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"TUikQCqH\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 21 Mar 2023 18:20:04 +0100","Message-Id":"<20230321172004.176852-5-jacopo.mondi@ideasonboard.com>","X-Mailer":"git-send-email 2.40.0","In-Reply-To":"<20230321172004.176852-1-jacopo.mondi@ideasonboard.com>","References":"<20230321172004.176852-1-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 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>\n---\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 19 +++++++++++++++++--\n 1 file changed, 17 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\nindex cca593b84260..8d606de7880f 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n@@ -150,18 +150,33 @@ RkISP1Path::generateConfiguration(const CameraSensor *sensor,\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 > maxResolution_)\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","v4","4/4"]}