{"id":18298,"url":"https://patchwork.libcamera.org/api/1.1/patches/18298/?format=json","web_url":"https://patchwork.libcamera.org/patch/18298/","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":"<20230222151917.669526-5-jacopo.mondi@ideasonboard.com>","date":"2023-02-22T15:19:17","name":"[libcamera-devel,v2,4/4] libcamera: rkisp1: Fix enumeration of RAW formats","commit_ref":null,"pull_url":null,"state":"superseded","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/18298/mbox/","series":[{"id":3762,"url":"https://patchwork.libcamera.org/api/1.1/series/3762/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3762","date":"2023-02-22T15:19:13","name":"libcamera: rkisp1: Fix generateConfiguration","version":2,"mbox":"https://patchwork.libcamera.org/series/3762/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18298/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18298/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 33E4AC329D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 Feb 2023 15:19:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CEE6A62653;\n\tWed, 22 Feb 2023 16:19:34 +0100 (CET)","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 4A0BE62661\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Feb 2023 16:19:31 +0100 (CET)","from uno.homenet.telecomitalia.it\n\t(host-87-16-53-160.retail.telecomitalia.it [87.16.53.160])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AAE022A4D;\n\tWed, 22 Feb 2023 16:19:30 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1677079174;\n\tbh=Et2NTSDfUNPx5FFsms1sFNkh90eZg5g0TlDuO4bW2AA=;\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=Gbx2uLy6rqhRpIx+Tgy9wYaRiPLJxYx3mBJOo8D0QDDliVG760bKaZUtgWxdnIR17\n\tG8H4x+5OgjKClDdgfBjjUj4vuceIhKOZDekN6tQyC7TjmYZmXbjFRXNNpNbGY945dt\n\tgfPMrPH0eEfaLOTIRWp01uHT8HITyxR1auJxyotlppVMx2oOAOxirtiqEQckXwwdVx\n\tVD5HFKWGObyvhjFnjKkuH5xNPH64oyQdhnzltQrAmBG1bLtDW1UQDX2edZEBTC0d/O\n\tMPR/CjWZK15w6tJj/QgQbx5Hs0qDSVo0bniYAo66G/FTfcbSmhUFm469qRjU/X2JOY\n\tAq7ew2i1lfphg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1677079171;\n\tbh=Et2NTSDfUNPx5FFsms1sFNkh90eZg5g0TlDuO4bW2AA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=MJ/ZXLJhRhzBzDcnN00VZ/85xNhpe1fdSVzLhpXeTnjMv9MrkFRCbnuLAHdX2evKK\n\toOe5Ot4ECvy4cT09deVftCxv99VBIMF0YGIiQ+LXV65nTWtnuS0YRM07I/bZu/m5Jn\n\tk5BkTR4ktD0tWCeAN69diXgssjFW/wfpWLCh6jdc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"MJ/ZXLJh\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 22 Feb 2023 16:19:17 +0100","Message-Id":"<20230222151917.669526-5-jacopo.mondi@ideasonboard.com>","X-Mailer":"git-send-email 2.39.0","In-Reply-To":"<20230222151917.669526-1-jacopo.mondi@ideasonboard.com>","References":"<20230222151917.669526-1-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 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\nSigned-off-by: Jacopo Mondi <jacopo.mondi@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 a27ac6fc35cb..0e4d76677732 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","v2","4/4"]}