Show a patch.

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

{
    "id": 14550,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14550/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14550/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20211111104908.295992-6-hanlinchen@chromium.org>",
    "date": "2021-11-11T10:49:07",
    "name": "[libcamera-devel,IPU3-IPA,v3,5/6] ipu3: Run AIQ for the first frame to avoid blanking",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b336a61c3c0395f303c07c23be05ff3f3f5407f5",
    "submitter": {
        "id": 98,
        "url": "https://patchwork.libcamera.org/api/1.1/people/98/?format=api",
        "name": "Hanlin Chen",
        "email": "hanlinchen@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14550/mbox/",
    "series": [
        {
            "id": 2711,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2711/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2711",
            "date": "2021-11-11T10:49:02",
            "name": "*** Enhance image quality for IPU3 with Intel IPA ***",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2711/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14550/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14550/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 6210EBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Nov 2021 10:49:41 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 14CD760345;\n\tThu, 11 Nov 2021 11:49:41 +0100 (CET)",
            "from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com\n\t[IPv6:2607:f8b0:4864:20::102f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B8E2760345\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Nov 2021 11:49:39 +0100 (CET)",
            "by mail-pj1-x102f.google.com with SMTP id\n\tp18-20020a17090ad31200b001a78bb52876so4109072pju.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Nov 2021 02:49:39 -0800 (PST)",
            "from localhost ([2401:fa00:1:10:3925:da9c:3049:be7a])\n\tby smtp.gmail.com with UTF8SMTPSA id\n\th18sm2868775pfh.172.2021.11.11.02.49.37\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tThu, 11 Nov 2021 02:49:37 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"Qcp/FlbC\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=C3gXGHepNdq76R5E/Cgv2uleOXsTZATDjAvBWpSPQLE=;\n\tb=Qcp/FlbCbiaOLXm1XbFNSV7gvEa71pIuKl4DXIBJvGIMVd0Jfyeb89y7bSTXQteALT\n\tuKT2wTzKtBV4lIQ+NeYghz/j0OI7bG3VakoiNJpizV18pCPNMWla93Ae+dqlvhN2kNVG\n\tuApEZGrmMfsDz1N7aru5HwOLm0x4lhQH7FEKI=",
        "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=C3gXGHepNdq76R5E/Cgv2uleOXsTZATDjAvBWpSPQLE=;\n\tb=g/RLeBakrAmFvzXPB/GlNqmGvh2zdTC5LyP2O/BJGa6kfjUI0Cq930yXV3aR+JStSN\n\thrycml+1fMgJh8sI9CUbc4oSUKSgRxQ+abaENymOpz5gf/6EKopvvFX3D/erJZzNExEq\n\t8jY1sZTAIvMz0S3f8USF234BvolLUNnE+lXeEChIaP6qP5JEpYpgKt7x7YuGBDk7+aeC\n\tDwyOqWNtDcA85SLnjVnHWgPAE792EZ9liFxXwBclDjPI7j2MDrtxqWDMrCQUpINMel/y\n\tGl4yU0FtjcRpQJ+fuwLLAUFFsbjrb69gZpLX5kYAguMDGR9Qc+Po78BVWqRpKJ4JZO3W\n\t/zpw==",
        "X-Gm-Message-State": "AOAM532V+/YCnbkqu55uSJnMc+npiKQ79ZAOyQ1RaiFZlMU+G0FKWKy9\n\tqMzABDYIEXc3nzPWnRWeaQz8CI+I+SnS7w==",
        "X-Google-Smtp-Source": "ABdhPJyDw2xrwudaiNBEt+Mwc9VKGhN7BmiLc6de1F01yEzhREUZ+PCqBBOWtovlDV1VYRXCgeDcyQ==",
        "X-Received": "by 2002:a17:902:b08a:b0:142:51be:57e2 with SMTP id\n\tp10-20020a170902b08a00b0014251be57e2mr6514684plr.53.1636627778137; \n\tThu, 11 Nov 2021 02:49:38 -0800 (PST)",
        "From": "Han-Lin Chen <hanlinchen@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 11 Nov 2021 18:49:07 +0800",
        "Message-Id": "<20211111104908.295992-6-hanlinchen@chromium.org>",
        "X-Mailer": "git-send-email 2.34.0.rc1.387.gb447b232ab-goog",
        "In-Reply-To": "<20211111104908.295992-1-hanlinchen@chromium.org>",
        "References": "<20211111104908.295992-1-hanlinchen@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [IPU3-IPA PATCH v3 5/6] ipu3: Run AIQ for the\n\tfirst frame to avoid blanking",
        "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": "The start() function set the first exposure time and analog gain to maximum.\nIn result, the first frame might be over bright and the user may see a\nbright blank when changing the camera in application. Run AIQ to get an\ninitial exposure time and analog gain in start() to smooth the AE\nprocess.\n\nSigned-off-by: Han-Lin Chen <hanlinchen@chromium.org>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n ipu3.cpp | 44 ++++++++++++++++++++++++++------------------\n 1 file changed, 26 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/ipu3.cpp b/ipu3.cpp\nindex f38440d..ffa78b3 100644\n--- a/ipu3.cpp\n+++ b/ipu3.cpp\n@@ -56,6 +56,7 @@ private:\n \t\t\t    const ControlInfoMap &sensorControls,\n \t\t\t    ControlInfoMap *ipaControls);\n \tvoid processControls(unsigned int frame, const ControlList &metadata);\n+\tvoid runAiq(unsigned int frame);\n \tvoid fillParams(unsigned int frame, ipu3_uapi_params *params);\n \tvoid parseStatistics(unsigned int frame,\n \t\t\t     int64_t frameTimestamp,\n@@ -220,6 +221,7 @@ int IPAIPU3::init(const IPASettings &settings,\n \n int IPAIPU3::start()\n {\n+\trunAiq(0);\n \tsetControls(0);\n \n \treturn 0;\n@@ -369,23 +371,8 @@ void IPAIPU3::processControls([[maybe_unused]] unsigned int frame,\n \t/* \\todo Start processing for 'frame' based on 'controls'. */\n }\n \n-void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n+void IPAIPU3::runAiq([[maybe_unused]] unsigned int frame)\n {\n-\t/* Prepare parameters buffer. */\n-\tmemset(params, 0, sizeof(*params));\n-\n-\t/*\n-\t* Call into the AIQ object, and set up the library with any requested\n-\t* controls or settings from the incoming request.\n-\t*\n-\t* (statistics are fed into the library as a separate event\n-\t*  when available)\n-\t*\n-\t* - Run algorithms\n-\t*\n-\t* - Fill params buffer with the results of the algorithms.\n-\t*/\n-\n \t/* Run algorithms into/using this context structure */\n \tresultsHistory_.extendOne();\n \taiq::AiqResults& latestResults = resultsHistory_.latest();\n@@ -395,8 +382,6 @@ void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n \taiqInputParams_.afParams.lens_movement_start_timestamp = lensMovementStartTime_;\n \n \taiq_.run2a(frame, aiqInputParams_, latestResults);\n-\taic_.updateRuntimeParams(latestResults);\n-\taic_.run(params);\n \n \texposure_ = latestResults.ae()->exposures[0].sensor_exposure->coarse_integration_time;\n \tgain_ = latestResults.ae()->exposures[0].sensor_exposure->analog_gain_code_global;\n@@ -413,6 +398,29 @@ void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n \t\tlensMovementStartTime_ = msecs;\n \t}\n \tlensPosition_ = latestResults.af()->next_lens_position;\n+}\n+\n+void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n+{\n+\t/* Prepare parameters buffer. */\n+\tmemset(params, 0, sizeof(*params));\n+\n+\t/*\n+\t* Call into the AIQ object, and set up the library with any requested\n+\t* controls or settings from the incoming request.\n+\t*\n+\t* (statistics are fed into the library as a separate event\n+\t*  when available)\n+\t*\n+\t* - Run algorithms\n+\t*\n+\t* - Fill params buffer with the results of the algorithms.\n+\t*/\n+\trunAiq(frame);\n+\n+\taiq::AiqResults& latestResults = resultsHistory_.latest();\n+\taic_.updateRuntimeParams(latestResults);\n+\taic_.run(params);\n \n \tsetControls(frame);\n \n",
    "prefixes": [
        "libcamera-devel",
        "IPU3-IPA",
        "v3",
        "5/6"
    ]
}