Show a patch.

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

{
    "id": 14203,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/14203/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14203/",
    "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": "<20211020132334.2199-2-david.plowman@raspberrypi.com>",
    "date": "2021-10-20T13:23:34",
    "name": "[libcamera-devel,v2,1/1] libcamera: ipa: raspberrypi: Add support for imx519 sensor",
    "commit_ref": "5004d8a969330c52449e6840bbef6552cfa8ee1a",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c1aa04d8adc3be46c15d37304d8e2182ba91edc1",
    "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/14203/mbox/",
    "series": [
        {
            "id": 2643,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2643/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2643",
            "date": "2021-10-20T13:23:33",
            "name": "Support for imx519",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2643/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14203/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14203/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 96A86BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 Oct 2021 13:23:41 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E087968F60;\n\tWed, 20 Oct 2021 15:23:39 +0200 (CEST)",
            "from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8C776023A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Oct 2021 15:23:38 +0200 (CEST)",
            "by mail-wm1-x329.google.com with SMTP id\n\tz11-20020a1c7e0b000000b0030db7b70b6bso1732869wmc.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Oct 2021 06:23:38 -0700 (PDT)",
            "from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:1ce1:9965:4328:89c4])\n\tby smtp.gmail.com with ESMTPSA id\n\tr4sm2596011wrz.58.2021.10.20.06.23.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 20 Oct 2021 06:23:37 -0700 (PDT)"
        ],
        "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=\"guzqTLpq\"; 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=NFhfr8CSnCmrCLyrBjG63n+kWXyTXR4OEeN5XZ3Qwz8=;\n\tb=guzqTLpqozyzZut9yOl9rIzkZTYnsZYSelGzMY+SLOqtiiJu7YgQ/Y3e8X/GyzyUL8\n\t0PkOIOQJXJSVryobjDGoz7EFzoWUcVjp1ln/BEkHv/UrD/SPdB5QD10Wpj3hiTK/L3wB\n\txtBA4SL1pip8DJaM44FYXDqF5ptXK096jYDMnlDZlouYYKdKG2CSAx478iRLCm87aKYR\n\tgGRy73rk9+Ab+TRboYX/9JCx5Xoj9LQWTN1KnOx9NQv2v5QdhN7We1Bz3Vk+QrCmRxPG\n\t2c3rdGjHs0tQsxOkm0tQRTRMT5bof4UTi4sn4+OEyNUvue4rpe3Dvb8KKPawdfM28B3v\n\tZxJw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=NFhfr8CSnCmrCLyrBjG63n+kWXyTXR4OEeN5XZ3Qwz8=;\n\tb=QocVcTl+XoTCAo+iR38kcNGEcpmIsFLerphle79J2HejRHa6NQRTTqyJ71vpFCYUpK\n\tq7mcoPHv9Zx/B6Z/4mZVD5YM/hdi0ztcsz/I33ElIM9QAUShXVN1WpDtnqGuFg5cmFGZ\n\tpcoNszGF93DX5Xpimn/AHlahnG24IHE0Xu4d9vSYW4xbsS4/NAsrVLAri9o5+bALZ8Kg\n\tpHDdcpETUKlgCR1y5bNcwwTxNfTQ85d3Q28OXqN6MclrzUR93GCSOBXBgVEKHakPJHI9\n\tEvFEQ3NhWNeBMWEJFbYwSyOmyeaYDc4KQf5ajEIluqQBPZVKl649f0Sy+De61tNaH2pI\n\tmvdQ==",
        "X-Gm-Message-State": "AOAM531tA0rroaTjBHVyka3k8rEj/w+OEYIEBAWbseWJI/4XfsCXBQEZ\n\tx3RdWlsgPS+9BooLzSPVv+f4LQdANsE=",
        "X-Google-Smtp-Source": "ABdhPJwXKg/xCztuzFakTxP1SKbAQDhnQ6mX26VuUb4hsFgnqmwiv1LGN39X87N0fCoShZYKE3iSBA==",
        "X-Received": "by 2002:adf:fa8f:: with SMTP id\n\th15mr52733409wrr.323.1634736217853; \n\tWed, 20 Oct 2021 06:23:37 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 20 Oct 2021 14:23:34 +0100",
        "Message-Id": "<20211020132334.2199-2-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20211020132334.2199-1-david.plowman@raspberrypi.com>",
        "References": "<20211020132334.2199-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 1/1] libcamera: ipa: raspberrypi: Add\n\tsupport for imx519 sensor",
        "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>",
        "Cc": "Arducam info <info@arducam.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Arducam info <info@arducam.com>\n\nThe necessary tuning file and CamHelper is added for the imx519 sensor.\n\nThe imx519 is a 16MP rolling shutter sensor. To enable\nit, please add\n\ndtoverlay=imx519\n\nto the /boot/config.txt file and reboot the Pi.\n\nSigned-off-by: Lee Jackson <info@arducam.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\n---\n src/ipa/raspberrypi/cam_helper_imx519.cpp | 185 ++++++++++++\n src/ipa/raspberrypi/data/imx519.json      | 338 ++++++++++++++++++++++\n src/ipa/raspberrypi/data/meson.build      |   1 +\n src/ipa/raspberrypi/meson.build           |   1 +\n 4 files changed, 525 insertions(+)\n create mode 100644 src/ipa/raspberrypi/cam_helper_imx519.cpp\n create mode 100644 src/ipa/raspberrypi/data/imx519.json",
    "diff": "diff --git a/src/ipa/raspberrypi/cam_helper_imx519.cpp b/src/ipa/raspberrypi/cam_helper_imx519.cpp\nnew file mode 100644\nindex 00000000..eaf24982\n--- /dev/null\n+++ b/src/ipa/raspberrypi/cam_helper_imx519.cpp\n@@ -0,0 +1,185 @@\n+/* SPDX-License-Identifier: BSD-2-Clause */\n+/*\n+ * Based on cam_helper_imx477.cpp\n+ * Copyright (C) 2020, Raspberry Pi (Trading) Limited\n+ *\n+ * cam_helper_imx519.cpp - camera helper for imx519 sensor\n+ * Copyright (C) 2021, Arducam Technology co., Ltd.\n+ */\n+\n+#include <assert.h>\n+#include <cmath>\n+#include <stddef.h>\n+#include <stdio.h>\n+#include <stdlib.h>\n+\n+#include <libcamera/base/log.h>\n+\n+#include \"cam_helper.hpp\"\n+#include \"md_parser.hpp\"\n+\n+using namespace RPiController;\n+using namespace libcamera;\n+using libcamera::utils::Duration;\n+\n+namespace libcamera {\n+LOG_DECLARE_CATEGORY(IPARPI)\n+}\n+\n+/*\n+ * We care about two gain registers and a pair of exposure registers. Their\n+ * I2C addresses from the Sony IMX519 datasheet:\n+ */\n+constexpr uint32_t expHiReg = 0x0202;\n+constexpr uint32_t expLoReg = 0x0203;\n+constexpr uint32_t gainHiReg = 0x0204;\n+constexpr uint32_t gainLoReg = 0x0205;\n+constexpr uint32_t frameLengthHiReg = 0x0340;\n+constexpr uint32_t frameLengthLoReg = 0x0341;\n+constexpr std::initializer_list<uint32_t> registerList =\n+\t{ expHiReg, expLoReg, gainHiReg, gainLoReg, frameLengthHiReg, frameLengthLoReg  };\n+\n+class CamHelperImx519 : public CamHelper\n+{\n+public:\n+\tCamHelperImx519();\n+\tuint32_t GainCode(double gain) const override;\n+\tdouble Gain(uint32_t gain_code) const override;\n+\tvoid Prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata) override;\n+\tuint32_t GetVBlanking(Duration &exposure, Duration minFrameDuration,\n+\t\t\t      Duration maxFrameDuration) 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+\t/*\n+\t * Smallest difference between the frame length and integration time,\n+\t * in units of lines.\n+\t */\n+\tstatic constexpr int frameIntegrationDiff = 32;\n+\t/* Maximum frame length allowable for long exposure calculations. */\n+\tstatic constexpr int frameLengthMax = 0xffdc;\n+\t/* Largest long exposure scale factor given as a left shift on the frame length. */\n+\tstatic constexpr int longExposureShiftMax = 7;\n+\n+\tvoid PopulateMetadata(const MdParser::RegisterMap &registers,\n+\t\t\t      Metadata &metadata) const override;\n+};\n+\n+CamHelperImx519::CamHelperImx519()\n+\t: CamHelper(std::make_unique<MdParserSmia>(registerList), frameIntegrationDiff)\n+{\n+}\n+\n+uint32_t CamHelperImx519::GainCode(double gain) const\n+{\n+\treturn static_cast<uint32_t>(1024 - 1024 / gain);\n+}\n+\n+double CamHelperImx519::Gain(uint32_t gain_code) const\n+{\n+\treturn 1024.0 / (1024 - gain_code);\n+}\n+\n+void CamHelperImx519::Prepare(libcamera::Span<const uint8_t> buffer, Metadata &metadata)\n+{\n+\tMdParser::RegisterMap registers;\n+\tDeviceStatus deviceStatus;\n+\n+\tif (metadata.Get(\"device.status\", deviceStatus)) {\n+\t\tLOG(IPARPI, Error) << \"DeviceStatus not found from DelayedControls\";\n+\t\treturn;\n+\t}\n+\n+\tparseEmbeddedData(buffer, metadata);\n+\n+\t/*\n+\t * The DeviceStatus struct is first populated with values obtained from\n+\t * DelayedControls. If this reports frame length is > frameLengthMax,\n+\t * it means we are using a long exposure mode. Since the long exposure\n+\t * scale factor is not returned back through embedded data, we must rely\n+\t * on the existing exposure lines and frame length values returned by\n+\t * DelayedControls.\n+\t *\n+\t * Otherwise, all values are updated with what is reported in the\n+\t * embedded data.\n+\t */\n+\tif (deviceStatus.frame_length > frameLengthMax) {\n+\t\tDeviceStatus parsedDeviceStatus;\n+\n+\t\tmetadata.Get(\"device.status\", parsedDeviceStatus);\n+\t\tparsedDeviceStatus.shutter_speed = deviceStatus.shutter_speed;\n+\t\tparsedDeviceStatus.frame_length = deviceStatus.frame_length;\n+\t\tmetadata.Set(\"device.status\", parsedDeviceStatus);\n+\n+\t\tLOG(IPARPI, Debug) << \"Metadata updated for long exposure: \"\n+\t\t\t\t   << parsedDeviceStatus;\n+\t}\n+}\n+\n+uint32_t CamHelperImx519::GetVBlanking(Duration &exposure,\n+\t\t\t\t       Duration minFrameDuration,\n+\t\t\t\t       Duration maxFrameDuration) const\n+{\n+\tuint32_t frameLength, exposureLines;\n+\tunsigned int shift = 0;\n+\n+\tframeLength = mode_.height + CamHelper::GetVBlanking(exposure, minFrameDuration,\n+\t\t\t\t\t\t\t     maxFrameDuration);\n+\t/*\n+\t * Check if the frame length calculated needs to be setup for long\n+\t * exposure mode. This will require us to use a long exposure scale\n+\t * factor provided by a shift operation in the sensor.\n+\t */\n+\twhile (frameLength > frameLengthMax) {\n+\t\tif (++shift > longExposureShiftMax) {\n+\t\t\tshift = longExposureShiftMax;\n+\t\t\tframeLength = frameLengthMax;\n+\t\t\tbreak;\n+\t\t}\n+\t\tframeLength >>= 1;\n+\t}\n+\n+\tif (shift) {\n+\t\t/* Account for any rounding in the scaled frame length value. */\n+\t\tframeLength <<= shift;\n+\t\texposureLines = ExposureLines(exposure);\n+\t\texposureLines = std::min(exposureLines, frameLength - frameIntegrationDiff);\n+\t\texposure = Exposure(exposureLines);\n+\t}\n+\n+\treturn frameLength - mode_.height;\n+}\n+\n+void CamHelperImx519::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 CamHelperImx519::SensorEmbeddedDataPresent() const\n+{\n+\treturn true;\n+}\n+\n+void CamHelperImx519::PopulateMetadata(const MdParser::RegisterMap &registers,\n+\t\t\t\t       Metadata &metadata) const\n+{\n+\tDeviceStatus deviceStatus;\n+\n+\tdeviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n+\tdeviceStatus.analogue_gain = Gain(registers.at(gainHiReg) * 256 + registers.at(gainLoReg));\n+\tdeviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n+\n+\tmetadata.Set(\"device.status\", deviceStatus);\n+}\n+\n+static CamHelper *Create()\n+{\n+\treturn new CamHelperImx519();\n+}\n+\n+static RegisterCamHelper reg(\"imx519\", &Create);\ndiff --git a/src/ipa/raspberrypi/data/imx519.json b/src/ipa/raspberrypi/data/imx519.json\nnew file mode 100644\nindex 00000000..164d0d9d\n--- /dev/null\n+++ b/src/ipa/raspberrypi/data/imx519.json\n@@ -0,0 +1,338 @@\n+{\n+    \"rpi.black_level\":\n+    {\n+        \"black_level\": 4096\n+    },\n+    \"rpi.dpc\":\n+    {\n+    },\n+    \"rpi.lux\":\n+    {\n+        \"reference_shutter_speed\": 13841,\n+        \"reference_gain\": 2.0,\n+        \"reference_aperture\": 1.0,\n+        \"reference_lux\": 900,\n+        \"reference_Y\": 12064\n+    },\n+    \"rpi.noise\":\n+    {\n+        \"reference_constant\": 0,\n+        \"reference_slope\": 2.776\n+    },\n+    \"rpi.geq\":\n+    {\n+        \"offset\": 189,\n+        \"slope\": 0.01495\n+    },\n+    \"rpi.sdn\":\n+    {\n+    },\n+    \"rpi.awb\":\n+    {\n+        \"priors\":\n+        [\n+            {\n+                \"lux\": 0, \"prior\":\n+                [\n+                    2000, 1.0, 3000, 0.0, 13000, 0.0\n+                ]\n+            },\n+            {\n+                \"lux\": 800, \"prior\":\n+                [\n+                    2000, 0.0, 6000, 2.0, 13000, 2.0\n+                ]\n+            },\n+            {\n+                \"lux\": 1500, \"prior\":\n+                [\n+                    2000, 0.0, 4000, 1.0, 6000, 6.0, 6500, 7.0, 7000, 1.0, 13000, 1.0\n+                ]\n+            }\n+        ],\n+        \"modes\":\n+        {\n+            \"auto\":\n+            {\n+                \"lo\": 2500,\n+                \"hi\": 7900\n+            },\n+            \"incandescent\":\n+            {\n+                \"lo\": 2500,\n+                \"hi\": 3000\n+            },\n+            \"tungsten\":\n+            {\n+                \"lo\": 3000,\n+                \"hi\": 3500\n+            },\n+            \"fluorescent\":\n+            {\n+                \"lo\": 4000,\n+                \"hi\": 4700\n+            },\n+            \"indoor\":\n+            {\n+                \"lo\": 3000,\n+                \"hi\": 5000\n+            },\n+            \"daylight\":\n+            {\n+                \"lo\": 5500,\n+                \"hi\": 6500\n+            },\n+            \"cloudy\":\n+            {\n+                \"lo\": 7000,\n+                \"hi\": 8000\n+            }\n+        },\n+        \"bayes\": 1,\n+        \"ct_curve\":\n+        [\n+            2890.0, 0.7328, 0.3734, 3550.0, 0.6228, 0.4763, 4500.0, 0.5208, 0.5825, 5700.0, 0.4467, 0.6671, 7900.0, 0.3858, 0.7411\n+        ],\n+        \"sensitivity_r\": 1.0,\n+        \"sensitivity_b\": 1.0,\n+        \"transverse_pos\": 0.02027,\n+        \"transverse_neg\": 0.01935\n+    },\n+    \"rpi.agc\":\n+    {\n+        \"metering_modes\":\n+        {\n+            \"centre-weighted\":\n+            {\n+                \"weights\":\n+                [\n+                    3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0\n+                ]\n+            },\n+            \"spot\":\n+            {\n+                \"weights\":\n+                [\n+                    2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n+                ]\n+            },\n+            \"matrix\":\n+            {\n+                \"weights\":\n+                [\n+                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\n+                ]\n+            }\n+        },\n+        \"exposure_modes\":\n+        {\n+            \"normal\":\n+            {\n+                \"shutter\":\n+                [\n+                    100, 10000, 30000, 60000, 120000\n+                ],\n+                \"gain\":\n+                [\n+                    1.0, 2.0, 4.0, 6.0, 6.0\n+                ]\n+            },\n+            \"short\":\n+            {\n+                \"shutter\":\n+                [\n+                    100, 5000, 10000, 20000, 120000\n+                ],\n+                \"gain\":\n+                [\n+                    1.0, 2.0, 4.0, 6.0, 6.0\n+                ]\n+            }\n+        },\n+        \"constraint_modes\":\n+        {\n+            \"normal\":\n+            [\n+                {\n+                    \"bound\": \"LOWER\", \"q_lo\": 0.98, \"q_hi\": 1.0, \"y_target\":\n+                    [\n+                        0, 0.5, 1000, 0.5\n+                    ]\n+                }\n+            ],\n+            \"highlight\":\n+            [\n+                {\n+                    \"bound\": \"LOWER\", \"q_lo\": 0.98, \"q_hi\": 1.0, \"y_target\":\n+                    [\n+                        0, 0.5, 1000, 0.5\n+                    ]\n+                },\n+                {\n+                    \"bound\": \"UPPER\", \"q_lo\": 0.98, \"q_hi\": 1.0, \"y_target\":\n+                    [\n+                        0, 0.8, 1000, 0.8\n+                    ]\n+                }\n+            ]\n+        },\n+        \"y_target\":\n+        [\n+            0, 0.16, 1000, 0.165, 10000, 0.17\n+        ]\n+    },\n+    \"rpi.alsc\":\n+    {\n+        \"omega\": 1.3,\n+        \"n_iter\": 100,\n+        \"luminance_strength\": 0.5,\n+        \"calibrations_Cr\":\n+        [\n+            {\n+                \"ct\": 3000, \"table\":\n+                [\n+                    1.527, 1.521, 1.508, 1.493, 1.476, 1.455, 1.442, 1.441, 1.441, 1.441, 1.448, 1.467, 1.483, 1.494, 1.503, 1.504,\n+                    1.525, 1.513, 1.496, 1.477, 1.461, 1.434, 1.418, 1.409, 1.409, 1.416, 1.429, 1.449, 1.469, 1.485, 1.495, 1.503,\n+                    1.517, 1.506, 1.485, 1.461, 1.434, 1.412, 1.388, 1.376, 1.376, 1.386, 1.405, 1.429, 1.449, 1.471, 1.488, 1.495,\n+                    1.512, 1.496, 1.471, 1.442, 1.412, 1.388, 1.361, 1.344, 1.344, 1.358, 1.384, 1.405, 1.431, 1.456, 1.479, 1.489,\n+                    1.508, 1.488, 1.458, 1.425, 1.393, 1.361, 1.343, 1.322, 1.321, 1.342, 1.358, 1.385, 1.416, 1.445, 1.471, 1.484,\n+                    1.507, 1.482, 1.453, 1.418, 1.382, 1.349, 1.322, 1.318, 1.318, 1.321, 1.345, 1.373, 1.405, 1.437, 1.465, 1.483,\n+                    1.507, 1.482, 1.453, 1.418, 1.382, 1.349, 1.322, 1.313, 1.313, 1.321, 1.345, 1.373, 1.405, 1.437, 1.465, 1.483,\n+                    1.507, 1.485, 1.455, 1.422, 1.387, 1.355, 1.333, 1.319, 1.321, 1.333, 1.351, 1.381, 1.411, 1.441, 1.467, 1.483,\n+                    1.508, 1.489, 1.463, 1.432, 1.401, 1.372, 1.355, 1.333, 1.333, 1.351, 1.369, 1.393, 1.422, 1.448, 1.471, 1.484,\n+                    1.511, 1.494, 1.472, 1.444, 1.416, 1.398, 1.372, 1.361, 1.361, 1.369, 1.393, 1.411, 1.436, 1.458, 1.477, 1.487,\n+                    1.511, 1.496, 1.478, 1.455, 1.436, 1.416, 1.399, 1.391, 1.391, 1.397, 1.411, 1.429, 1.451, 1.466, 1.479, 1.487,\n+                    1.511, 1.495, 1.478, 1.462, 1.448, 1.432, 1.419, 1.419, 1.419, 1.419, 1.429, 1.445, 1.459, 1.471, 1.482, 1.487\n+                ]\n+            },\n+            {\n+                \"ct\": 6000, \"table\":\n+                [\n+                    2.581, 2.573, 2.558, 2.539, 2.514, 2.487, 2.473, 2.471, 2.471, 2.471, 2.479, 2.499, 2.517, 2.532, 2.543, 2.544,\n+                    2.575, 2.559, 2.539, 2.521, 2.491, 2.458, 2.435, 2.421, 2.421, 2.429, 2.449, 2.477, 2.499, 2.519, 2.534, 2.543,\n+                    2.561, 2.549, 2.521, 2.491, 2.457, 2.423, 2.393, 2.375, 2.375, 2.387, 2.412, 2.444, 2.475, 2.499, 2.519, 2.532,\n+                    2.552, 2.531, 2.498, 2.459, 2.423, 2.391, 2.349, 2.325, 2.325, 2.344, 2.374, 2.412, 2.444, 2.476, 2.505, 2.519,\n+                    2.543, 2.518, 2.479, 2.435, 2.392, 2.349, 2.324, 2.285, 2.283, 2.313, 2.344, 2.374, 2.417, 2.457, 2.489, 2.506,\n+                    2.541, 2.511, 2.469, 2.421, 2.372, 2.326, 2.284, 2.277, 2.279, 2.283, 2.313, 2.357, 2.401, 2.443, 2.479, 2.504,\n+                    2.541, 2.511, 2.469, 2.421, 2.372, 2.326, 2.284, 2.267, 2.267, 2.281, 2.313, 2.357, 2.401, 2.443, 2.479, 2.504,\n+                    2.541, 2.512, 2.472, 2.425, 2.381, 2.338, 2.302, 2.278, 2.279, 2.301, 2.324, 2.364, 2.407, 2.447, 2.481, 2.504,\n+                    2.544, 2.519, 2.483, 2.441, 2.401, 2.363, 2.338, 2.302, 2.302, 2.324, 2.355, 2.385, 2.423, 2.459, 2.488, 2.506,\n+                    2.549, 2.527, 2.497, 2.463, 2.427, 2.401, 2.363, 2.345, 2.345, 2.355, 2.385, 2.412, 2.444, 2.473, 2.497, 2.509,\n+                    2.552, 2.532, 2.507, 2.481, 2.459, 2.427, 2.402, 2.389, 2.389, 2.394, 2.412, 2.444, 2.465, 2.481, 2.499, 2.511,\n+                    2.553, 2.533, 2.508, 2.489, 2.475, 2.454, 2.429, 2.429, 2.429, 2.429, 2.439, 2.463, 2.481, 2.492, 2.504, 2.511\n+                ]\n+            }\n+        ],\n+        \"calibrations_Cb\":\n+        [\n+            {\n+                \"ct\": 3000, \"table\":\n+                [\n+                    3.132, 3.126, 3.116, 3.103, 3.097, 3.091, 3.087, 3.086, 3.088, 3.091, 3.092, 3.102, 3.113, 3.121, 3.141, 3.144,\n+                    3.149, 3.132, 3.123, 3.108, 3.101, 3.096, 3.091, 3.089, 3.091, 3.092, 3.101, 3.107, 3.116, 3.129, 3.144, 3.153,\n+                    3.161, 3.149, 3.129, 3.121, 3.108, 3.103, 3.101, 3.101, 3.101, 3.103, 3.107, 3.116, 3.125, 3.134, 3.153, 3.159,\n+                    3.176, 3.161, 3.144, 3.129, 3.124, 3.121, 3.117, 3.118, 3.118, 3.119, 3.122, 3.125, 3.134, 3.146, 3.159, 3.171,\n+                    3.183, 3.176, 3.157, 3.144, 3.143, 3.143, 3.139, 3.141, 3.141, 3.141, 3.141, 3.141, 3.146, 3.161, 3.171, 3.179,\n+                    3.189, 3.183, 3.165, 3.157, 3.156, 3.157, 3.159, 3.163, 3.163, 3.163, 3.163, 3.161, 3.163, 3.169, 3.179, 3.187,\n+                    3.199, 3.189, 3.171, 3.165, 3.164, 3.167, 3.171, 3.173, 3.173, 3.172, 3.171, 3.169, 3.169, 3.175, 3.187, 3.189,\n+                    3.206, 3.196, 3.177, 3.171, 3.165, 3.167, 3.171, 3.173, 3.173, 3.172, 3.171, 3.171, 3.173, 3.177, 3.192, 3.194,\n+                    3.209, 3.197, 3.178, 3.171, 3.164, 3.161, 3.159, 3.161, 3.162, 3.164, 3.167, 3.171, 3.173, 3.181, 3.193, 3.198,\n+                    3.204, 3.194, 3.176, 3.165, 3.161, 3.156, 3.154, 3.154, 3.159, 3.161, 3.164, 3.168, 3.173, 3.182, 3.198, 3.199,\n+                    3.199, 3.191, 3.176, 3.169, 3.161, 3.157, 3.153, 3.153, 3.156, 3.161, 3.164, 3.168, 3.173, 3.186, 3.196, 3.199,\n+                    3.199, 3.188, 3.179, 3.173, 3.165, 3.157, 3.153, 3.154, 3.156, 3.159, 3.167, 3.171, 3.176, 3.185, 3.193, 3.198\n+                ]\n+            },\n+            {\n+                \"ct\": 6000, \"table\":\n+                [\n+                    1.579, 1.579, 1.577, 1.574, 1.573, 1.571, 1.571, 1.571, 1.571, 1.569, 1.569, 1.571, 1.572, 1.574, 1.577, 1.578,\n+                    1.584, 1.579, 1.578, 1.575, 1.573, 1.572, 1.571, 1.572, 1.572, 1.571, 1.571, 1.572, 1.573, 1.576, 1.578, 1.579,\n+                    1.587, 1.584, 1.579, 1.578, 1.575, 1.573, 1.573, 1.575, 1.575, 1.574, 1.573, 1.574, 1.576, 1.578, 1.581, 1.581,\n+                    1.591, 1.587, 1.584, 1.579, 1.578, 1.579, 1.579, 1.581, 1.581, 1.581, 1.578, 1.577, 1.578, 1.581, 1.585, 1.586,\n+                    1.595, 1.591, 1.587, 1.585, 1.585, 1.586, 1.587, 1.587, 1.588, 1.588, 1.585, 1.584, 1.584, 1.586, 1.589, 1.589,\n+                    1.597, 1.595, 1.591, 1.589, 1.591, 1.593, 1.595, 1.596, 1.597, 1.597, 1.595, 1.594, 1.592, 1.592, 1.593, 1.593,\n+                    1.601, 1.597, 1.593, 1.592, 1.593, 1.595, 1.598, 1.599, 1.602, 1.601, 1.598, 1.596, 1.595, 1.596, 1.595, 1.595,\n+                    1.601, 1.599, 1.594, 1.593, 1.593, 1.595, 1.598, 1.599, 1.602, 1.601, 1.598, 1.597, 1.597, 1.597, 1.597, 1.597,\n+                    1.602, 1.599, 1.594, 1.593, 1.592, 1.593, 1.595, 1.597, 1.597, 1.598, 1.598, 1.597, 1.597, 1.597, 1.598, 1.598,\n+                    1.599, 1.598, 1.594, 1.592, 1.591, 1.591, 1.592, 1.595, 1.596, 1.597, 1.597, 1.597, 1.597, 1.599, 1.599, 1.599,\n+                    1.598, 1.596, 1.594, 1.593, 1.592, 1.592, 1.592, 1.594, 1.595, 1.597, 1.597, 1.597, 1.598, 1.599, 1.599, 1.599,\n+                    1.597, 1.595, 1.594, 1.594, 1.593, 1.592, 1.593, 1.595, 1.595, 1.597, 1.598, 1.598, 1.598, 1.599, 1.599, 1.599\n+                ]\n+            }\n+        ],\n+        \"luminance_lut\":\n+        [\n+            2.887, 2.754, 2.381, 2.105, 1.859, 1.678, 1.625, 1.623, 1.623, 1.624, 1.669, 1.849, 2.092, 2.362, 2.723, 2.838,\n+            2.754, 2.443, 2.111, 1.905, 1.678, 1.542, 1.455, 1.412, 1.412, 1.452, 1.535, 1.665, 1.893, 2.096, 2.413, 2.723,\n+            2.443, 2.216, 1.911, 1.678, 1.537, 1.372, 1.288, 1.245, 1.245, 1.283, 1.363, 1.527, 1.665, 1.895, 2.193, 2.413,\n+            2.318, 2.057, 1.764, 1.541, 1.372, 1.282, 1.159, 1.113, 1.113, 1.151, 1.269, 1.363, 1.527, 1.749, 2.034, 2.278,\n+            2.259, 1.953, 1.671, 1.452, 1.283, 1.159, 1.107, 1.018, 1.017, 1.097, 1.151, 1.269, 1.437, 1.655, 1.931, 2.222,\n+            2.257, 1.902, 1.624, 1.408, 1.239, 1.111, 1.019, 1.011, 1.005, 1.014, 1.098, 1.227, 1.395, 1.608, 1.883, 2.222,\n+            2.257, 1.902, 1.624, 1.408, 1.239, 1.111, 1.016, 1.001, 1.001, 1.007, 1.098, 1.227, 1.395, 1.608, 1.883, 2.222,\n+            2.257, 1.946, 1.666, 1.448, 1.281, 1.153, 1.093, 1.013, 1.008, 1.089, 1.143, 1.269, 1.437, 1.654, 1.934, 2.226,\n+            2.309, 2.044, 1.756, 1.532, 1.363, 1.259, 1.153, 1.093, 1.093, 1.143, 1.264, 1.354, 1.524, 1.746, 2.035, 2.284,\n+            2.425, 2.201, 1.896, 1.662, 1.519, 1.363, 1.259, 1.214, 1.214, 1.264, 1.354, 1.519, 1.655, 1.888, 2.191, 2.413,\n+            2.724, 2.417, 2.091, 1.888, 1.662, 1.519, 1.419, 1.373, 1.373, 1.425, 1.521, 1.655, 1.885, 2.089, 2.409, 2.722,\n+            2.858, 2.724, 2.356, 2.085, 1.842, 1.658, 1.581, 1.577, 1.577, 1.579, 1.653, 1.838, 2.084, 2.359, 2.722, 2.842\n+        ],\n+        \"sigma\": 0.00372,\n+        \"sigma_Cb\": 0.00244\n+    },\n+    \"rpi.contrast\":\n+    {\n+        \"ce_enable\": 1,\n+        \"gamma_curve\":\n+        [\n+            0, 0, 1024, 5040, 2048, 9338, 3072, 12356, 4096, 15312, 5120, 18051, 6144, 20790, 7168, 23193,\n+            8192, 25744, 9216, 27942, 10240, 30035, 11264, 32005, 12288, 33975, 13312, 35815, 14336, 37600, 15360, 39168,\n+            16384, 40642, 18432, 43379, 20480, 45749, 22528, 47753, 24576, 49621, 26624, 51253, 28672, 52698, 30720, 53796,\n+            32768, 54876, 36864, 57012, 40960, 58656, 45056, 59954, 49152, 61183, 53248, 62355, 57344, 63419, 61440, 64476,\n+            65535, 65535\n+        ]\n+    },\n+    \"rpi.ccm\":\n+    {\n+        \"ccms\":\n+        [\n+            {\n+                \"ct\": 2890, \"ccm\":\n+                [\n+                    1.36754, -0.18448, -0.18306, -0.32356, 1.44826, -0.12471, -0.00412, -0.69936, 1.70348\n+                ]\n+            },\n+            {\n+                \"ct\": 2920, \"ccm\":\n+                [\n+                    1.26704, 0.01624, -0.28328, -0.28516, 1.38934, -0.10419, -0.04854, -0.82211, 1.87066\n+                ]\n+            },\n+            {\n+                \"ct\": 3550, \"ccm\":\n+                [\n+                    1.42836, -0.27235, -0.15601, -0.28751, 1.41075, -0.12325, -0.01812, -0.54849, 1.56661\n+                ]\n+            },\n+            {\n+                \"ct\": 4500, \"ccm\":\n+                [\n+                    1.36328, -0.19569, -0.16759, -0.25254, 1.52248, -0.26994, -0.01575, -0.53155, 1.54729\n+                ]\n+            },\n+            {\n+                \"ct\": 5700, \"ccm\":\n+                [\n+                    1.49207, -0.37245, -0.11963, -0.21493, 1.40005, -0.18512, -0.03781, -0.38779, 1.42561\n+                ]\n+            },\n+            {\n+                \"ct\": 7900, \"ccm\":\n+                [\n+                    1.34849, -0.05425, -0.29424, -0.22182, 1.77684, -0.55502, -0.07403, -0.55336, 1.62739\n+                ]\n+            }\n+        ]\n+    },\n+    \"rpi.sharpen\":\n+    {\n+    }\n+}\ndiff --git a/src/ipa/raspberrypi/data/meson.build b/src/ipa/raspberrypi/data/meson.build\nindex 2def75cb..e84cd099 100644\n--- a/src/ipa/raspberrypi/data/meson.build\n+++ b/src/ipa/raspberrypi/data/meson.build\n@@ -7,6 +7,7 @@ conf_files = files([\n     'imx378.json',\n     'imx477.json',\n     'imx477_noir.json',\n+    'imx519.json',\n     'ov5647.json',\n     'ov5647_noir.json',\n     'ov9281.json',\ndiff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\nindex 1af31e4a..176055f4 100644\n--- a/src/ipa/raspberrypi/meson.build\n+++ b/src/ipa/raspberrypi/meson.build\n@@ -22,6 +22,7 @@ rpi_ipa_sources = files([\n     'cam_helper_imx219.cpp',\n     'cam_helper_imx290.cpp',\n     'cam_helper_imx477.cpp',\n+    'cam_helper_imx519.cpp',\n     'cam_helper_ov9281.cpp',\n     'controller/controller.cpp',\n     'controller/histogram.cpp',\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "1/1"
    ]
}