Show a patch.

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

{
    "id": 14421,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14421/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14421/",
    "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": "<20211029120001.2469018-5-hanlinchen@chromium.org>",
    "date": "2021-10-29T12:00:00",
    "name": "[libcamera-devel,v2,5/6] ipu3: Run AIQ for the first frame to avoid blanking",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "8899fe8f2c0aa956ba1a6c6a961b699d9e991316",
    "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/14421/mbox/",
    "series": [
        {
            "id": 2681,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2681/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2681",
            "date": "2021-10-29T11:59:56",
            "name": "[libcamera-devel,v2,1/6] ipu3: Use ia_aiq_frame_use_preview as default mode for AIQ",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2681/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14421/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14421/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 B5134BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 29 Oct 2021 12:00:17 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 71368600C4;\n\tFri, 29 Oct 2021 14:00:17 +0200 (CEST)",
            "from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com\n\t[IPv6:2607:f8b0:4864:20::52b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 384CA600B8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Oct 2021 14:00:15 +0200 (CEST)",
            "by mail-pg1-x52b.google.com with SMTP id f5so9651646pgc.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 29 Oct 2021 05:00:15 -0700 (PDT)",
            "from localhost ([2401:fa00:1:10:35fe:d53b:684:b538])\n\tby smtp.gmail.com with UTF8SMTPSA id\n\tv2sm5516063pga.57.2021.10.29.05.00.12\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tFri, 29 Oct 2021 05:00:13 -0700 (PDT)"
        ],
        "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=\"d9+o9rDf\"; 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=JIW54wwtEbmae2rJT2JySJLiLDfh8qO7VcEWNSqs6/M=;\n\tb=d9+o9rDfXPduJSFS+4RJsy16BxJxk2RjT9c48uTBBWYS1v2PHmf7tqlw0NT/hRJCkR\n\tt6GrzbQSguV5Z/OuflsyBX0N7gOBrmANF/iohpCW2tjqHF01M8WyaoLVQHXbAlwiKX3K\n\trd5t9oaLh0iZXy7+mvDINx/mb6YEXqCH3Ll7Y=",
        "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=JIW54wwtEbmae2rJT2JySJLiLDfh8qO7VcEWNSqs6/M=;\n\tb=Yq8SMjP3d6MIyBSGEIfOt1hRMZIICCsYJKXPLpGOMn4yQiJl2ItcQm12zqroTc94Yf\n\tJ+4R041qR6Rd+V5VDrHHuox06kLm4dKMx1xQglk5OTi0mdwTzL1U8u8T97aQmWIQcH5x\n\tli6E0ca81eVJhCe8MssY6tjKflX5swV3W6lCa+8AiMjvR2n4sDc8hK8s66yWyr0/iLNc\n\tXsDaxTk+AjTgn9QXeAARjBN5Sokzvvn0qtZZGU3bElu8eB/eqdKEAox6525jhvPp6XB1\n\tZVEoaP8Je9eaXvqkrVXQg+GYoKuTIDjOJFhG6GvNibzjxoP8EoCnWbbNnsfSDl6MCN+b\n\tjLgQ==",
        "X-Gm-Message-State": "AOAM533lt/QD8zn9NPuu6m50as1tF3fw5xSnhgXEH6fo9OV1Lu3ylxqL\n\ttV8hR4ncGMqYHkya7jw2PtNgEnU76nfow0La",
        "X-Google-Smtp-Source": "ABdhPJy2QrjFQY3GcLHjq6Zl7E24fYjqNvo08F6ZrpAVq5zsK0zC8zGY01zV6GNKV527xts5iRBkfQ==",
        "X-Received": "by 2002:a05:6a00:23d5:b0:47c:236d:65b4 with SMTP id\n\tg21-20020a056a0023d500b0047c236d65b4mr10297906pfc.52.1635508813340; \n\tFri, 29 Oct 2021 05:00:13 -0700 (PDT)",
        "From": "Han-Lin Chen <hanlinchen@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 29 Oct 2021 20:00:00 +0800",
        "Message-Id": "<20211029120001.2469018-5-hanlinchen@chromium.org>",
        "X-Mailer": "git-send-email 2.33.1.1089.g2158813163f-goog",
        "In-Reply-To": "<20211029120001.2469018-1-hanlinchen@chromium.org>",
        "References": "<20211029120001.2469018-1-hanlinchen@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 5/6] ipu3: Run AIQ for the first frame\n\tto 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>\n---\n ipu3.cpp | 45 ++++++++++++++++++++++++++-------------------\n 1 file changed, 26 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/ipu3.cpp b/ipu3.cpp\nindex c2dc754..2232e07 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@@ -221,6 +222,7 @@ int IPAIPU3::init(const IPASettings &settings,\n \n int IPAIPU3::start()\n {\n+\trunAiq(0);\n \tsetControls(0);\n \n \treturn 0;\n@@ -370,29 +372,11 @@ 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(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 \taiq_.run2a(frame, aiqInputParams_, results_, lensPosition_, lensMovementStartTime_);\n \n-\taic_.updateRuntimeParams(results_);\n-\taic_.run(params);\n-\n \texposure_ = results_.ae()->exposures[0].sensor_exposure->coarse_integration_time;\n \tgain_ = results_.ae()->exposures[0].sensor_exposure->analog_gain_code_global;\n \n@@ -410,6 +394,29 @@ void IPAIPU3::fillParams(unsigned int frame, ipu3_uapi_params *params)\n \tlensPosition_ = results_.af()->next_lens_position;\n \n \tresultsHistory_.Push(results_);\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+\n+\trunAiq(frame);\n+\n+\taic_.updateRuntimeParams(results_);\n+\taic_.run(params);\n \n \tsetControls(frame);\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "5/6"
    ]
}