{"id":18354,"url":"https://patchwork.libcamera.org/api/patches/18354/?format=json","web_url":"https://patchwork.libcamera.org/patch/18354/","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":"<20230307114804.42291-5-jacopo.mondi@ideasonboard.com>","date":"2023-03-07T11:48:04","name":"[libcamera-devel,v3,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/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18354/mbox/","series":[{"id":3792,"url":"https://patchwork.libcamera.org/api/series/3792/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3792","date":"2023-03-07T11:48:00","name":"libcamera: rkisp1: Fix generateConfiguration","version":3,"mbox":"https://patchwork.libcamera.org/series/3792/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18354/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18354/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 EB4E9BDE17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Mar 2023 11:48:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9CEBE626C3;\n\tTue,  7 Mar 2023 12:48:25 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 416B5626BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Mar 2023 12:48:22 +0100 (CET)","from uno.homenet.telecomitalia.it\n\t(host-79-47-54-87.retail.telecomitalia.it [79.47.54.87])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 798246D5;\n\tTue,  7 Mar 2023 12:48:21 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678189705;\n\tbh=v+WGKwdwfLN7Z5/CqAoChHKxkVfoQXG8rWoPfrM3qqw=;\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=jyhF2Ko7D7YUHYssPU0JmALH3JHCRNjJG6fwvNT2ZBftR9XQnLacgXPKmglff1XBb\n\tBeZ/ns2j/BWDDX0HN2/FzlkhxODlIIW9l6wDFuwPgrSmOkRVm+OTNmCuBCaWv52k+W\n\tovlf0w82ySiaA9luyLkbYoM+ID3kzzj3hduB6yOiJlL7YmV4pi3ikCYEUX6JEctnxN\n\tS98L4gtmHWuv5ZcpjB39s9XOradrM0AvNUm9I+w4WxLqhoxiGsjw9TzTEVxI8ap1ER\n\tnLD3ekwDBDCmqfxLwZ2NyHH4SN7G+3iZnpqIq1WwuzzwbLK7dMSOBR5/ndBn1NuV5F\n\t0k8WacODQ5KCQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1678189702;\n\tbh=v+WGKwdwfLN7Z5/CqAoChHKxkVfoQXG8rWoPfrM3qqw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=oeaKUbYx2Lw7D1VtoKlhlWSrs76XfjM7g2JPYl899fJWJtD7QW8gtHafGl4ZDzpgb\n\tGaeQ9X06KswSzI97Hg4ZlmSHQOITApc/V6CCm4VJPNZdaB7d38mGDqb6iPn5xmyhlI\n\tippEt3wavZbXAOmINHlTI+0dFa+E/7TXTPfB3FdA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"oeaKUbYx\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  7 Mar 2023 12:48:04 +0100","Message-Id":"<20230307114804.42291-5-jacopo.mondi@ideasonboard.com>","X-Mailer":"git-send-email 2.39.0","In-Reply-To":"<20230307114804.42291-1-jacopo.mondi@ideasonboard.com>","References":"<20230307114804.42291-1-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 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>\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 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","v3","4/4"]}