Show a patch.

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

{
    "id": 16981,
    "url": "https://patchwork.libcamera.org/api/patches/16981/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16981/",
    "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": "<20220805135312.47497-7-jacopo@jmondi.org>",
    "date": "2022-08-05T13:53:08",
    "name": "[libcamera-devel,v2,06/10] ipa: libipa: Provide a common base for FrameContexts",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": true,
    "hash": "17abd789a6d902c5d949abc0bbbae8d9d6f52af6",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16981/mbox/",
    "series": [
        {
            "id": 3376,
            "url": "https://patchwork.libcamera.org/api/series/3376/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3376",
            "date": "2022-08-05T13:53:02",
            "name": "libcamera: Align IPU3 and RKISP1 interfaces",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3376/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16981/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16981/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 9458AC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  5 Aug 2022 13:53:31 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4A0746333F;\n\tFri,  5 Aug 2022 15:53:31 +0200 (CEST)",
            "from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4FE0563328\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  5 Aug 2022 15:53:29 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id E03D21C000C;\n\tFri,  5 Aug 2022 13:53:27 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659707611;\n\tbh=Qz1Y9S43UO8F3o8Ah4sKlqobc9eFS7wbvrqlp8Vrg0g=;\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=BhcQNTE/MazS/r93b0ng/HzGaWhiBfqLuW/OiY6CUhqtmiGPXgFpFWcf7iOTwecho\n\twq6InOIsfLLNQtmOMCItKP7wrX6STwcizZl76x5hUNmuK77xlZ98Pp24KxY44degTJ\n\tbWxL9NI0LlZK7h41seGL+WcIE5vGU0i6DEr4qzKM1dVFBn/hDX+GyfUShzFC7ZekjZ\n\tpNstp/m4ytJvS/FTXPeZ5Lr9McH25WOg6FaoH4sWujq5WKe0xMpYa23N/92QDkzzFA\n\tY9cqumMm/EfbPAHYtPe6IdtPDOGoXL5ucWbAaGWKh88n5ObhwsqtBhz0bp7cvtcesu\n\taioO33mftD0NQ==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  5 Aug 2022 15:53:08 +0200",
        "Message-Id": "<20220805135312.47497-7-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.37.1",
        "In-Reply-To": "<20220805135312.47497-1-jacopo@jmondi.org>",
        "References": "<20220805135312.47497-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 06/10] ipa: libipa: Provide a common\n\tbase for FrameContexts",
        "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@jmondi.org>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Kieran Bingham via libcamera-devel <libcamera-devel@lists.libcamera.org>\n\nProvide a common IPAFrameContext as a base for IPA modules to inherit\nfrom.\n\nThis will allow having a common set of parameters for every FrameContext\nrequired by the FCQueue implementation.\n\nMake both the RKISP1 and the IPU3 define IPA specific FrameContext\nstructures which inherit from the IPAFrameContext.\n\nWhile adjusting interface to Algorithm::process() the FrameContext is\nconverted from a pointer to a reference.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/ipa/ipu3/algorithms/af.cpp           |  3 ++-\n src/ipa/ipu3/algorithms/af.h             |  2 +-\n src/ipa/ipu3/algorithms/agc.cpp          |  9 ++++----\n src/ipa/ipu3/algorithms/agc.h            |  4 ++--\n src/ipa/ipu3/algorithms/awb.cpp          |  3 ++-\n src/ipa/ipu3/algorithms/awb.h            |  2 +-\n src/ipa/ipu3/algorithms/tone_mapping.cpp |  3 ++-\n src/ipa/ipu3/algorithms/tone_mapping.h   |  2 +-\n src/ipa/ipu3/ipa_context.cpp             | 29 ++++--------------------\n src/ipa/ipu3/ipa_context.h               |  8 ++-----\n src/ipa/ipu3/ipu3.cpp                    |  6 ++---\n src/ipa/ipu3/module.h                    |  2 +-\n src/ipa/libipa/algorithm.h               |  2 +-\n src/ipa/libipa/fc_queue.cpp              | 21 +++++++++++++++++\n src/ipa/libipa/fc_queue.h                |  5 ++++\n src/ipa/rkisp1/algorithms/agc.cpp        |  2 +-\n src/ipa/rkisp1/algorithms/agc.h          |  2 +-\n src/ipa/rkisp1/algorithms/awb.cpp        |  2 +-\n src/ipa/rkisp1/algorithms/awb.h          |  2 +-\n src/ipa/rkisp1/ipa_context.h             |  4 +++-\n src/ipa/rkisp1/module.h                  |  2 +-\n src/ipa/rkisp1/rkisp1.cpp                |  5 +++-\n 22 files changed, 66 insertions(+), 54 deletions(-)",
    "diff": "diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp\nindex d07521a090ac..fcbf8e557b10 100644\n--- a/src/ipa/ipu3/algorithms/af.cpp\n+++ b/src/ipa/ipu3/algorithms/af.cpp\n@@ -420,7 +420,8 @@ bool Af::afIsOutOfFocus(IPAContext context)\n  *\n  * [1] Hill Climbing Algorithm, https://en.wikipedia.org/wiki/Hill_climbing\n  */\n-void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n+void Af::process(IPAContext &context,\n+\t\t [[maybe_unused]] IPU3FrameContext &frameContext,\n \t\t const ipu3_uapi_stats_3a *stats)\n {\n \t/* Evaluate the AF buffer length */\ndiff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h\nindex ccf015f3f8f5..7a5aeb1b6bf4 100644\n--- a/src/ipa/ipu3/algorithms/af.h\n+++ b/src/ipa/ipu3/algorithms/af.h\n@@ -32,7 +32,7 @@ public:\n \n \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n-\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n+\tvoid process(IPAContext &context, IPU3FrameContext &frameContext,\n \t\t     const ipu3_uapi_stats_3a *stats) override;\n \n private:\ndiff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\nindex 5bc64ae52214..92ea6249798d 100644\n--- a/src/ipa/ipu3/algorithms/agc.cpp\n+++ b/src/ipa/ipu3/algorithms/agc.cpp\n@@ -183,13 +183,13 @@ utils::Duration Agc::filterExposure(utils::Duration exposureValue)\n  * \\param[in] yGain The gain calculated based on the relative luminance target\n  * \\param[in] iqMeanGain The gain calculated based on the relative luminance target\n  */\n-void Agc::computeExposure(IPAContext &context, IPAFrameContext *frameContext,\n+void Agc::computeExposure(IPAContext &context, IPU3FrameContext &frameContext,\n \t\t\t  double yGain, double iqMeanGain)\n {\n \tconst IPASessionConfiguration &configuration = context.configuration;\n \t/* Get the effective exposure and gain applied on the sensor. */\n-\tuint32_t exposure = frameContext->sensor.exposure;\n-\tdouble analogueGain = frameContext->sensor.gain;\n+\tuint32_t exposure = frameContext.sensor.exposure;\n+\tdouble analogueGain = frameContext.sensor.gain;\n \n \t/* Use the highest of the two gain estimates. */\n \tdouble evGain = std::max(yGain, iqMeanGain);\n@@ -323,7 +323,8 @@ double Agc::estimateLuminance(IPAActiveState &activeState,\n  * Identify the current image brightness, and use that to estimate the optimal\n  * new exposure and gain for the scene.\n  */\n-void Agc::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n+void Agc::process(IPAContext &context,\n+\t\t  IPU3FrameContext &frameContext,\n \t\t  const ipu3_uapi_stats_3a *stats)\n {\n \t/*\ndiff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\nindex 105ae0f2aac6..96585f48933f 100644\n--- a/src/ipa/ipu3/algorithms/agc.h\n+++ b/src/ipa/ipu3/algorithms/agc.h\n@@ -28,14 +28,14 @@ public:\n \t~Agc() = default;\n \n \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n-\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n+\tvoid process(IPAContext &context, IPU3FrameContext &frameContext,\n \t\t     const ipu3_uapi_stats_3a *stats) override;\n \n private:\n \tdouble measureBrightness(const ipu3_uapi_stats_3a *stats,\n \t\t\t\t const ipu3_uapi_grid_config &grid) const;\n \tutils::Duration filterExposure(utils::Duration currentExposure);\n-\tvoid computeExposure(IPAContext &context, IPAFrameContext *frameContext,\n+\tvoid computeExposure(IPAContext &context, IPU3FrameContext &frameContext,\n \t\t\t     double yGain, double iqMeanGain);\n \tdouble estimateLuminance(IPAActiveState &activeState,\n \t\t\t\t const ipu3_uapi_grid_config &grid,\ndiff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp\nindex 704267222a31..45f8e5f29119 100644\n--- a/src/ipa/ipu3/algorithms/awb.cpp\n+++ b/src/ipa/ipu3/algorithms/awb.cpp\n@@ -387,7 +387,8 @@ void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats)\n /**\n  * \\copydoc libcamera::ipa::Algorithm::process\n  */\n-void Awb::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n+void Awb::process(IPAContext &context,\n+\t\t  [[maybe_unused]] IPU3FrameContext &frameContext,\n \t\t  const ipu3_uapi_stats_3a *stats)\n {\n \tcalculateWBGains(stats);\ndiff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h\nindex 0acd21480845..28e39620fd59 100644\n--- a/src/ipa/ipu3/algorithms/awb.h\n+++ b/src/ipa/ipu3/algorithms/awb.h\n@@ -40,7 +40,7 @@ public:\n \n \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n-\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n+\tvoid process(IPAContext &context, IPU3FrameContext &frameContext,\n \t\t     const ipu3_uapi_stats_3a *stats) override;\n \n private:\ndiff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp\nindex f86e79b24a67..977741c5a4d4 100644\n--- a/src/ipa/ipu3/algorithms/tone_mapping.cpp\n+++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp\n@@ -78,7 +78,8 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context,\n  * The tone mapping look up table is generated as an inverse power curve from\n  * our gamma setting.\n  */\n-void ToneMapping::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext,\n+void ToneMapping::process(IPAContext &context,\n+\t\t\t  [[maybe_unused]] IPU3FrameContext &frameContext,\n \t\t\t  [[maybe_unused]] const ipu3_uapi_stats_3a *stats)\n {\n \t/*\ndiff --git a/src/ipa/ipu3/algorithms/tone_mapping.h b/src/ipa/ipu3/algorithms/tone_mapping.h\nindex d7d4800628f2..8cce38c742a6 100644\n--- a/src/ipa/ipu3/algorithms/tone_mapping.h\n+++ b/src/ipa/ipu3/algorithms/tone_mapping.h\n@@ -20,7 +20,7 @@ public:\n \n \tint configure(IPAContext &context, const IPAConfigInfo &configInfo) override;\n \tvoid prepare(IPAContext &context, ipu3_uapi_params *params) override;\n-\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n+\tvoid process(IPAContext &context, IPU3FrameContext &frameContext,\n \t\t     const ipu3_uapi_stats_3a *stats) override;\n \n private:\ndiff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp\nindex 9605c8a1106d..536d76ecd63b 100644\n--- a/src/ipa/ipu3/ipa_context.cpp\n+++ b/src/ipa/ipu3/ipa_context.cpp\n@@ -35,22 +35,6 @@ namespace libcamera::ipa::ipu3 {\n  * most recently computed by the IPA algorithms.\n  */\n \n-/**\n- * \\struct IPAFrameContext\n- * \\brief Context for a frame\n- *\n- * The frame context stores data specific to a single frame processed by the\n- * IPA. Each frame processed by the IPA has a context associated with it,\n- * accessible through the IPAContext structure.\n- *\n- * Fields in the frame context should reflect values and controls\n- * associated with the specific frame as requested by the application, and\n- * as configured by the hardware. Fields can be read by algorithms to\n- * determine if they should update any specific action for this frame, and\n- * finally to update the metadata control lists when the frame is fully\n- * completed.\n- */\n-\n /**\n  * \\struct IPAContext\n  * \\brief Global IPA context data shared between all algorithms\n@@ -181,20 +165,17 @@ namespace libcamera::ipa::ipu3 {\n  */\n \n /**\n- * \\var IPAFrameContext::frame\n- * \\brief The frame number\n+ * \\struct IPU3FrameContext\n+ * \\copybrief libcamera::ipa::IPAFrameContext\n  *\n- * \\var IPAFrameContext::sensor\n+ * \\var IPU3FrameContext::sensor\n  * \\brief Effective sensor values that were applied for the frame\n  *\n- * \\var IPAFrameContext::sensor.exposure\n+ * \\var IPU3FrameContext::sensor.exposure\n  * \\brief Exposure time expressed as a number of lines\n  *\n- * \\var IPAFrameContext::sensor.gain\n+ * \\var IPU3FrameContext::sensor.gain\n  * \\brief Analogue gain multiplier\n- *\n- * \\var IPAFrameContext::error\n- * \\brief The error flags for this frame context\n  */\n \n } /* namespace libcamera::ipa::ipu3 */\ndiff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h\nindex dc5b7c30aaf9..c4aa4c3f4f6a 100644\n--- a/src/ipa/ipu3/ipa_context.h\n+++ b/src/ipa/ipu3/ipa_context.h\n@@ -14,7 +14,6 @@\n \n #include <libcamera/controls.h>\n #include <libcamera/geometry.h>\n-#include <libcamera/request.h>\n \n #include <libipa/fc_queue.h>\n \n@@ -74,22 +73,19 @@ struct IPAActiveState {\n \t} toneMapping;\n };\n \n-struct IPAFrameContext {\n-\tuint32_t frame;\n+struct IPU3FrameContext : public IPAFrameContext {\n \n \tstruct {\n \t\tuint32_t exposure;\n \t\tdouble gain;\n \t} sensor;\n-\n-\tRequest::Errors error;\n };\n \n struct IPAContext {\n \tIPASessionConfiguration configuration;\n \tIPAActiveState activeState;\n \n-\tFCQueue<IPAFrameContext> frameContexts;\n+\tFCQueue<IPU3FrameContext> frameContexts;\n };\n \n } /* namespace ipa::ipu3 */\ndiff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 209a6b040f8f..24839fd1edee 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -569,7 +569,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n \tconst ipu3_uapi_stats_3a *stats =\n \t\treinterpret_cast<ipu3_uapi_stats_3a *>(mem.data());\n \n-\tIPAFrameContext &frameContext = context_.frameContexts.get(frame);\n+\tIPU3FrameContext &frameContext = context_.frameContexts.get(frame);\n \n \tif (frameContext.frame != frame)\n \t\tLOG(IPAIPU3, Warning) << \"Frame \" << frame << \" does not match its frame context\";\n@@ -582,7 +582,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n \tControlList ctrls(controls::controls);\n \n \tfor (auto const &algo : algorithms_)\n-\t\talgo->process(context_, &frameContext, stats);\n+\t\talgo->process(context_, frameContext, stats);\n \n \tsetControls(frame);\n \n@@ -618,7 +618,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls)\n {\n \t/* \\todo Start processing for 'frame' based on 'controls'. */\n-\tIPAFrameContext &frameContext = context_.frameContexts.initialise(frame);\n+\tIPU3FrameContext &frameContext = context_.frameContexts.initialise(frame);\n \n \t/* \\todo Implement queueRequest to each algorithm. */\n \t(void)frameContext;\ndiff --git a/src/ipa/ipu3/module.h b/src/ipa/ipu3/module.h\nindex d94fc4594871..6d0d50f615d8 100644\n--- a/src/ipa/ipu3/module.h\n+++ b/src/ipa/ipu3/module.h\n@@ -19,7 +19,7 @@ namespace libcamera {\n \n namespace ipa::ipu3 {\n \n-using Module = ipa::Module<IPAContext, IPAFrameContext, IPAConfigInfo,\n+using Module = ipa::Module<IPAContext, IPU3FrameContext, IPAConfigInfo,\n \t\t\t   ipu3_uapi_params, ipu3_uapi_stats_3a>;\n \n } /* namespace ipa::ipu3 */\ndiff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h\nindex ccc659a63e3b..0fe3d772963a 100644\n--- a/src/ipa/libipa/algorithm.h\n+++ b/src/ipa/libipa/algorithm.h\n@@ -49,7 +49,7 @@ public:\n \t}\n \n \tvirtual void process([[maybe_unused]] typename Module::Context &context,\n-\t\t\t     [[maybe_unused]] typename Module::FrameContext *frameContext,\n+\t\t\t     [[maybe_unused]] typename Module::FrameContext &frameContext,\n \t\t\t     [[maybe_unused]] const typename Module::Stats *stats)\n \t{\n \t}\ndiff --git a/src/ipa/libipa/fc_queue.cpp b/src/ipa/libipa/fc_queue.cpp\nindex 37ffca60b992..f0d0b3c7168d 100644\n--- a/src/ipa/libipa/fc_queue.cpp\n+++ b/src/ipa/libipa/fc_queue.cpp\n@@ -66,6 +66,27 @@ namespace ipa {\n  * the PFCError flag is automatically raised on the FrameContext.\n  */\n \n+/**\n+ * \\struct IPAFrameContext\n+ * \\brief Context for a frame\n+ *\n+ * The frame context stores data specific to a single frame processed by the\n+ * IPA. Each frame processed by the IPA has a context associated with it,\n+ * accessible through the Frame Context Queue.\n+ *\n+ * Fields in the frame context should reflect values and controls associated\n+ * with the specific frame as requested by the application, and as configured by\n+ * the hardware. Fields can be read by algorithms to determine if they should\n+ * update any specific action for this frame, and finally to update the metadata\n+ * control lists when the frame is fully completed.\n+ *\n+ * \\var IPAFrameContext::frame\n+ * \\brief The frame number\n+ *\n+ * \\var IPAFrameContext::error\n+ * \\brief The error flags associated with the frame\n+ */\n+\n /**\n  * \\fn FCQueue::clear()\n  * \\brief Clear the context queue\ndiff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h\nindex 023b52420fe7..73b7f25f8c20 100644\n--- a/src/ipa/libipa/fc_queue.h\n+++ b/src/ipa/libipa/fc_queue.h\n@@ -26,6 +26,11 @@ namespace ipa {\n  */\n static constexpr uint32_t kMaxFrameContexts = 16;\n \n+struct IPAFrameContext {\n+\tunsigned int frame;\n+\tRequest::Errors error;\n+};\n+\n template<typename FrameContext>\n class FCQueue : private std::array<FrameContext, kMaxFrameContexts>\n {\ndiff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex 483e941fe427..40d27963ef68 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -281,7 +281,7 @@ double Agc::measureBrightness(const rkisp1_cif_isp_hist_stat *hist) const\n  * new exposure and gain for the scene.\n  */\n void Agc::process(IPAContext &context,\n-\t\t  [[maybe_unused]] IPAFrameContext *frameContext,\n+\t\t  [[maybe_unused]] RKISP1FrameContext &frameContext,\n \t\t  const rkisp1_stat_buffer *stats)\n {\n \tconst rkisp1_cif_isp_stat *params = &stats->params;\ndiff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\nindex 1c9818b7db2a..af7fe2740908 100644\n--- a/src/ipa/rkisp1/algorithms/agc.h\n+++ b/src/ipa/rkisp1/algorithms/agc.h\n@@ -27,7 +27,7 @@ public:\n \n \tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n \tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n-\tvoid process(IPAContext &context, IPAFrameContext *frameContext,\n+\tvoid process(IPAContext &context, RKISP1FrameContext &frameContext,\n \t\t     const rkisp1_stat_buffer *stats) override;\n \n private:\ndiff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp\nindex 427aaeb1e955..3beafb73ca33 100644\n--- a/src/ipa/rkisp1/algorithms/awb.cpp\n+++ b/src/ipa/rkisp1/algorithms/awb.cpp\n@@ -120,7 +120,7 @@ void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params)\n  * \\copydoc libcamera::ipa::Algorithm::process\n  */\n void Awb::process([[maybe_unused]] IPAContext &context,\n-\t\t  [[maybe_unused]] IPAFrameContext *frameCtx,\n+\t\t  [[maybe_unused]] RKISP1FrameContext &frameCtx,\n \t\t  const rkisp1_stat_buffer *stats)\n {\n \tconst rkisp1_cif_isp_stat *params = &stats->params;\ndiff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h\nindex 667a8beb7689..5954034b8142 100644\n--- a/src/ipa/rkisp1/algorithms/awb.h\n+++ b/src/ipa/rkisp1/algorithms/awb.h\n@@ -21,7 +21,7 @@ public:\n \n \tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n \tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n-\tvoid process(IPAContext &context, IPAFrameContext *frameCtx,\n+\tvoid process(IPAContext &context, RKISP1FrameContext &frameCtx,\n \t\t     const rkisp1_stat_buffer *stats) override;\n \n private:\ndiff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\nindex a8daeca487ae..c42bcd73b314 100644\n--- a/src/ipa/rkisp1/ipa_context.h\n+++ b/src/ipa/rkisp1/ipa_context.h\n@@ -14,6 +14,8 @@\n \n #include <libcamera/geometry.h>\n \n+#include <libipa/fc_queue.h>\n+\n namespace libcamera {\n \n namespace ipa::rkisp1 {\n@@ -78,7 +80,7 @@ struct IPAActiveState {\n \tunsigned int frameCount;\n };\n \n-struct IPAFrameContext {\n+struct RKISP1FrameContext : public IPAFrameContext {\n };\n \n struct IPAContext {\ndiff --git a/src/ipa/rkisp1/module.h b/src/ipa/rkisp1/module.h\nindex 89f83208a75c..2568c624df0f 100644\n--- a/src/ipa/rkisp1/module.h\n+++ b/src/ipa/rkisp1/module.h\n@@ -19,7 +19,7 @@ namespace libcamera {\n \n namespace ipa::rkisp1 {\n \n-using Module = ipa::Module<IPAContext, IPAFrameContext, IPACameraSensorInfo,\n+using Module = ipa::Module<IPAContext, RKISP1FrameContext, IPACameraSensorInfo,\n \t\t\t   rkisp1_params_cfg, rkisp1_stat_buffer>;\n \n } /* namespace ipa::rkisp1 */\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex a64716f588a8..a2483f27cf52 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -329,8 +329,11 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId\n \n \tunsigned int aeState = 0;\n \n+\t/* \\todo Obtain the frame context to pass to process from the FCQueue */\n+\tRKISP1FrameContext frameContext;\n+\n \tfor (auto const &algo : algorithms())\n-\t\talgo->process(context_, nullptr, stats);\n+\t\talgo->process(context_, frameContext, stats);\n \n \tsetControls(frame);\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "06/10"
    ]
}