{"id":16834,"url":"https://patchwork.libcamera.org/api/1.1/patches/16834/?format=json","web_url":"https://patchwork.libcamera.org/patch/16834/","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":"<20220727084052.590421-4-fsylvestre@baylibre.com>","date":"2022-07-27T08:40:50","name":"[libcamera-devel,v4,3/5] ipa: rkisp1: Add support of Lens Shading Correction control","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"e7365fae3e14a5acffcc30c9772fe07fefb6a4ce","submitter":{"id":123,"url":"https://patchwork.libcamera.org/api/1.1/people/123/?format=json","name":"Florian Sylvestre","email":"fsylvestre@baylibre.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16834/mbox/","series":[{"id":3334,"url":"https://patchwork.libcamera.org/api/1.1/series/3334/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3334","date":"2022-07-27T08:40:47","name":"Add GSL, LSC and DPCC tuning support for rkisp1","version":4,"mbox":"https://patchwork.libcamera.org/series/3334/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16834/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16834/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 804E1BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Jul 2022 08:41:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E682F63315;\n\tWed, 27 Jul 2022 10:41:03 +0200 (CEST)","from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3359F63312\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 10:41:02 +0200 (CEST)","by mail-wm1-x32a.google.com with SMTP id\n\tw8-20020a05600c014800b003a32e89bc4eso628221wmm.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Jul 2022 01:41:02 -0700 (PDT)","from BL087.. ([2a01:e34:eea9:e630:5810:316e:87c:fc17])\n\tby smtp.gmail.com with ESMTPSA id\n\t16-20020a05600c241000b003a2f6367049sm1464275wmp.48.2022.07.27.01.41.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 Jul 2022 01:41:00 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658911263;\n\tbh=TgM3OFCU+4ume0Sw8TIAIaaXr2bHJjOojq/4+OzBgx8=;\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:\n\tFrom;\n\tb=aOZWKekLpzR/MwPkcB0pzjIo1GKE++lrHBof+UeK468iR/UmRjNdrWBL0IeSrydVC\n\tR4KRBK1r6vCrwYUiJihxd7Cr/skqv/9xWJsjzxlVYdl05xQSYCe0uYKIVh8OdfcQIx\n\tQ3tYo9bPjWrDzaYfLeAE676aQtb/MeTIIPYMMhmHW7wnPAWX4hCFMYGIUYlQcV658Y\n\tb1QMItuN5q6LC2SuTXhaq1Y1SEN/q7sv7+bGdmeU6XAbaFU6e8ES8nTzfKoPSy1B2q\n\tpVRC0Ge2IH1PnHDS1mep37jL1yzblpqYeLnYA1uMfpj3GF+ACumsZJGs0roS6HTQpm\n\tQwczZp6RaNfWQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=baylibre-com.20210112.gappssmtp.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=L3ZB9oIyF//aD5dKz5VP/XJz+nt6QCKPwvu1wpVey74=;\n\tb=ukD9NC+fBwQ3WtdVoedO5Tcd0YOLLmO5CViUzx3JR3QeAHmamhrrZCgRNowpjS3Jqd\n\tXpsrGN/KvYRA4Y207x+vLXjJLBn6hUmV2F9SHYZxo8dvamRm7nn4QJ/cNBh5uYqFozKu\n\tDSww9p3ODIIAiPeA9mXphNEdJ2qnf8MgkCAtIW+AnF7T60WlIrgG3WWk1ArKg/6pf3iK\n\tHUPPda3re8e3qqalUMkhpiJ6Hw8dKggCEUuSDOIcTTi9z0XHcOpZndy8Wo+s6m2Ru1lN\n\thvqlBcpZKaIGgEz1picH8p4EsmvDUvCJ07j07HmpF/EeFWlQCxSTqWmDGSCiebViUJu4\n\td4mQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=baylibre-com.20210112.gappssmtp.com\n\theader.i=@baylibre-com.20210112.gappssmtp.com header.b=\"ukD9NC+f\"; \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=L3ZB9oIyF//aD5dKz5VP/XJz+nt6QCKPwvu1wpVey74=;\n\tb=hyv7WsSPqpdVs4tnOvTk3n/xqmnmel8gD7/3hZseQlAnFWje/9QJe4H+RhYMMed0tK\n\tlMPJGiHUGdKRiQy0omWYbY5E2+nFFZBMc06Oak2PvJBLHWbKzc86Vt5SGyENduexHUiI\n\tGfqyU9r/VF8y27W8W+bqE5UyPkn3eJpzmoTRL5amUSCKEE7sq2drDQOz/+SZq72ysUP3\n\tsSw0YT4PAqGvpvtywNN47NCDcZgwGV/DLPN4e02ux9NSZgYM2c5oRy9TIH1dJulUC8a1\n\tpxSS1WDL/R0SMQsnlx9B66CkxUh22o3RvWpxlH9xOwSIwgWuYp8zYEfGpymG4fCic4R8\n\tWrVA==","X-Gm-Message-State":"AJIora9EcdgrAlQWlG8xdqnsj2XUe/N6b4X9C3mezTmhJyQq5s5Omxsc\n\tgdrwGDGQN1/9J0QtPwAX8jpttvw6XZErJ3zK","X-Google-Smtp-Source":"AGRyM1slbo7wCfuPz+0S6Z6Y+Mm0pqKPCase3X7x0mvSYoltbhtvhoMhrJH4zFNW0cvNof9ugUuF0A==","X-Received":"by 2002:a1c:720a:0:b0:3a3:327:da23 with SMTP id\n\tn10-20020a1c720a000000b003a30327da23mr2284666wmc.196.1658911260934; \n\tWed, 27 Jul 2022 01:41:00 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 27 Jul 2022 10:40:50 +0200","Message-Id":"<20220727084052.590421-4-fsylvestre@baylibre.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20220727084052.590421-1-fsylvestre@baylibre.com>","References":"<20220727084052.590421-1-fsylvestre@baylibre.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 3/5] ipa: rkisp1: Add support of Lens\n\tShading Correction control","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":"Florian Sylvestre via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Florian Sylvestre <fsylvestre@baylibre.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The Lens Shading Correction algorithm applies multipliers to all pixels\nto compensate for the lens shading effect. The coefficients are\nspecified in a downscaled table in the YAML tuning file.\n\nSigned-off-by: Florian Sylvestre <fsylvestre@baylibre.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/lsc.cpp     | 175 ++++++++++++++++++++++++++\n src/ipa/rkisp1/algorithms/lsc.h       |  38 ++++++\n src/ipa/rkisp1/algorithms/meson.build |   1 +\n src/ipa/rkisp1/data/ov5640.yaml       |  79 ++++++++++++\n src/ipa/rkisp1/ipa_context.cpp        |   3 +\n src/ipa/rkisp1/ipa_context.h          |   1 +\n src/ipa/rkisp1/rkisp1.cpp             |   1 +\n 7 files changed, 298 insertions(+)\n create mode 100644 src/ipa/rkisp1/algorithms/lsc.cpp\n create mode 100644 src/ipa/rkisp1/algorithms/lsc.h","diff":"diff --git a/src/ipa/rkisp1/algorithms/lsc.cpp b/src/ipa/rkisp1/algorithms/lsc.cpp\nnew file mode 100644\nindex 00000000..cbf4a15d\n--- /dev/null\n+++ b/src/ipa/rkisp1/algorithms/lsc.cpp\n@@ -0,0 +1,175 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021-2022, Ideas On Board\n+ *\n+ * lsc.cpp - RkISP1 Lens Shading Correction control\n+ */\n+\n+#include \"lsc.h\"\n+\n+#include <cmath>\n+#include <numeric>\n+\n+#include <libcamera/base/log.h>\n+\n+#include \"libcamera/internal/yaml_parser.h\"\n+\n+#include \"linux/rkisp1-config.h\"\n+\n+/**\n+ * \\file lsc.h\n+ */\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1::algorithms {\n+\n+/**\n+ * \\class LensShadingCorrection\n+ * \\brief RkISP1 Lens Shading Correction control\n+ *\n+ * Due to the optical characteristics of the lens, the light intensity received\n+ * by the sensor is not uniform.\n+ *\n+ * The Lens Shading Correction algorithm applies multipliers to all pixels\n+ * to compensate for the lens shading effect. The coefficients are\n+ * specified in a downscaled table in the YAML tuning file.\n+ */\n+\n+LOG_DEFINE_CATEGORY(RkISP1Lsc)\n+\n+static std::vector<double> parseSizes(const YamlObject &tuningData,\n+\t\t\t\t      const char *prop)\n+{\n+\tstd::vector<double> sizes = tuningData[prop].getList<double>();\n+\tif (sizes.size() != RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE) {\n+\t\tLOG(RkISP1Lsc, Error)\n+\t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n+\t\t\t<< RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE\n+\t\t\t<< \" elements, got \" << sizes.size();\n+\t\treturn {};\n+\t}\n+\n+\t/*\n+\t * The sum of all elements must be 0.5 to satisfy hardware constraints.\n+\t * Validate it here, allowing a 1% tolerance as rounding errors may\n+\t * prevent an exact match (further adjustments will be performed in\n+\t * LensShadingCorrection::prepare()).\n+\t */\n+\tfloat sum = std::accumulate(sizes.begin(), sizes.end(), 0.0f);\n+\tif (sum < 0.495 || sum > 0.505) {\n+\t\tLOG(RkISP1Lsc, Error)\n+\t\t\t<< \"Invalid '\" << prop << \"' values: sum of the elements\"\n+\t\t\t<< \" should be 0.5, got \" << sum;\n+\t\treturn {};\n+\t}\n+\n+\treturn sizes;\n+}\n+\n+static std::vector<uint16_t> parseTable(const YamlObject &tuningData,\n+\t\t\t\t\tconst char *prop)\n+{\n+\tstatic constexpr unsigned int kLscNumSamples =\n+\t\tRKISP1_CIF_ISP_LSC_SAMPLES_MAX * RKISP1_CIF_ISP_LSC_SAMPLES_MAX;\n+\n+\tstd::vector<uint16_t> table = tuningData[prop].getList<uint16_t>();\n+\tif (table.size() != kLscNumSamples) {\n+\t\tLOG(RkISP1Lsc, Error)\n+\t\t\t<< \"Invalid '\" << prop << \"' values: expected \"\n+\t\t\t<< kLscNumSamples\n+\t\t\t<< \" elements, got \" << table.size();\n+\t\treturn {};\n+\t}\n+\n+\treturn table;\n+}\n+\n+LensShadingCorrection::LensShadingCorrection()\n+\t: initialized_(false)\n+{\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::init\n+ */\n+int LensShadingCorrection::init([[maybe_unused]] IPAContext &context,\n+\t\t\t\tconst YamlObject &tuningData)\n+{\n+\txSize_ = parseSizes(tuningData, \"x-size\");\n+\tySize_ = parseSizes(tuningData, \"y-size\");\n+\n+\tif (xSize_.empty() || ySize_.empty())\n+\t\treturn -EINVAL;\n+\n+\trData_ = parseTable(tuningData, \"r\");\n+\tgrData_ = parseTable(tuningData, \"gr\");\n+\tgbData_ = parseTable(tuningData, \"gb\");\n+\tbData_ = parseTable(tuningData, \"b\");\n+\n+\tif (rData_.empty() || grData_.empty() ||\n+\t    gbData_.empty() || bData_.empty())\n+\t\treturn -EINVAL;\n+\n+\tinitialized_ = true;\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * \\copydoc libcamera::ipa::Algorithm::prepare\n+ */\n+void LensShadingCorrection::prepare(IPAContext &context,\n+\t\t\t\t    rkisp1_params_cfg *params)\n+{\n+\tif (context.frameContext.frameCount > 0)\n+\t\treturn;\n+\n+\tif (!initialized_)\n+\t\treturn;\n+\n+\tstruct rkisp1_cif_isp_lsc_config &config = params->others.lsc_config;\n+\tconst Size &size = context.configuration.sensor.size;\n+\tSize totalSize{};\n+\n+\tfor (unsigned int i = 0; i < RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE; ++i) {\n+\t\tconfig.x_size_tbl[i] = xSize_[i] * size.width;\n+\t\tconfig.y_size_tbl[i] = ySize_[i] * size.height;\n+\n+\t\t/*\n+\t\t * To prevent unexpected behavior of the ISP, the sum of x_size_tbl and\n+\t\t * y_size_tbl items shall be equal to respectively size.width/2 and\n+\t\t * size.height/2. Enforce it by computing the last tables value to avoid\n+\t\t * rounding-induced errors.\n+\t\t */\n+\t\tif (i == RKISP1_CIF_ISP_LSC_SECTORS_TBL_SIZE - 1) {\n+\t\t\tconfig.x_size_tbl[i] = size.width / 2 - totalSize.width;\n+\t\t\tconfig.y_size_tbl[i] = size.height / 2 - totalSize.height;\n+\t\t}\n+\n+\t\ttotalSize.width += config.x_size_tbl[i];\n+\t\ttotalSize.height += config.y_size_tbl[i];\n+\n+\t\tconfig.x_grad_tbl[i] = std::round(32768 / config.x_size_tbl[i]);\n+\t\tconfig.y_grad_tbl[i] = std::round(32768 / config.y_size_tbl[i]);\n+\t}\n+\n+\tstd::copy(rData_.begin(), rData_.end(),\n+\t\t  &params->others.lsc_config.r_data_tbl[0][0]);\n+\tstd::copy(grData_.begin(), grData_.end(),\n+\t\t  &params->others.lsc_config.gr_data_tbl[0][0]);\n+\tstd::copy(gbData_.begin(), gbData_.end(),\n+\t\t  &params->others.lsc_config.gb_data_tbl[0][0]);\n+\tstd::copy(bData_.begin(), bData_.end(),\n+\t\t  &params->others.lsc_config.b_data_tbl[0][0]);\n+\n+\tparams->module_en_update |= RKISP1_CIF_ISP_MODULE_LSC;\n+\tparams->module_ens |= RKISP1_CIF_ISP_MODULE_LSC;\n+\tparams->module_cfg_update |= RKISP1_CIF_ISP_MODULE_LSC;\n+}\n+\n+REGISTER_IPA_ALGORITHM(LensShadingCorrection, \"LensShadingCorrection\")\n+\n+} /* namespace ipa::rkisp1::algorithms */\n+\n+} /* namespace libcamera */\ndiff --git a/src/ipa/rkisp1/algorithms/lsc.h b/src/ipa/rkisp1/algorithms/lsc.h\nnew file mode 100644\nindex 00000000..fdb2ec1d\n--- /dev/null\n+++ b/src/ipa/rkisp1/algorithms/lsc.h\n@@ -0,0 +1,38 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2021-2022, Ideas On Board\n+ *\n+ * lsc.h - RkISP1 Lens Shading Correction control\n+ */\n+\n+#pragma once\n+\n+#include \"algorithm.h\"\n+\n+namespace libcamera {\n+\n+namespace ipa::rkisp1::algorithms {\n+\n+class LensShadingCorrection : public Algorithm\n+{\n+public:\n+\tLensShadingCorrection();\n+\t~LensShadingCorrection() = default;\n+\n+\tint init(IPAContext &context, const YamlObject &tuningData) override;\n+\tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n+\n+private:\n+\tbool initialized_;\n+\n+\tstd::vector<uint16_t> rData_;\n+\tstd::vector<uint16_t> grData_;\n+\tstd::vector<uint16_t> gbData_;\n+\tstd::vector<uint16_t> bData_;\n+\n+\tstd::vector<double> xSize_;\n+\tstd::vector<double> ySize_;\n+};\n+\n+} /* namespace ipa::rkisp1::algorithms */\n+} /* namespace libcamera */\ndiff --git a/src/ipa/rkisp1/algorithms/meson.build b/src/ipa/rkisp1/algorithms/meson.build\nindex 0597c353..64e11dce 100644\n--- a/src/ipa/rkisp1/algorithms/meson.build\n+++ b/src/ipa/rkisp1/algorithms/meson.build\n@@ -5,4 +5,5 @@ rkisp1_ipa_algorithms = files([\n     'awb.cpp',\n     'blc.cpp',\n     'gsl.cpp',\n+    'lsc.cpp',\n ])\ndiff --git a/src/ipa/rkisp1/data/ov5640.yaml b/src/ipa/rkisp1/data/ov5640.yaml\nindex 13f76412..fa2ae436 100644\n--- a/src/ipa/rkisp1/data/ov5640.yaml\n+++ b/src/ipa/rkisp1/data/ov5640.yaml\n@@ -16,4 +16,83 @@ algorithms:\n         red:   [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]\n         green: [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]\n         blue:  [ 0, 256, 512, 768, 1024, 1280, 1536, 1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584, 3840, 4095 ]\n+  - LensShadingCorrection:\n+      x-size: [ 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625 ]\n+      y-size: [ 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625, 0.0625 ]\n+      r:  [\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+          ]\n+      gr: [\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+          ]\n+      gb: [\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+          ]\n+      b:  [\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+            1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n+          ]\n ...\ndiff --git a/src/ipa/rkisp1/ipa_context.cpp b/src/ipa/rkisp1/ipa_context.cpp\nindex 1559d3ff..30bb87a9 100644\n--- a/src/ipa/rkisp1/ipa_context.cpp\n+++ b/src/ipa/rkisp1/ipa_context.cpp\n@@ -95,6 +95,9 @@ namespace libcamera::ipa::rkisp1 {\n  *\n  * \\var IPASessionConfiguration::sensor.lineDuration\n  * \\brief Line duration in microseconds\n+ *\n+ * \\var IPASessionConfiguration::sensor.size\n+ * \\brief Sensor output resolution\n  */\n \n /**\ndiff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\nindex f387cace..3bfb262c 100644\n--- a/src/ipa/rkisp1/ipa_context.h\n+++ b/src/ipa/rkisp1/ipa_context.h\n@@ -33,6 +33,7 @@ struct IPASessionConfiguration {\n \n \tstruct {\n \t\tutils::Duration lineDuration;\n+\t\tSize size;\n \t} sensor;\n \n \tstruct {\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 4018265c..e5010f6a 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -211,6 +211,7 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,\n \t/* Set the hardware revision for the algorithms. */\n \tcontext_.configuration.hw.revision = hwRevision_;\n \n+\tcontext_.configuration.sensor.size = info.outputSize;\n \tcontext_.configuration.sensor.lineDuration = info.lineLength * 1.0s / info.pixelRate;\n \n \t/*\n","prefixes":["libcamera-devel","v4","3/5"]}