Show a patch.

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

{
    "id": 12771,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/12771/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12771/",
    "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": "<20210702103800.41291-7-paul.elder@ideasonboard.com>",
    "date": "2021-07-02T10:37:50",
    "name": "[libcamera-devel,RFC,v3,06/16] controls: Replace AwbEnable with AwbMode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d6e4c45cdab0c0912508b9a4dbb6be044ffe378c",
    "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/12771/mbox/",
    "series": [
        {
            "id": 2199,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2199/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2199",
            "date": "2021-07-02T10:37:44",
            "name": "Preliminary FULL plumbing",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2199/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12771/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12771/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 B4F7CC3222\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Jul 2021 10:38:26 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6C49A684F8;\n\tFri,  2 Jul 2021 12:38:26 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BF3A0684F6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Jul 2021 12:38:24 +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 4B3D54AB;\n\tFri,  2 Jul 2021 12:38:23 +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=\"TNnQ9Swi\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1625222304;\n\tbh=p8jz7QVzI8DLaijluE0KkGGqeckdX07fqMZpSOBqMKI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=TNnQ9SwivoF10kE3owWkq3HLwDHeBrYV0WgIavfVbvOarU2JFobKSbOPYCphaj3nz\n\teHQySCPlQBPWB4kLWFjTfSbX9nm5VGFxwOlFKumkQxPzFDAtEVzYg4OZbuvu4WS2rI\n\t1aVEIg+XmHLCs4iYrGajxpO1fTVjsHZII29NOYsU=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  2 Jul 2021 19:37:50 +0900",
        "Message-Id": "<20210702103800.41291-7-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20210702103800.41291-1-paul.elder@ideasonboard.com>",
        "References": "<20210702103800.41291-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH v3 06/16] controls: Replace AwbEnable\n\twith AwbMode",
        "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": "Previously it was possible to have AwbEnable set to false, yet have\nAwbMode on anything. This caused a confusion situation, so merge the two\ninto AwbMode. While at it, pull in the android AWB modes.\n\nAdjust the previous users of AwbEnable accordingly.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v3:\n- resume raspberrypi awb on any non-off mode\n---\n include/libcamera/ipa/raspberrypi.h |  1 -\n src/ipa/raspberrypi/raspberrypi.cpp | 27 ++++++++----------------\n src/libcamera/control_ids.yaml      | 32 +++++++++++++++--------------\n test/controls/control_list.cpp      |  6 +++---\n 4 files changed, 29 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\nindex a8790000..63392a26 100644\n--- a/include/libcamera/ipa/raspberrypi.h\n+++ b/include/libcamera/ipa/raspberrypi.h\n@@ -35,7 +35,6 @@ static const ControlInfoMap Controls = {\n \t{ &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) },\n \t{ &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) },\n \t{ &controls::ExposureValue, ControlInfo(0.0f, 16.0f) },\n-\t{ &controls::AwbEnable, ControlInfo(false, true) },\n \t{ &controls::ColourGains, ControlInfo(0.0f, 32.0f) },\n \t{ &controls::AwbMode, ControlInfo(controls::AwbModeValues) },\n \t{ &controls::Brightness, ControlInfo(-1.0f, 1.0f) },\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 4981aa29..620ed0f0 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -746,24 +746,6 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\tbreak;\n \t\t}\n \n-\t\tcase controls::AWB_ENABLE: {\n-\t\t\tRPiController::Algorithm *awb = controller_.GetAlgorithm(\"awb\");\n-\t\t\tif (!awb) {\n-\t\t\t\tLOG(IPARPI, Warning)\n-\t\t\t\t\t<< \"Could not set AWB_ENABLE - no AWB algorithm\";\n-\t\t\t\tbreak;\n-\t\t\t}\n-\n-\t\t\tif (ctrl.second.get<bool>() == false)\n-\t\t\t\tawb->Pause();\n-\t\t\telse\n-\t\t\t\tawb->Resume();\n-\n-\t\t\tlibcameraMetadata_.set(controls::AwbEnable,\n-\t\t\t\t\t       ctrl.second.get<bool>());\n-\t\t\tbreak;\n-\t\t}\n-\n \t\tcase controls::AWB_MODE: {\n \t\t\tRPiController::AwbAlgorithm *awb = dynamic_cast<RPiController::AwbAlgorithm *>(\n \t\t\t\tcontroller_.GetAlgorithm(\"awb\"));\n@@ -774,6 +756,15 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\t}\n \n \t\t\tint32_t idx = ctrl.second.get<int32_t>();\n+\n+\t\t\tif (idx == controls::AwbOff) {\n+\t\t\t\tawb->Pause();\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\tif (awb->IsPaused())\n+\t\t\t\tawb->Resume();\n+\n \t\t\tif (AwbModeTable.count(idx)) {\n \t\t\t\tawb->SetMode(AwbModeTable.at(idx));\n \t\t\t\tlibcameraMetadata_.set(controls::AwbMode, idx);\ndiff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml\nindex 5717bc1f..2e62f61b 100644\n--- a/src/libcamera/control_ids.yaml\n+++ b/src/libcamera/control_ids.yaml\n@@ -229,13 +229,6 @@ controls:\n         Report an estimate of the current illuminance level in lux. The Lux\n         control can only be returned in metadata.\n \n-  - AwbEnable:\n-      type: bool\n-      description: |\n-        Enable or disable the AWB.\n-\n-        \\sa ColourGains\n-\n   # AwbMode needs further attention:\n   # - Auto-generate max enum value.\n   # - Better handling of custom types.\n@@ -245,29 +238,38 @@ controls:\n         Specify the range of illuminants to use for the AWB algorithm. The modes\n         supported are platform specific, and not all modes may be supported.\n       enum:\n-        - name: AwbAuto\n+        - name: AwbOff\n           value: 0\n+          description: The AWB routune is disabled.\n+        - name: AwbAuto\n+          value: 1\n           description: Search over the whole colour temperature range.\n         - name: AwbIncandescent\n-          value: 1\n-          description: Incandescent AWB lamp mode.\n-        - name: AwbTungsten\n           value: 2\n-          description: Tungsten AWB lamp mode.\n+          description: Incandescent AWB lamp mode.\n         - name: AwbFluorescent\n           value: 3\n           description: Fluorescent AWB lamp mode.\n-        - name: AwbIndoor\n+        - name: AwbWarmFluorescent\n           value: 4\n-          description: Indoor AWB lighting mode.\n+          description: Warm fluorescent AWB lamp mode.\n         - name: AwbDaylight\n           value: 5\n           description: Daylight AWB lighting mode.\n         - name: AwbCloudy\n           value: 6\n           description: Cloudy AWB lighting mode.\n-        - name: AwbCustom\n+        - name: AwbTwilight\n           value: 7\n+          description: Twilight AWB lamp mode.\n+        - name: AwbTungsten\n+          value: 8\n+          description: Tungsten AWB lamp mode.\n+        - name: AwbIndoor\n+          value: 9\n+          description: Indoor AWB lighting mode.\n+        - name: AwbCustom\n+          value: 10\n           description: Custom AWB mode.\n \n   - AwbLocked:\ndiff --git a/test/controls/control_list.cpp b/test/controls/control_list.cpp\nindex 70cf61b8..ce55d09b 100644\n--- a/test/controls/control_list.cpp\n+++ b/test/controls/control_list.cpp\n@@ -143,10 +143,10 @@ protected:\n \t\t * Attempt to set an invalid control and verify that the\n \t\t * operation failed.\n \t\t */\n-\t\tlist.set(controls::AwbEnable, true);\n+\t\tlist.set(controls::AwbMode, true);\n \n-\t\tif (list.contains(controls::AwbEnable)) {\n-\t\t\tcout << \"List shouldn't contain AwbEnable control\" << endl;\n+\t\tif (list.contains(controls::AwbMode)) {\n+\t\t\tcout << \"List shouldn't contain AwbMode control\" << endl;\n \t\t\treturn TestFail;\n \t\t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "v3",
        "06/16"
    ]
}