Show a patch.

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

{
    "id": 18724,
    "url": "https://patchwork.libcamera.org/api/patches/18724/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18724/",
    "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": "<20230612130608.11651-1-naush@raspberrypi.com>",
    "date": "2023-06-12T13:06:08",
    "name": "[libcamera-devel] ipa: rpi: agc: Do not switch to a default if a mode is unavailable",
    "commit_ref": "618b9aaa17713bed359112bda358e81e1eaea86c",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "933f324cb79c3e05a52a59e2b6f91d49b5b6357d",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18724/mbox/",
    "series": [
        {
            "id": 3918,
            "url": "https://patchwork.libcamera.org/api/series/3918/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3918",
            "date": "2023-06-12T13:06:08",
            "name": "[libcamera-devel] ipa: rpi: agc: Do not switch to a default if a mode is unavailable",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3918/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18724/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18724/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 BE1FAC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 12 Jun 2023 13:30:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1888161E4B;\n\tMon, 12 Jun 2023 15:30:55 +0200 (CEST)",
            "from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3130261E4A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Jun 2023 15:30:53 +0200 (CEST)",
            "by mail-wm1-x32d.google.com with SMTP id\n\t5b1f17b1804b1-3f6d7abe934so30382575e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Jun 2023 06:30:53 -0700 (PDT)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tk15-20020a7bc40f000000b003f7f1b3aff1sm11470122wmi.26.2023.06.12.06.30.51\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 12 Jun 2023 06:30:51 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1686576655;\n\tbh=WRXVSbxhm9KyLGLZebS26OGlfDA0fOpIE1GUPqhat/g=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=XdvewPsR8Ji4Q9iJ7RloEJxsalMFKV3V8f+TQAhOdR4DheyTAcX4qNQoZ2oMbV99m\n\tBhw9ktFs6pnK20+MRxiHKfeaiLV713kPBLUG8QGrimgAMHV3bocxv58goGce50/Cjd\n\t5yUNh9DOaRrvSoskuYo0eeHItrPfTPiHS7IbJUuOLHrwBCaVuI6LLnUib5Jl4pHyAh\n\tdxQPAxEzXz1Q8bOekka0lV+OgImBmSqdqUUcTB1TrV32KUQZrYwQwh5hySvJcIIy0z\n\tUpjsW0trCqfzuxf7NQuFs2JuXqsKBkkuiybXLGIFpPiKyVtF82R6Qj4GdWqHxMuT0L\n\t5OaoT7M5zFVSg==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1686576652; x=1689168652;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=Q+6R+no7zN7+APr2rYhRVRyVVL5yo//FI+Q3GMyrxe8=;\n\tb=rlebt3Y9p5pN+QWu2S9LjxZuMp6SQFbZauDCa3+XkZNrXBm/GYWbpfIP+qMXHcHwnp\n\t4qCusmQJvGqwJ3qMjJaOL3ajpsu7Ml+0plUJMjdieULVzPOSvu4s4sBihCBniCyG9brk\n\txFxRcRz3lNqafPjoyX45urU+m+txJmG4PO+Yjvps8/SmuAxiPiiYIV6EdBZVP6qe26xn\n\t1TNf9Lt9G4dx8sX0Lb9NbnIp/5eIp6Otwlwocl5rK8YjRsPJhuxg9i1Qna/A/Ckj/Ulr\n\tUUq9SqZGusVNJ1ucpdZ0kOXkgQMKvf1zbAgLa5TCdm+NePxTImkqyEq3ojIQPR8vDbRe\n\tiPLg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"rlebt3Y9\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1686576652; x=1689168652;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=Q+6R+no7zN7+APr2rYhRVRyVVL5yo//FI+Q3GMyrxe8=;\n\tb=GmxlEApn2b+PtWnPAHHRp4upUpSBJRMZHumidriHGzRVMB9QXiVgGq78BItuaM/Mb1\n\tpmUoe+qwFBkmSnmv29nY5/jjgIRAaPrGVv2rs5wtgA8xUBcZEq/7P5rUc8XJl/TbKFNl\n\t82uuTRvEhwiTIkeZJpWEnF+r0OBRUuCys6yHDtTA8iiQOQtW9olva4TZ4VFrbCWo+hT8\n\t47I9GiwapszJMNNTr0RAIJp284ukPYhkI9jBmfx77+SadKdHlAcFn12gz3nuK39IYS6m\n\tc1TnuQwtge8gUJSjYKK1jSHiJC20eWVkpFjv31phaSaqTLyoS4x859wgxXpm6piW7pv0\n\tS1ew==",
        "X-Gm-Message-State": "AC+VfDwwVzXFzd7EDfuFD7OUX/PoES0VzxwCYD+2LF4Z4ut1EI8c8wOw\n\tpLxQBINaicP7k2U/3wFrfpV1ora7y+Wtgv/FZ3Rsug==",
        "X-Google-Smtp-Source": "ACHHUZ5udWKSsR14R9QRVbiRvhqaHNbsmTS9mMBEn+TC6dAeG/jZzmUfBfEH/8zGG+4VdC4o5NCp0A==",
        "X-Received": "by 2002:a05:600c:228f:b0:3f8:13b0:a66c with SMTP id\n\t15-20020a05600c228f00b003f813b0a66cmr4095188wmf.38.1686576652274; \n\tMon, 12 Jun 2023 06:30:52 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 12 Jun 2023 14:06:08 +0100",
        "Message-Id": "<20230612130608.11651-1-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] ipa: rpi: agc: Do not switch to a default\n\tif a mode is unavailable",
        "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>",
        "From": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Naushir Patuck <naush@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "In commit 0ee9339331c6, a default metering/exposure/constraint mode is\nused if a control sets a mode that is not listed in the camera tuning\nfile.\n\nSetting a default mode may be undesirable in these cases, so instead\nkeep the agc mode unchanged. This also matches the behaviour for other\nIPA controls where no changes are made in error conditions.\n\nFixes: 0ee9339331c6 (\"ipa: rpi: agc: Gracefully handle missing agc modes\")\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/rpi/controller/rpi/agc.cpp | 27 ++++++++++-----------------\n 1 file changed, 10 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/src/ipa/rpi/controller/rpi/agc.cpp b/src/ipa/rpi/controller/rpi/agc.cpp\nindex e60ca33f867b..ae9ff219fa03 100644\n--- a/src/ipa/rpi/controller/rpi/agc.cpp\n+++ b/src/ipa/rpi/controller/rpi/agc.cpp\n@@ -541,39 +541,32 @@ void Agc::housekeepConfig()\n \tif (meteringModeName_ != status_.meteringMode) {\n \t\tauto it = config_.meteringModes.find(meteringModeName_);\n \t\tif (it == config_.meteringModes.end()) {\n-\t\t\tLOG(RPiAgc, Warning) << \"No metering mode \" << meteringModeName_\n-\t\t\t\t\t     << \", defaulting to \" << config_.defaultMeteringMode;\n-\t\t\tmeteringModeName_ = config_.defaultMeteringMode;\n-\t\t\tmeteringMode_ = &config_.meteringModes[meteringModeName_];\n+\t\t\tLOG(RPiAgc, Warning) << \"No metering mode \" << meteringModeName_;\n+\t\t\tmeteringModeName_ = status_.meteringMode;\n \t\t} else {\n \t\t\tmeteringMode_ = &it->second;\n+\t\t\tstatus_.meteringMode = meteringModeName_;\n \t\t}\n-\t\tstatus_.meteringMode = meteringModeName_;\n \t}\n \tif (exposureModeName_ != status_.exposureMode) {\n \t\tauto it = config_.exposureModes.find(exposureModeName_);\n \t\tif (it == config_.exposureModes.end()) {\n-\t\t\tLOG(RPiAgc, Warning) << \"No exposure profile \" << exposureModeName_\n-\t\t\t\t\t     << \", defaulting to \" << config_.defaultExposureMode;\n-\t\t\texposureModeName_ = config_.defaultExposureMode;\n-\t\t\texposureMode_ = &config_.exposureModes[exposureModeName_];\n+\t\t\tLOG(RPiAgc, Warning) << \"No exposure profile \" << exposureModeName_;\n+\t\t\texposureModeName_ = status_.exposureMode;\n \t\t} else {\n \t\t\texposureMode_ = &it->second;\n+\t\t\tstatus_.exposureMode = exposureModeName_;\n \t\t}\n-\t\tstatus_.exposureMode = exposureModeName_;\n \t}\n \tif (constraintModeName_ != status_.constraintMode) {\n-\t\tauto it =\n-\t\t\tconfig_.constraintModes.find(constraintModeName_);\n+\t\tauto it = config_.constraintModes.find(constraintModeName_);\n \t\tif (it == config_.constraintModes.end()) {\n-\t\t\tLOG(RPiAgc, Warning) << \"No constraint list \" << constraintModeName_\n-\t\t\t\t\t     << \", defaulting to \" << config_.defaultConstraintMode;\n-\t\t\tconstraintModeName_ = config_.defaultConstraintMode;\n-\t\t\tconstraintMode_ = &config_.constraintModes[constraintModeName_];\n+\t\t\tLOG(RPiAgc, Warning) << \"No constraint list \" << constraintModeName_;\n+\t\t\tconstraintModeName_ = status_.constraintMode;\n \t\t} else {\n \t\t\tconstraintMode_ = &it->second;\n+\t\t\tstatus_.constraintMode = constraintModeName_;\n \t\t}\n-\t\tstatus_.constraintMode = constraintModeName_;\n \t}\n \tLOG(RPiAgc, Debug) << \"exposureMode \"\n \t\t\t   << exposureModeName_ << \" constraintMode \"\n",
    "prefixes": [
        "libcamera-devel"
    ]
}