Show a patch.

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

{
    "id": 11498,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11498/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11498/",
    "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": "<20210304153120.1904-2-david.plowman@raspberrypi.com>",
    "date": "2021-03-04T15:31:19",
    "name": "[libcamera-devel,1/2] ipa: raspberrypi: Make CamHelpers return the frame delay for vblanking",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "036d30d0322fc14416039372427cc39781c00f4c",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11498/mbox/",
    "series": [
        {
            "id": 1761,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1761/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1761",
            "date": "2021-03-04T15:31:18",
            "name": "Raspberry Pi support for new sensors",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1761/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11498/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11498/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 63FBABD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Mar 2021 15:31:27 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 01BEA68A98;\n\tThu,  4 Mar 2021 16:31:27 +0100 (CET)",
            "from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A6E4602ED\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Mar 2021 16:31:25 +0100 (CET)",
            "by mail-wm1-x32c.google.com with SMTP id k66so10112810wmf.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 04 Mar 2021 07:31:25 -0800 (PST)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tf7sm20306129wrm.36.2021.03.04.07.31.24\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 04 Mar 2021 07:31:24 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"M3uR0Vbw\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=Cdk9CfEFsqBeO5H/wJtNdPeCQxTmsiOJvmejofZe9Jo=;\n\tb=M3uR0Vbww4/+/CS/eG5kqje2+IhsAmcHwKWDmNrsl9cSt0g9FiPRwhexPLfXQBeZuo\n\tgnF7iQPrrfKrTYx8hHa4A+COlNWgVkGW9lKEZyjPhFVYEiXUH20V2IxPK2nRTbJHhnVU\n\ty5kpSbM9QtSWoF2tT4dPUurC+zf9fjmSX5PpDxFQne3fY0vMF7PQBGxEMhPKyQWnByU5\n\tZMHgNw7+lKZLmhpCKv1nmiCR05iZIPz/YvBM4TJD31QYGsngRZgOFdzZBBdQhOBW7XJm\n\tiM3MVf4wFDgdmymbmug6h7Dza7sJp2YHAmyeUgzluZ4IzYH9pf/CQGLlC5bfHU52R3WD\n\tgk+A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=Cdk9CfEFsqBeO5H/wJtNdPeCQxTmsiOJvmejofZe9Jo=;\n\tb=Fi5LU/lKpbB/3Fp8PTMTi/Clg/K2GuSZOXhhM9BMdAg+cjWURUcQwbFow8G+L0wOEU\n\tUVKSnUdGz78gQ4FU8ww3hHK/RL1bqfv5al7OermRd+ses14MC81HXQa45p2gDUXI6ild\n\thLrpbVtHkry+mhp+2bCZqNjC2QcIu2UGt63k28LL+GnCdrWRpGgEe9NBPNU2XBRAtiZx\n\tkTgUC4L+eurqMNs8qX727b9gV/LZZLuOgZDPz9Xvn8Fk8WjxXxW0R4HbGZvXUrujx6S0\n\ttN8qwbxC/IQihyQLlg49x+UdMX9BmMx3WTwG2fgtrpVuY01otzI2quq1xQmGdv5R8Py3\n\tm5WA==",
        "X-Gm-Message-State": "AOAM532fNMWVHtJGppaXF+MCUSOK+ZJ5faWlQVGYtR3V9frf51Jf8UPv\n\tKGYfzlVCVc8hCATPECZVU+xcrkpvacdMYg==",
        "X-Google-Smtp-Source": "ABdhPJz35it7fFxGdK/m0uAISnqGj7fDPFfkuFP3hEh9ZdJ1rLo9jSMRyxtuq+f4h0uUJ9Xanpbi6A==",
        "X-Received": "by 2002:a05:600c:2204:: with SMTP id\n\tz4mr4662920wml.31.1614871884693; \n\tThu, 04 Mar 2021 07:31:24 -0800 (PST)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu,  4 Mar 2021 15:31:19 +0000",
        "Message-Id": "<20210304153120.1904-2-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20210304153120.1904-1-david.plowman@raspberrypi.com>",
        "References": "<20210304153120.1904-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 1/2] ipa: raspberrypi: Make CamHelpers\n\treturn the frame delay for vblanking",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "For some sensors (e.g. imx477) we need to update the vblanking on the\nframe before the exposure. For this reason the GetDelays method must\nalso return the number of frame delays for the vblanking control.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp        | 4 +++-\n src/ipa/raspberrypi/cam_helper.hpp        | 9 ++++++---\n src/ipa/raspberrypi/cam_helper_imx477.cpp | 7 +++++--\n src/ipa/raspberrypi/cam_helper_ov5647.cpp | 7 +++++--\n src/ipa/raspberrypi/raspberrypi.cpp       | 6 +++---\n 5 files changed, 22 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex 2837fcce..0ae0baa0 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -95,7 +95,8 @@ void CamHelper::SetCameraMode(const CameraMode &mode)\n \tinitialized_ = true;\n }\n \n-void CamHelper::GetDelays(int &exposure_delay, int &gain_delay) const\n+void CamHelper::GetDelays(int &exposure_delay, int &gain_delay,\n+\t\t\t  int &vblank_delay) const\n {\n \t/*\n \t * These values are correct for many sensors. Other sensors will\n@@ -103,6 +104,7 @@ void CamHelper::GetDelays(int &exposure_delay, int &gain_delay) const\n \t */\n \texposure_delay = 2;\n \tgain_delay = 1;\n+\tvblank_delay = 2;\n }\n \n bool CamHelper::SensorEmbeddedDataPresent() const\ndiff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp\nindex 14d70112..8c5659ed 100644\n--- a/src/ipa/raspberrypi/cam_helper.hpp\n+++ b/src/ipa/raspberrypi/cam_helper.hpp\n@@ -28,8 +28,10 @@ namespace RPiController {\n // exposure time, and to convert between the sensor's gain codes and actual\n // gains.\n //\n-// A method to return the number of frames of delay between updating exposure\n-// and analogue gain and the changes taking effect. For many sensors these\n+// A method to return the number of frames of delay between updating exposure,\n+// analogue gain and vblanking, and for the changes to take effect. For many\n+// sensors these take the values 2, 1 and 2 respectively, but sensors that are\n+// different will need to over-ride the default method provided.\n // take the values 2 and 1 respectively, but sensors that are different will\n // need to over-ride the default method provided.\n //\n@@ -72,7 +74,8 @@ public:\n \t\t\t\t      double maxFrameDuration) const;\n \tvirtual uint32_t GainCode(double gain) const = 0;\n \tvirtual double Gain(uint32_t gain_code) const = 0;\n-\tvirtual void GetDelays(int &exposure_delay, int &gain_delay) const;\n+\tvirtual void GetDelays(int &exposure_delay, int &gain_delay,\n+\t\t\t       int &vblank_delay) const;\n \tvirtual bool SensorEmbeddedDataPresent() const;\n \tvirtual unsigned int HideFramesStartup() const;\n \tvirtual unsigned int HideFramesModeSwitch() const;\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp\nindex 419f8e77..73a5ca7d 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n@@ -37,7 +37,8 @@ public:\n \tCamHelperImx477();\n \tuint32_t GainCode(double gain) const override;\n \tdouble Gain(uint32_t gain_code) const override;\n-\tvoid GetDelays(int &exposure_delay, int &gain_delay) const override;\n+\tvoid GetDelays(int &exposure_delay, int &gain_delay,\n+\t\t       int &vblank_delay) const override;\n \tbool SensorEmbeddedDataPresent() const override;\n \n private:\n@@ -63,10 +64,12 @@ double CamHelperImx477::Gain(uint32_t gain_code) const\n \treturn 1024.0 / (1024 - gain_code);\n }\n \n-void CamHelperImx477::GetDelays(int &exposure_delay, int &gain_delay) const\n+void CamHelperImx477::GetDelays(int &exposure_delay, int &gain_delay,\n+\t\t\t\tint &vblank_delay) const\n {\n \texposure_delay = 2;\n \tgain_delay = 2;\n+\tvblank_delay = 3;\n }\n \n bool CamHelperImx477::SensorEmbeddedDataPresent() const\ndiff --git a/src/ipa/raspberrypi/cam_helper_ov5647.cpp b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\nindex 75486e90..12be6bf9 100644\n--- a/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n@@ -17,7 +17,8 @@ public:\n \tCamHelperOv5647();\n \tuint32_t GainCode(double gain) const override;\n \tdouble Gain(uint32_t gain_code) const override;\n-\tvoid GetDelays(int &exposure_delay, int &gain_delay) const override;\n+\tvoid GetDelays(int &exposure_delay, int &gain_delay,\n+\t\t       int &vblank_delay) const override;\n \tunsigned int HideFramesStartup() const override;\n \tunsigned int HideFramesModeSwitch() const override;\n \tunsigned int MistrustFramesStartup() const override;\n@@ -51,7 +52,8 @@ double CamHelperOv5647::Gain(uint32_t gain_code) const\n \treturn static_cast<double>(gain_code) / 16.0;\n }\n \n-void CamHelperOv5647::GetDelays(int &exposure_delay, int &gain_delay) const\n+void CamHelperOv5647::GetDelays(int &exposure_delay, int &gain_delay,\n+\t\t\t\tint &vblank_delay) const\n {\n \t/*\n \t * We run this sensor in a mode where the gain delay is bumped up to\n@@ -59,6 +61,7 @@ void CamHelperOv5647::GetDelays(int &exposure_delay, int &gain_delay) const\n \t */\n \texposure_delay = 2;\n \tgain_delay = 2;\n+\tvblank_delay = 2;\n }\n \n unsigned int CamHelperOv5647::HideFramesStartup() const\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 6348d071..741bff4c 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -342,14 +342,14 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t\t * Pass out the sensor config to the pipeline handler in order\n \t\t * to setup the staggered writer class.\n \t\t */\n-\t\tint gainDelay, exposureDelay, sensorMetadata;\n-\t\thelper_->GetDelays(exposureDelay, gainDelay);\n+\t\tint gainDelay, exposureDelay, vblankDelay, sensorMetadata;\n+\t\thelper_->GetDelays(exposureDelay, gainDelay, vblankDelay);\n \t\tsensorMetadata = helper_->SensorEmbeddedDataPresent();\n \n \t\tresult->params |= ipa::RPi::ConfigSensorParams;\n \t\tresult->sensorConfig.gainDelay = gainDelay;\n \t\tresult->sensorConfig.exposureDelay = exposureDelay;\n-\t\tresult->sensorConfig.vblank = exposureDelay;\n+\t\tresult->sensorConfig.vblank = vblankDelay;\n \t\tresult->sensorConfig.sensorMetadata = sensorMetadata;\n \t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "1/2"
    ]
}