Show a patch.

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

{
    "id": 13963,
    "url": "https://patchwork.libcamera.org/api/patches/13963/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13963/",
    "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": "<20210928074959.3489544-5-paul.elder@ideasonboard.com>",
    "date": "2021-09-28T07:49:59",
    "name": "[libcamera-devel,RFC,4/4] libcamera: pipeline: rkisp1: Support the new AE controls",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "8ee6d025667306416c3b59942348013e86a9aa99",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13963/mbox/",
    "series": [
        {
            "id": 2578,
            "url": "https://patchwork.libcamera.org/api/series/2578/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2578",
            "date": "2021-09-28T07:49:55",
            "name": "Fix pipelines for the new AE-related controls",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2578/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13963/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13963/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 13405BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Sep 2021 07:50:24 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D0A9D69193;\n\tTue, 28 Sep 2021 09:50:23 +0200 (CEST)",
            "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 ACB146918B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Sep 2021 09:50:21 +0200 (CEST)",
            "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3E8223F1;\n\tTue, 28 Sep 2021 09:50:19 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"nf0fdBXe\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1632815421;\n\tbh=UMnRQBd2/OGg6MZtecUw6vLiP8qMq84DrU911k08lvE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=nf0fdBXeYR35HUtB7VVNhuu5yD5Nur5WE4k+5H+15HbCFucjDYqTHzkQNuvyT1nHd\n\t22nUUx6abFh8ZZz7TYZ9+te/AiR5DlLJeesOldSX6BTMjfeUTPoWG1xvfJxDFOJpfB\n\tgKjKMoIJxRb5hAM/lryA1hsuyI8B3ePdW8jmX7/o=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 28 Sep 2021 16:49:59 +0900",
        "Message-Id": "<20210928074959.3489544-5-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210928074959.3489544-1-paul.elder@ideasonboard.com>",
        "References": "<20210928074959.3489544-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH 4/4] libcamera: pipeline: rkisp1:\n\tSupport the new AE controls",
        "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": "Add support for the new AE controls in the rkisp1 pipeline handler, and\nin the IPA.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nIt seems that the rkisp1 pipeline handler doesn't properly expose its\ncontrol capabilities? And even though it exposed AeEnable with both true\nand false it didn't expose or handle AnalogueGain nor ExposureTime\neither? So I just simply replaced AeEnable with ExposureTimeMode for\nnow.\n---\n src/ipa/rkisp1/rkisp1.cpp                | 18 ++++++++++--------\n src/libcamera/pipeline/rkisp1/rkisp1.cpp |  4 ++--\n 2 files changed, 12 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex bf2c13b6..708adfc9 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -52,7 +52,7 @@ private:\n \t\t\t      const rkisp1_stat_buffer *stats);\n \n \tvoid setControls(unsigned int frame);\n-\tvoid metadataReady(unsigned int frame, unsigned int aeState);\n+\tvoid metadataReady(unsigned int frame, int aeState);\n \n \tstd::map<unsigned int, FrameBuffer> buffers_;\n \tstd::map<unsigned int, MappedFrameBuffer> mappedBuffers_;\n@@ -221,8 +221,9 @@ void IPARkISP1::queueRequest(unsigned int frame, rkisp1_params_cfg *params,\n \tmemset(params, 0, sizeof(*params));\n \n \t/* Auto Exposure on/off. */\n-\tif (controls.contains(controls::AeEnable)) {\n-\t\tautoExposure_ = controls.get(controls::AeEnable);\n+\tif (controls.contains(controls::ExposureTimeMode)) {\n+\t\tautoExposure_ = (controls.get(controls::ExposureTimeMode) ==\n+\t\t\t\t controls::ExposureTimeModeAuto);\n \t\tif (autoExposure_)\n \t\t\tparams->module_ens = RKISP1_CIF_ISP_MODULE_AEC;\n \n@@ -239,7 +240,7 @@ void IPARkISP1::updateStatistics(unsigned int frame,\n \t\t\t\t const rkisp1_stat_buffer *stats)\n {\n \tconst rkisp1_cif_isp_stat *params = &stats->params;\n-\tunsigned int aeState = 0;\n+\tint aeState = controls::AeStateInactive;\n \n \tif (stats->meas_type & RKISP1_CIF_ISP_STAT_AUTOEXP) {\n \t\tconst rkisp1_cif_isp_ae_stat *ae = &params->ae;\n@@ -274,7 +275,9 @@ void IPARkISP1::updateStatistics(unsigned int frame,\n \t\t\tsetControls(frame + 1);\n \t\t}\n \n-\t\taeState = fabs(factor - 1.0f) < 0.05f ? 2 : 1;\n+\t\taeState = fabs(factor - 1.0f) < 0.05f ?\n+\t\t\t  controls::AeStateConverged :\n+\t\t\t  controls::AeStateSearching;\n \t}\n \n \tmetadataReady(frame, aeState);\n@@ -293,12 +296,11 @@ void IPARkISP1::setControls(unsigned int frame)\n \tqueueFrameAction.emit(frame, op);\n }\n \n-void IPARkISP1::metadataReady(unsigned int frame, unsigned int aeState)\n+void IPARkISP1::metadataReady(unsigned int frame, int aeState)\n {\n \tControlList ctrls(controls::controls);\n \n-\tif (aeState)\n-\t\tctrls.set(controls::AeLocked, aeState == 2);\n+\tctrls.set(controls::AeState, aeState);\n \n \tRkISP1Action op;\n \top.op = ActionMetadata;\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 98008862..1ed4522f 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -935,8 +935,8 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \n \tControlInfoMap::Map ctrls;\n \tctrls.emplace(std::piecewise_construct,\n-\t\t      std::forward_as_tuple(&controls::AeEnable),\n-\t\t      std::forward_as_tuple(false, true));\n+\t\t      std::forward_as_tuple(&controls::ExposureTimeMode),\n+\t\t      std::forward_as_tuple(ControlInfo(controls::AeExposureModeValues)));\n \n \tdata->controlInfo_ = ControlInfoMap(std::move(ctrls),\n \t\t\t\t\t    controls::controls);\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "4/4"
    ]
}