Show a patch.

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

{
    "id": 18759,
    "url": "https://patchwork.libcamera.org/api/patches/18759/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18759/",
    "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": "<20230626130833.15895-1-naush@raspberrypi.com>",
    "date": "2023-06-26T13:08:33",
    "name": "[libcamera-devel] ipa: rpi: imx708: Fix mode switch drop frame count",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "31edc3a5a8f262068f861841af26e0c374284f32",
    "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/18759/mbox/",
    "series": [
        {
            "id": 3936,
            "url": "https://patchwork.libcamera.org/api/series/3936/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3936",
            "date": "2023-06-26T13:08:33",
            "name": "[libcamera-devel] ipa: rpi: imx708: Fix mode switch drop frame count",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3936/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18759/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18759/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 6BB5ABE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Jun 2023 13:08:38 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A6574628C0;\n\tMon, 26 Jun 2023 15:08:37 +0200 (CEST)",
            "from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4C6C8628BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jun 2023 15:08:36 +0200 (CEST)",
            "by mail-wr1-x436.google.com with SMTP id\n\tffacd0b85a97d-3112f256941so2895744f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Jun 2023 06:08:36 -0700 (PDT)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tf1-20020a5d5681000000b0030647449730sm7429589wrv.74.2023.06.26.06.08.34\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 26 Jun 2023 06:08:34 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1687784917;\n\tbh=Q3Lwx6XH+Oc1BoiMWGu5EfNDrmZLWL2BEGkQvWCEbic=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:Cc:From;\n\tb=z8JdMTcrGNcMmakkI/B38wUhSDA0ieH6uZmRR5k9bzGajSOo1jqDF2vfO/IwG+KZt\n\tAddDXmc/3Axbm8I1qM9Tq4dWPOWtrmn4yJFkrP0ULJ5/yorkWPnVDGM2HHbme1uk6o\n\tQ4oF4c5YlTqA0KeKZCxfMjaDp6CSDmgYCunRv7ohYFTa7tpokSF6e6mLwtBsaCswJ1\n\tDF/7hqVoO5ud6zaXBvZTcNrCoO+W2vWUHhGYn4GW9Ior0+V+UZOf8hJRIVz9nyRLQC\n\tR25t4gGFPIribWnuAbTNddNcqo54MeJb6Hpc4idwk70NqV2BAhgrmhiMQbCkorrxJj\n\tMxPl0+KO0W/XQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1687784915; x=1690376915;\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=lfhqtO9D3edc5jlbyLSsJgI8I8JaMS7UlBA82m9l4Ac=;\n\tb=nQrQjOhV9/Z5KYoLikCY1nch79VR36ivMLoIL22F+7D5kSSWMkOBUEopMLY/NZyAVB\n\tAyddwHnfjDCqLACXk3N00MDdRoaEN7XHUltAaO8PnZuKntpbj6Cd+U+e72hmdpCrAnUS\n\tJWuKMCoIpoEcq9GArSoB9BXvfyemezQrkdqTAXymeAqFvmNhhnf9pWvFJGDONoWwx3UN\n\t26YJFV86txmfBned4VfSVa1b3WqM5YLbp7eijbTRkgrXtZabIRIHhjJjom4TVYC+6H0G\n\tfASUEXO5NLO6t8MUi5T14WiaGP57A29Lxvd0vE5Sz0XQzFtaZX73bpB34DBj/w9IATb9\n\tWroQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"nQrQjOhV\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1687784915; x=1690376915;\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=lfhqtO9D3edc5jlbyLSsJgI8I8JaMS7UlBA82m9l4Ac=;\n\tb=kKzmZpG6M5CSZjHlJbXKv8z0mEXhXLCBTG6YVRNNHsszGG3pynBKWt7phTgjySN5Nh\n\tUGOuayIokN6/TCn1NiLZK3pBU/Z4qay8GnKc0OgNozGsweFbplZp/+v4bVYSrvuwNtwH\n\tDvN26r3473rzXdolcSQcDoG9idzydLuCgZrJAZKxeaerJWvy9aZ1Nl9c5bInPeeJSkcz\n\trsu5sUGA9hb6Xl5CTQdL6ZiYBvqtw9iRghmXDmQqD7peoIxQPL8FNuOAvfez7m0QhtuJ\n\tQgom5Tnh9rrqFtfWawK8ZxVPrT+MJunkW8WXj80+gHY4wmW2ADjT0B1ulQbcjTKdm4m5\n\ttf3w==",
        "X-Gm-Message-State": "AC+VfDzHiTovs+05FuidMLXRsOHbXwhKeyAticHnl7mooLbv4evAZhCx\n\tPQk6iAWdTJFCQaQ5m8iHXQ76Yepp5O7qUg9gnYjZyw==",
        "X-Google-Smtp-Source": "ACHHUZ47Rv85b1PjugBdagp8FASwXbidetHmjmbbi4OgwSxVJmgqWtL2K3Tn7f+HGKddL4rUgTi0cA==",
        "X-Received": "by 2002:adf:ea90:0:b0:30f:c5b1:23ef with SMTP id\n\ts16-20020adfea90000000b0030fc5b123efmr21502445wrm.41.1687784915451; \n\tMon, 26 Jun 2023 06:08:35 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 26 Jun 2023 14:08:33 +0100",
        "Message-Id": "<20230626130833.15895-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: 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>",
        "Cc": "Nick Hollinghurst <nick.hollinghurst@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>\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..2cd7afdbd8ec 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 / 30)\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"
    ]
}