Show a patch.

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

{
    "id": 23775,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/23775/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/23775/",
    "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": "<20250708092239.1589-1-nick.hollinghurst@raspberrypi.com>",
    "date": "2025-07-08T09:22:39",
    "name": "[v2] ipa: rpi: Fix bug in AfState reporting",
    "commit_ref": "e6fb24ffdb3efb66829a8b0a8ce5628e4552ee30",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "24905bb803d8752bd04b9753719c4855a6aca9b8",
    "submitter": {
        "id": 130,
        "url": "https://patchwork.libcamera.org/api/1.1/people/130/?format=api",
        "name": "Nick Hollinghurst",
        "email": "nick.hollinghurst@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/23775/mbox/",
    "series": [
        {
            "id": 5278,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5278/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5278",
            "date": "2025-07-08T09:22:39",
            "name": "[v2] ipa: rpi: Fix bug in AfState reporting",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/5278/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/23775/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/23775/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 0EAF2C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Jul 2025 09:23:14 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6BE8568EE1;\n\tTue,  8 Jul 2025 11:23:12 +0200 (CEST)",
            "from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n\t[IPv6:2a00:1450:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C591468E3A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Jul 2025 11:23:10 +0200 (CEST)",
            "by mail-wr1-x42c.google.com with SMTP id\n\tffacd0b85a97d-3a5123c1533so1920557f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 08 Jul 2025 02:23:10 -0700 (PDT)",
            "from raspberrypi.pitowers.org\n\t([2a00:1098:3142:1f:a457:3110:3364:a827])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-3b4708d094csm12273507f8f.28.2025.07.08.02.23.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 08 Jul 2025 02:23:09 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"N0M2H0MM\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1751966590; x=1752571390;\n\tdarn=lists.libcamera.org; \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=unyBcsB+ZXOYjKy7lBl0bRbsA8WhR2oGNrFx7vDG8UM=;\n\tb=N0M2H0MMVF9k2eERLqcdzVmTaHPrEWFTcMH59OhWgnNC7lbgAA/LD6au2sjhduR5zH\n\tIy7PVgtGbGgMIquji21DcID2fh2YmcBSR1EaDbHnwIA73RDtowKsXadCAqLlXx2BD7W6\n\tP4JbkcrYQoeDLwLcMXMntUiUlR0Y5s4PjjEKxvxCIaXxE1s7HdWTZE7mMCsxj8I3d4cQ\n\tMFbLeHYQKSc3KSl4FHapRqwsnhEAvbc08ls02y6bGxf3qCisRHbnvEE+NqoXPdR9WhmE\n\tZwwwzPrh1Mnk2W8nLHhFbkEI1tX5bEiUPJTJV48oLz4uKoCFOedChvDqHe0pW8R3dt2D\n\tU2VA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1751966590; x=1752571390;\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=unyBcsB+ZXOYjKy7lBl0bRbsA8WhR2oGNrFx7vDG8UM=;\n\tb=LZwFtOlVhC8XV/0Sl/Hgd96hzaeYdxBSpv3t1fatp6WOfwzHMQsMZyDEYnkoXWl0t3\n\tEtb8A8K2o9+NgGREHA/5iSNdKnN9EwQBD0nEXjB6PI51jKpOSbZ79UDefioK04rHaa+b\n\tCjbuYAsYT6Z/LUCpzzuJqERM4ASiwkAhQWEUXpLMXkDbgoLleV7/pWOzXYLxAJyW5c9x\n\tVzSQ8S68kT1nOVJieUkZd5IzJ/yNiDz/PjcTTgZJjshDyGgzL94pLMFm+MmKmW06qkKT\n\tYHYNeMggM+Rae+qp8HXVrYS+sNcOlNlVjd5BgExnoBjR7OajN8piqYvt5cCHmZ0WbFeA\n\tFPTg==",
        "X-Gm-Message-State": "AOJu0YxNWquokXPKFfOIz/FVYphyFSkO+qnF6BEKFPZH5B6/iLnEG1Oj\n\tfDjQuydlnyEz+1PxSm1FpeZHAF1ytLloN0AUa9hNepmCdfuZwNyLeOO3oJukQBPQJKElUT3pu8B\n\tPnkR5",
        "X-Gm-Gg": "ASbGnctOLeE4sJqCkLcHfqy4cg/NvcJBF3KN10rt5wsp0bk2tT+0m6pG1BsuInFO6q6\n\tFQ4nNrvdmd2pQ0kGtax06SgG2+X7Xyf/7gRLoxSLDr+y2iCIKR+bCv476iWGTEVAJhhwixoKO8y\n\tJAzACn/2vUqdCdGbfr+syujqw+jAHFE2WPTZ+fGVObaySIUvdIc9lMZ8FxPykPCDP3xIA2+VD+b\n\txV2PfS72vQnNrfSBP0j4444LLiHHaKI3F0or9lMy1+t8cnttWls33xL+SBqbK2BPt3ktnP6Fk5Z\n\tGtC5r2bvcCJsCVVRnMisOi67R2b7t58wPFyT860+2Bbf8ytfb5l0IqMchGnZnPD/yEMSrFBn7HN\n\tlS/WjPCMjaB4V+Wj7cjvpjyvtCXFKgEnJGw==",
        "X-Google-Smtp-Source": "AGHT+IFNmBvp7s24sBNRN/BltbZZ8gAaFbaY9sSvYuByFeEYSmUdE/57roa4j5EH5vwBIAHs3jnXBg==",
        "X-Received": "by 2002:a05:6000:2a04:b0:3b5:d726:b7c with SMTP id\n\tffacd0b85a97d-3b5d7260c81mr3819255f8f.40.1751966589884; \n\tTue, 08 Jul 2025 02:23:09 -0700 (PDT)",
        "From": "Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>,\n\tDavid Plowman <david.plowman@raspberrypi.com>",
        "Subject": "[PATCH v2] ipa: rpi: Fix bug in AfState reporting",
        "Date": "Tue,  8 Jul 2025 10:22:39 +0100",
        "Message-Id": "<20250708092239.1589-1-nick.hollinghurst@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.39.5",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "A previous change introduced a bug in which it reported AfStateIdle\nwhen idle in Auto mode, when it should continue to report the most\nrecent AF cycle's outcome (AfStateFocused or AfStateFailed).\n\nAlso fix the Pause method so it won't reset state to AfStateIdle\nwhen paused in Continuous AF mode (to match documented behaviour).\n\nFixes: ea5f451c5660 (\"ipa: rpi: controller: AutoFocus bidirectional scanning\")\nSigned-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nTested-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/rpi/controller/rpi/af.cpp | 12 +++++++-----\n 1 file changed, 7 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/ipa/rpi/controller/rpi/af.cpp b/src/ipa/rpi/controller/rpi/af.cpp\nindex eaaca4bc..26e59930 100644\n--- a/src/ipa/rpi/controller/rpi/af.cpp\n+++ b/src/ipa/rpi/controller/rpi/af.cpp\n@@ -810,10 +810,10 @@ void Af::prepare(Metadata *imageMetadata)\n \telse\n \t\tstatus.pauseState = AfPauseState::Running;\n \n-\tif (scanState_ == ScanState::Idle)\n-\t\tstatus.state = AfState::Idle;\n-\telse if (mode_ == AfModeAuto)\n+\tif (mode_ == AfModeAuto && scanState_ != ScanState::Idle)\n \t\tstatus.state = AfState::Scanning;\n+\telse if (mode_ == AfModeManual)\n+\t\tstatus.state = AfState::Idle;\n \telse\n \t\tstatus.state = reportState_;\n \tstatus.lensSetting = initted_ ? std::optional<int>(cfg_.map.eval(fsmooth_))\n@@ -954,8 +954,10 @@ void Af::pause(AfAlgorithm::AfPause pause)\n \t\t\t\tscanState_ = ScanState::Trigger;\n \t\t} else if (pause != AfPauseResume && !pauseFlag_) {\n \t\t\tpauseFlag_ = true;\n-\t\t\tif (pause == AfPauseImmediate || scanState_ < ScanState::Coarse1)\n-\t\t\t\tgoIdle();\n+\t\t\tif (pause == AfPauseImmediate || scanState_ < ScanState::Coarse1) {\n+\t\t\t\tscanState_ = ScanState::Idle;\n+\t\t\t\tscanData_.clear();\n+\t\t\t}\n \t\t}\n \t}\n }\n",
    "prefixes": [
        "v2"
    ]
}