Show a patch.

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

{
    "id": 18764,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18764/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18764/",
    "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": "<20230627130553.26940-1-naush@raspberrypi.com>",
    "date": "2023-06-27T13:05:53",
    "name": "[libcamera-devel,v2] ipa: rpi: imx708: Fix mode switch drop frame count",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3757dd6f01996c4268efac3951f69eae757a09c6",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18764/mbox/",
    "series": [
        {
            "id": 3941,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3941/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3941",
            "date": "2023-06-27T13:05:53",
            "name": "[libcamera-devel,v2] ipa: rpi: imx708: Fix mode switch drop frame count",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3941/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18764/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18764/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 63B19BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 27 Jun 2023 13:06:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 82369628BA;\n\tTue, 27 Jun 2023 15:06:01 +0200 (CEST)",
            "from mail-lf1-x132.google.com (mail-lf1-x132.google.com\n\t[IPv6:2a00:1450:4864:20::132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A00761E3F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Jun 2023 15:05:59 +0200 (CEST)",
            "by mail-lf1-x132.google.com with SMTP id\n\t2adb3069b0e04-4fb7589b187so3264065e87.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 27 Jun 2023 06:05:59 -0700 (PDT)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tc13-20020a7bc00d000000b003f735ba7736sm10860597wmb.46.2023.06.27.06.05.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 27 Jun 2023 06:05:57 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1687871161;\n\tbh=hwkbu2ZlaGEEVQAULyS5Pi4znBIDLwSMszR3Efp+LV8=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=T76PVADCGVWSqgaXFj9/II9VeVDomZhw8akME8gUM7MtFSAxYjcTcDrbRgZ+DneJH\n\tZPToZC4gln3Iyk4cwcIlDGo+eGA4ABlad9X5N+1vCKsZ1P2NuO9g79nvdf7cUdedBU\n\t6XzmdLxNN7Exvvhl/5bc5S4a/t9B3a2gm4R0I8ElQpsUPMa6yNJ53dUPyFTQmAxZVJ\n\tcgk8a0f432r3T3+EC2ejbHHoLF1O8SOLgdoJGlY9ZCV/tIVdbGSzMVqYC8NkBhFIIH\n\tDMxdaN0/G2J6IF1w85PXkApVQwotJaFRCtISq81r64TZUEM5VA1bB6P0+FYJwgft5b\n\txRV14H4FPllCw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1687871158; x=1690463158;\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=H+BCB52QV4NnlSj2RspJGxO3zLDy++cQU4hki3qIVyY=;\n\tb=hS6f8/AKWd+hnFPYdlPEcd/Out4A76h5VsPlfauFyjctHtYAwA1GNX4JZQimQ2N/qJ\n\tFm2/9131Dk/XfdxwyqEfR9nKk4W7aEg6Am7rOtJGEP7FhFvcJuhOnNiV89a1TOucZRu8\n\tgW9iQ0jU8cP1AJuew/W/Kt0y79B+hA4tZyU/Gh4NqlQD5+4F3NGt6a4IDVMxH8aB7/aw\n\t2sJYaxwWeDYnYjw21XvTJzhI5Dy2Ne7EuUNYnuEYXYLmC27M97jmsLB43OuboLzGiaGC\n\tptU+or9ld2i2t+74Ao3v+9gIuZg8hufAffoe08odcxApHZpRilf9dfwmeb6N35DwaX6C\n\tA4Tg=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"hS6f8/AK\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1687871158; x=1690463158;\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=H+BCB52QV4NnlSj2RspJGxO3zLDy++cQU4hki3qIVyY=;\n\tb=HtWMqfMpyEfI7n/bRMXtvKFNy7NdPoUfcEHDbNsMZIrfrhz13/oBeL5Rsb0Wt15VUC\n\tEx/yC0o3003ahViOnYEoVScinPpUnCBp+LGljCscnMU+broI2gOuDZHB7tUfDOtz3nHS\n\tpPkfh7AO5s3lpXuZ7CXIe6suJo4/nkezD2PKHYxbMTHq6H1eqV2IrabCyiMgU7oz1y6N\n\twIdO+BuL1nl5yUdCSEAq1eyg0Aj2hkMQMWSE116FIpm/+ZNu2JLe7s2mIUNENIJDMKkw\n\t8ckuZgy/BBnVZaJOtq61AX8ZqJqliYso9Z+NK2ZCcbUVM6LIO5o2hS/0i71+6CFYPI9l\n\tQhMw==",
        "X-Gm-Message-State": "AC+VfDwkdpk1/61WhZcK7Yedz5i/x361lvg44f4ChtxGkK9tusdB9eP7\n\t5TdlA2FBbWpG+ZQK/KoPr91UprFnOlMTvn/b0RAvkQ==",
        "X-Google-Smtp-Source": "ACHHUZ7VCeQPlfiZYPQhjYtm8+3A9BwztHb1nF41yLiOxpMjAvskx2w9mnb7cKkaYmTPdMa1gox0PA==",
        "X-Received": "by 2002:a19:661a:0:b0:4f6:2b51:2f74 with SMTP id\n\ta26-20020a19661a000000b004f62b512f74mr16844920lfc.52.1687871158114; \n\tTue, 27 Jun 2023 06:05:58 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 27 Jun 2023 14:05:53 +0100",
        "Message-Id": "<20230627130553.26940-1-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2] ipa: rpi: imx708: Fix mode switch drop\n\tframe count",
        "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": "The imx708 must drop a single frame on startup - but only when in HDR\nmode. Non-HDR modes do not need to drop frames. Fix the logic in\nhideFramesModeSwitch() which currently unconditionally advertises to\ndrop one frame.\n\nUnfortunately there is no clear way to tell if the sensor is in the HDR\nmode. So for now, look the resolution and framerate to deduce this.\n\nAdditionally ensure we override hideFramesStartup() and return the same\nnumber as hideFramesModeSwitch().\n\nBug: https://github.com/raspberrypi/libcamera-apps/issues/524\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\nChanges since v1:\n- Fix a typo in the comparison statement.\n---\n src/ipa/rpi/cam_helper/cam_helper_imx708.cpp | 25 +++++++++++++++++++-\n 1 file changed, 24 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\nindex 641ba18f4b9d..9bc0272dd4c1 100644\n--- a/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n+++ b/src/ipa/rpi/cam_helper/cam_helper_imx708.cpp\n@@ -21,6 +21,8 @@ using namespace RPiController;\n using namespace libcamera;\n using libcamera::utils::Duration;\n \n+using namespace std::literals::chrono_literals;\n+\n namespace libcamera {\n LOG_DECLARE_CATEGORY(IPARPI)\n }\n@@ -56,7 +58,8 @@ public:\n \t\t       int &vblankDelay, int &hblankDelay) const override;\n \tbool sensorEmbeddedDataPresent() const override;\n \tdouble getModeSensitivity(const CameraMode &mode) const override;\n-\tunsigned int hideFramesModeSwitch() const override { return 1; } // seems to be required for HDR\n+\tunsigned int hideFramesModeSwitch() const override;\n+\tunsigned int hideFramesStartup() const;\n \n private:\n \t/*\n@@ -225,6 +228,26 @@ double CamHelperImx708::getModeSensitivity(const CameraMode &mode) const\n \treturn (mode.width > 2304) ? 1.0 : 2.0;\n }\n \n+unsigned int CamHelperImx708::hideFramesModeSwitch() const\n+{\n+\t/*\n+\t * We need to drop the first startup frame in HDR mode.\n+\t * Unfortunately the only way to currently determine if the sensor is in\n+\t * the HDR mode is to match with the resolution and framerate - the HDR\n+\t * mode only runs upto 30fps.\n+\t */\n+\tif (mode_.width == 2304 && mode_.height == 1296 &&\n+\t    mode_.minFrameDuration > 1.0s / 32)\n+\t\treturn 1;\n+\telse\n+\t\treturn 0;\n+}\n+\n+unsigned int CamHelperImx708::hideFramesStartup() const\n+{\n+\treturn hideFramesModeSwitch();\n+}\n+\n void CamHelperImx708::populateMetadata(const MdParser::RegisterMap &registers,\n \t\t\t\t       Metadata &metadata) const\n {\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}