Show a patch.

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

{
    "id": 14020,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14020/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14020/",
    "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": "<20211001103325.1077590-6-paul.elder@ideasonboard.com>",
    "date": "2021-10-01T10:33:23",
    "name": "[libcamera-devel,v2,5/7] 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/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/users/17/?format=api",
        "username": "epaul",
        "first_name": "Paul",
        "last_name": "Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/14020/mbox/",
    "series": [
        {
            "id": 2589,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2589/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2589",
            "date": "2021-10-01T10:33:18",
            "name": "The Great AE Changes",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2589/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14020/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14020/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 07E68BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  1 Oct 2021 10:33:49 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BBDF7691B0;\n\tFri,  1 Oct 2021 12:33:48 +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 6823A691BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Oct 2021 12:33:46 +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 F3059596;\n\tFri,  1 Oct 2021 12:33:44 +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=\"lPUkJwOV\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1633084426;\n\tbh=DGi34lE8u9nRpPGBnVrApqYb6dEBAYeELfDzkOu+lDU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=lPUkJwOVO/dmJLSZKqHqH9/45vaedwcp5Y8ihl3G72kuN5YqvF/IaKHlwg0stTIb0\n\tScJlNHca7GlSwo6VST8/xYuwumtIHYNAw0Jvwjp+uveqFdEydY1h9QuFA4pklQlR6h\n\thlOYFUAXR5GZEa/ixnv0b5NoHCTBvqctwcy23Dp4=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  1 Oct 2021 19:33:23 +0900",
        "Message-Id": "<20211001103325.1077590-6-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20211001103325.1077590-1-paul.elder@ideasonboard.com>",
        "References": "<20211001103325.1077590-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 5/7] 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\nBug: https://bugs.libcamera.org/show_bug.cgi?id=42\nBug: https://bugs.libcamera.org/show_bug.cgi?id=43\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nNo change in v2\n\nInitial version:\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",
        "v2",
        "5/7"
    ]
}