Show a patch.

GET /api/patches/25061/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 25061,
    "url": "https://patchwork.libcamera.org/api/patches/25061/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/25061/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20251114-exposure-limits-v3-9-b7c07feba026@ideasonboard.com>",
    "date": "2025-11-14T14:17:04",
    "name": "[v3,09/19] ipa: libipa: agc: Store sensor configuration parameters",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "fa7a8dc43b3b887d98ebb8a616345247f5e556d7",
    "submitter": {
        "id": 143,
        "url": "https://patchwork.libcamera.org/api/people/143/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo.mondi@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/25061/mbox/",
    "series": [
        {
            "id": 5590,
            "url": "https://patchwork.libcamera.org/api/series/5590/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5590",
            "date": "2025-11-14T14:16:55",
            "name": "libipa: agc: Calculate exposure limits",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/5590/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/25061/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/25061/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 D08D6C3331\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Nov 2025 14:17:37 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B7CBE60AAD;\n\tFri, 14 Nov 2025 15:17:33 +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 2AFD060A9E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Nov 2025 15:17:21 +0100 (CET)",
            "from [192.168.1.101] (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3507F19B5;\n\tFri, 14 Nov 2025 15:15:20 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Fi58AOCY\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763129720;\n\tbh=J27XAYPsp2fkW+AjzsTSjz1qjYXrb/+aWHefj5WsL7E=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=Fi58AOCY5OWmxMhtkuNmGCnOk29OZPctT27cTTwUgOT6dilkKhTJR6b5wAKMn5QFG\n\tuhkZbIu0MO0MRiJdR3cyLTqViWEgziTFPMG8keh/4KW296eb931Lehp33CBUJ6XsZk\n\tfL+CyQPAFgqtlWois92KYYBuzBfVrnupmjj3k0Ts=",
        "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Date": "Fri, 14 Nov 2025 15:17:04 +0100",
        "Subject": "[PATCH v3 09/19] ipa: libipa: agc: Store sensor configuration\n\tparameters",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20251114-exposure-limits-v3-9-b7c07feba026@ideasonboard.com>",
        "References": "<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>",
        "In-Reply-To": "<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>",
        "To": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tRobert Mader <robert.mader@collabora.com>, \n\tlibcamera-devel@lists.libcamera.org",
        "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "X-Mailer": "b4 0.14.2",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=5101;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=J27XAYPsp2fkW+AjzsTSjz1qjYXrb/+aWHefj5WsL7E=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpFznrKvGWzVN4EF74fbgRb7bXF5ZhnJqP17Ky+\n\tQOPDWFQeZSJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaRc56wAKCRByNAaPFqFW\n\tPILWD/9ReQ/O/l52x+tFi9mNA3xwvKBe53UXmJXjJ/tBPlrOOH/ch+Nsxuyqn+5+VOi//YSrVl4\n\tTGTI11aZpQraTOM3STFibT9Q+73K/Z0UvNET2I/srjxR/WDkjRoEZbcklzz7jZoycaRFGVBQ2zB\n\td4ec+aDpCL288lZ4Pn5uZ/vNVcIirlbEPKEPs01XacFPWbjj2zeKa9zlYP3S6AnFmMD5oBQyLVx\n\tl8WWEpygxx+LYXeidKkqvxxvGUMJoZ/GRcqq6AzeCpKEjfiTkabEqLRPmUHco0CEtXD3mw+I/ig\n\tw0DJeI29YtyoKGXJheNrej71J9Tqi12M/F85KuSAk9XeqbZ+JTjLaxubcOJu0c4xLBdr55wBhVG\n\tEkkGRwbVzhZHc1d2WVch2kR6XUddy5KxO2S5FkpDOR1/OEqDv/dkRL83h8E8Y4Hx5/kNhrVe/W2\n\tLP1HxFp5tUgjAB7cBMmTqoM4hz9tmt27vB1BfgBIqWVyb22/LuceuolNk4zSVgilJ+H71NhctnI\n\tDzGEOv3hSEGPNztgQgxWDLVZqddat5hsPVF5mwYOjXmV2v6tnaTZDRQ4Elvmj7CGjbIIrOrwBdI\n\trbWT1E/8TOLmjouV5KeDdoGgoq01KS5zMsFJiAQKVxD3wEibiO1p98LvQklyN5CrhiwskZUVthp\n\tn5zewnYCFUC2KDA==",
        "X-Developer-Key": "i=jacopo.mondi@ideasonboard.com; a=openpgp;\n\tfpr=72392EDC88144A65C701EA9BA5826A2587AD026B",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "To prepare for changing the configure() and setLimits() functions\nof the ExposureModeHelper class, introduce the sensor configuration\nparameters that will remain valid for a streaming session, and separate\nthem from the run-time configuration parameters used by the exposure\nhelper to split shutter time and gains.\n\nOnly introduce the type in this patch but do not make use of it yet.\n\nThis change also prepares to centralize the sensor configuration\nparamters in the CameraHelper.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/libipa/exposure_mode_helper.cpp | 43 ++++++++++++++++++++++++++++-----\n src/ipa/libipa/exposure_mode_helper.h   | 18 ++++++++++++--\n 2 files changed, 53 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp\nindex 962ce1b1b7503e0f86f3857b484b249cb6383fde..c3ed1601939bd28435bbbc540d9b8c9d92b81912 100644\n--- a/src/ipa/libipa/exposure_mode_helper.cpp\n+++ b/src/ipa/libipa/exposure_mode_helper.cpp\n@@ -21,8 +21,6 @@\n \n namespace libcamera {\n \n-using namespace std::literals::chrono_literals;\n-\n LOG_DEFINE_CATEGORY(ExposureModeHelper)\n \n namespace ipa {\n@@ -59,6 +57,40 @@ namespace ipa {\n  * used.\n  */\n \n+/**\n+ * \\struct ExposureModeHelper::SensorConfiguration\n+ * \\brief The sensor configuration parameters\n+ *\n+ * This struct represents the sensor configuration paramters. Sensor\n+ * configuration parameters are set at configure() time and remain valid for\n+ * the duration of the streaming session.\n+ *\n+ * \\todo Remove it once all the information are available from the\n+ * CameraSensorHelper.\n+ *\n+ * \\var SensorConfiguration::lineDuration_\n+ * \\brief The sensor line duration\n+ *\n+ * \\var SensorConfiguration::minExposureTime_\n+ * \\brief The sensor min exposure time in microseconds\n+ *\n+ * \\var SensorConfiguration::maxExposureTime_\n+ * \\brief The sensor max exposure time in microseconds\n+ * \\todo Remove the max exposure time and calculcate it from the frame duration\n+ *\n+ * \\var SensorConfiguration::minFrameDuration_\n+ * \\brief The sensor min frame duration in microseconds\n+ *\n+ * \\var SensorConfiguration::maxFrameDuration_\n+ * \\brief The sensor max frame duration in microseconds\n+ *\n+ * \\var SensorConfiguration::minGain_\n+ * \\brief The sensor minimum analogue gain value\n+ *\n+ * \\var SensorConfiguration::maxGain_\n+ * \\brief The sensor maximum analogue gain value\n+ */\n+\n /**\n  * \\brief Construct an ExposureModeHelper instance\n  * \\param[in] stages The vector of paired exposure time and gain limits\n@@ -70,8 +102,6 @@ namespace ipa {\n  * the runtime limits set through setLimits() instead.\n  */\n ExposureModeHelper::ExposureModeHelper(const Span<std::pair<utils::Duration, double>> stages)\n-\t: lineDuration_(1us), minExposureTime_(0us), maxExposureTime_(0us),\n-\t  minGain_(0), maxGain_(0), sensorHelper_(nullptr)\n {\n \tfor (const auto &[s, g] : stages) {\n \t\texposureTimes_.push_back(s);\n@@ -97,7 +127,7 @@ ExposureModeHelper::ExposureModeHelper(const Span<std::pair<utils::Duration, dou\n void ExposureModeHelper::configure(utils::Duration lineDuration,\n \t\t\t\t   const CameraSensorHelper *sensorHelper)\n {\n-\tlineDuration_ = lineDuration;\n+\tsensor_.lineDuration_ = lineDuration;\n \tsensorHelper_ = sensorHelper;\n }\n \n@@ -134,7 +164,8 @@ utils::Duration ExposureModeHelper::clampExposureTime(utils::Duration exposureTi\n \tutils::Duration exp;\n \n \tclamped = std::clamp(exposureTime, minExposureTime_, maxExposureTime_);\n-\texp = static_cast<long>(clamped / lineDuration_) * lineDuration_;\n+\texp = static_cast<long>(clamped / sensor_.lineDuration_)\n+\t    * sensor_.lineDuration_;\n \tif (quantizationGain)\n \t\t*quantizationGain = clamped / exp;\n \ndiff --git a/src/ipa/libipa/exposure_mode_helper.h b/src/ipa/libipa/exposure_mode_helper.h\nindex f8b7a4aa4800b59459f8fc80f502b83647547f51..4971cfbf5b2be9ef0e3e95a64b815902833e93a4 100644\n--- a/src/ipa/libipa/exposure_mode_helper.h\n+++ b/src/ipa/libipa/exposure_mode_helper.h\n@@ -20,9 +20,21 @@ namespace libcamera {\n \n namespace ipa {\n \n+using namespace std::literals::chrono_literals;\n+\n class ExposureModeHelper\n {\n public:\n+\tstruct SensorConfiguration {\n+\t\tutils::Duration lineDuration_;\n+\t\tutils::Duration minExposureTime_;\n+\t\tutils::Duration maxExposureTime_;\n+\t\tutils::Duration minFrameDuration_;\n+\t\tutils::Duration maxFrameDuration_;\n+\t\tdouble minGain_;\n+\t\tdouble maxGain_;\n+\t};\n+\n \tExposureModeHelper(const Span<std::pair<utils::Duration, double>> stages);\n \t~ExposureModeHelper() = default;\n \n@@ -41,12 +53,14 @@ private:\n \tstd::vector<utils::Duration> exposureTimes_;\n \tstd::vector<double> gains_;\n \n-\tutils::Duration lineDuration_;\n+\tSensorConfiguration sensor_;\n+\tconst CameraSensorHelper *sensorHelper_ = nullptr;\n+\n+\t/* Runtime parameters, used to split exposure. */\n \tutils::Duration minExposureTime_;\n \tutils::Duration maxExposureTime_;\n \tdouble minGain_;\n \tdouble maxGain_;\n-\tconst CameraSensorHelper *sensorHelper_;\n };\n \n } /* namespace ipa */\n",
    "prefixes": [
        "v3",
        "09/19"
    ]
}