Show a patch.

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

{
    "id": 24841,
    "url": "https://patchwork.libcamera.org/api/patches/24841/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/24841/",
    "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": "<20251028-exposure-limits-v2-3-a8b5a318323e@ideasonboard.com>",
    "date": "2025-10-28T09:31:49",
    "name": "[v2,03/10] ipa: ipu3: Move CameraHelper to context",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b4b6e927d2acac4d1c697c19131aa65f1e6ea151",
    "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/24841/mbox/",
    "series": [
        {
            "id": 5536,
            "url": "https://patchwork.libcamera.org/api/series/5536/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5536",
            "date": "2025-10-28T09:31:46",
            "name": "libipa: agc: Calculate exposure limits",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5536/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/24841/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/24841/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 BF99BBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Oct 2025 09:32:19 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4CE21607A6;\n\tTue, 28 Oct 2025 10:32:14 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9FC37607A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Oct 2025 10:32:08 +0100 (CET)",
            "from [192.168.0.172] (mob-5-90-58-13.net.vodafone.it [5.90.58.13])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 13AFE1F0E; \n\tTue, 28 Oct 2025 10:30: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=\"Van7cVtN\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761643820;\n\tbh=V/LKpOf9yhdXRyBPE0ppKYaI4nGg8p0p2ziSbJ5qtY8=;\n\th=From:Date:Subject:References:In-Reply-To:To:Cc:From;\n\tb=Van7cVtNxSOfKwy9ar479LdhcE+/AvjTudJ/BvCIJqm2vE3z+40iW/E69gCFM4Da7\n\tj5Xx2UuyyRnl5SoDO+gztovfNRQ7/Y0q2wLP177LPAKezU2zA2C89h8xzQv9wzkc8n\n\twW0KJP0EadKGx+U+kdKYpi+SRFn+C4TzNEasHY58=",
        "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Date": "Tue, 28 Oct 2025 10:31:49 +0100",
        "Subject": "[PATCH v2 03/10] ipa: ipu3: Move CameraHelper to context",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20251028-exposure-limits-v2-3-a8b5a318323e@ideasonboard.com>",
        "References": "<20251028-exposure-limits-v2-0-a8b5a318323e@ideasonboard.com>",
        "In-Reply-To": "<20251028-exposure-limits-v2-0-a8b5a318323e@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=4027;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=V/LKpOf9yhdXRyBPE0ppKYaI4nGg8p0p2ziSbJ5qtY8=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpAI2VhIPNLjHNbc6qJQ1o6nlXRY4ND7bRdHWn9\n\tQlplis7HeSJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaQCNlQAKCRByNAaPFqFW\n\tPLjbD/wI4rcrIJpYZFr3WPiiMpNHQt78NrXbhewfcpOlMMzLDnJVYEf3nm4EG7PdFR8u4BkYWJs\n\t8K3E8vu7YovxeIAZ/sUJ/rs/D2Rag4YOehFQ2iVu0TN+sQKWgact8r6kuYNFcbrEZaR/WC7Hp4U\n\teHPmqsgw2dVeTuRowh8h7qp/stv3PTCbCMBAGmIWlDrJXbN0m9soRxB4z7H/n3kWww4S7Vh7cHn\n\teEpy+Zlzr0vCMdC+wuR2BnBUVP7UxpJ+fU/eC3hFSGPk+aPrLYWQGAhTVn2ig98+3nYtXM4IG0r\n\tucaW2XYA3VRTYIfdcvYlHEFmVZ1IhZmplkbgyxL+MPSzXfttoHdQHGD+bT4rNAAUdz8MRgHy7GO\n\th189D/b1dN+DlxymyKp5UvtYvID0bFdOqUjjIszL+co8V1pM23otvJ4vvr5nLHpMgqSp3p/gzDA\n\tDWW+4o3DBTST6JRozLpuWfnOYVhYadSz+fkw7nKjO8hxLX3ckMKeYYfwwjqQCyw3EmboF3z+p0j\n\tgagI11402RnO+FPku9nO4NscWCq36qMbHjhbUqs+/G+jdvvG70XT6k5WglM24AfOY+EttgMZPZQ\n\tEg0SzCVf6YTyqJxKOfS8FVj7MylZXVZGcZYZOE3cf7ahnz36QP9HnaNn+nZP3fbzcdo1Dcv75FP\n\ttqIhFKbAyb9SeAQ==",
        "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": "Move the CameraHelper sensor to the Context so that it can be\nused by the algorithms directly.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/ipu3/ipa_context.cpp |  3 +++\n src/ipa/ipu3/ipa_context.h   |  3 +++\n src/ipa/ipu3/ipu3.cpp        | 15 ++++++---------\n 3 files changed, 12 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp\nindex 3b22f7917650d9e400d5368c2f890d6b2dc846a0..5d0ebaaec454fca823851228614a3eb229f0132b 100644\n--- a/src/ipa/ipu3/ipa_context.cpp\n+++ b/src/ipa/ipu3/ipa_context.cpp\n@@ -54,6 +54,9 @@ namespace libcamera::ipa::ipu3 {\n  *\n  * \\var IPAContext::ctrlMap\n  * \\brief A ControlInfoMap::Map of controls populated by the algorithms\n+ *\n+ * \\var IPAContext::camHelper\n+ * \\brief The camera sensor helper\n  */\n \n /**\ndiff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\nindex 97fcf06cd4ac9ac6d64c4933fcea80ace0e572df..4544d663642fb6fde1cf69a32f1c0fbb2fbd98f6 100644\n--- a/src/ipa/ipu3/ipa_context.h\n+++ b/src/ipa/ipu3/ipa_context.h\n@@ -15,6 +15,7 @@\n #include <libcamera/controls.h>\n #include <libcamera/geometry.h>\n \n+#include <libipa/camera_sensor_helper.h>\n #include <libipa/fc_queue.h>\n \n namespace libcamera {\n@@ -95,6 +96,8 @@ struct IPAContext {\n \tFCQueue<IPAFrameContext> frameContexts;\n \n \tControlInfoMap::Map ctrlMap;\n+\n+\tstd::unique_ptr<CameraSensorHelper> camHelper;\n };\n \n } /* namespace ipa::ipu3 */\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 1cae08bf255f6f53a0ebee02ba3aadda5a650ae3..36d8f0da430a3d4f94e2a3f760850519742ea992 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -179,9 +179,6 @@ private:\n \n \tIPACameraSensorInfo sensorInfo_;\n \n-\t/* Interface to the Camera Helper */\n-\tstd::unique_ptr<CameraSensorHelper> camHelper_;\n-\n \t/* Local parameter storage */\n \tstruct IPAContext context_;\n };\n@@ -222,8 +219,8 @@ void IPAIPU3::updateSessionConfiguration(const ControlInfoMap &sensorControls)\n \t */\n \tcontext_.configuration.agc.minExposureTime = minExposure * context_.configuration.sensor.lineDuration;\n \tcontext_.configuration.agc.maxExposureTime = maxExposure * context_.configuration.sensor.lineDuration;\n-\tcontext_.configuration.agc.minAnalogueGain = camHelper_->gain(minGain);\n-\tcontext_.configuration.agc.maxAnalogueGain = camHelper_->gain(maxGain);\n+\tcontext_.configuration.agc.minAnalogueGain = context_.camHelper->gain(minGain);\n+\tcontext_.configuration.agc.maxAnalogueGain = context_.camHelper->gain(maxGain);\n }\n \n /**\n@@ -301,8 +298,8 @@ int IPAIPU3::init(const IPASettings &settings,\n \t\t  const ControlInfoMap &sensorControls,\n \t\t  ControlInfoMap *ipaControls)\n {\n-\tcamHelper_ = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n-\tif (camHelper_ == nullptr) {\n+\tcontext_.camHelper = CameraSensorHelperFactoryBase::create(settings.sensorModel);\n+\tif (context_.camHelper == nullptr) {\n \t\tLOG(IPAIPU3, Error)\n \t\t\t<< \"Failed to create camera sensor helper for \"\n \t\t\t<< settings.sensorModel;\n@@ -597,7 +594,7 @@ void IPAIPU3::processStats(const uint32_t frame,\n \tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n \n \tframeContext.sensor.exposure = sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();\n-\tframeContext.sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n+\tframeContext.sensor.gain = context_.camHelper->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>());\n \n \tControlList metadata(controls::controls);\n \n@@ -643,7 +640,7 @@ void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls)\n void IPAIPU3::setControls(unsigned int frame)\n {\n \tint32_t exposure = context_.activeState.agc.exposure;\n-\tint32_t gain = camHelper_->gainCode(context_.activeState.agc.gain);\n+\tint32_t gain = context_.camHelper->gainCode(context_.activeState.agc.gain);\n \n \tControlList ctrls(sensorCtrls_);\n \tctrls.set(V4L2_CID_EXPOSURE, exposure);\n",
    "prefixes": [
        "v2",
        "03/10"
    ]
}