{"id":19211,"url":"https://patchwork.libcamera.org/api/patches/19211/?format=json","web_url":"https://patchwork.libcamera.org/patch/19211/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20231114102122.19712-3-jacopo.mondi@ideasonboard.com>","date":"2023-11-14T10:21:21","name":"[libcamera-devel,2/3] ipa: rpi: Provide a Camera Helper for the OV64A40","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"a4f73ba49dce427abc084fa0e4f80ae3676f5e23","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/?format=json","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19211/mbox/","series":[{"id":4074,"url":"https://patchwork.libcamera.org/api/series/4074/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4074","date":"2023-11-14T10:21:19","name":"ipa: rpi: vc4: Add support for Arducam OV64A40","version":1,"mbox":"https://patchwork.libcamera.org/series/4074/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19211/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19211/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 5EF37C3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Nov 2023 10:21:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 55A95629BF;\n\tTue, 14 Nov 2023 11:21:39 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8F36C61DB3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Nov 2023 11:21:36 +0100 (CET)","from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D1507D49;\n\tTue, 14 Nov 2023 11:21:10 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1699957299;\n\tbh=/YHNOxGZSYLHC/qbYZETeeHhoEQiefxmAtEjkaLjk3M=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=G7kTF++RkBNGpo+q6zd3GmXJQ3DP7apT4x0W9Voh99iOhwIjHv8KMsyWeeGBchd4i\n\tA8jz0Zr0I/GysSVauAMcx7ObK2LgszMHUjeNoMZMLkX921T5mASnFDA+ORHWBMDiqf\n\t75VZBi8T9nc3Aj6ctvuMprPJiYAJQa2LPPdB5FrSFuMKG/ggFXT6s1CSNYhP+61gmt\n\tbgpUcNrMpXVrrH+oyUDRchaGt1+Z07SKLJS07ixC6T1R+yJ1jMPajkDOpQ0xjoHNxy\n\tHCRepFKwBNLZBJgtkjNu+25yb+ip2j/KNdEf+BCStLfcy2H9SUZis99/5+/PSnxAXt\n\tvJkbrWd9/IA7g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1699957271;\n\tbh=/YHNOxGZSYLHC/qbYZETeeHhoEQiefxmAtEjkaLjk3M=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rdChoW40bmpW3xLPx+eCck7jPVDuq8nJmXwugCZ/bXlF8skObAdTgTSm27QXhpQQe\n\tLfXvT3Xw/uH9LIrqNrCndxkrQ5s+F9SIg4C2YrwCK3D+y55zhlNJ7Xa155fMv3sAEe\n\t9N9af5QLiiywLQ9aies8VPK9bM0n+Bs+sHhZBzbg="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"rdChoW40\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 14 Nov 2023 11:21:21 +0100","Message-ID":"<20231114102122.19712-3-jacopo.mondi@ideasonboard.com>","X-Mailer":"git-send-email 2.41.0","In-Reply-To":"<20231114102122.19712-1-jacopo.mondi@ideasonboard.com>","References":"<20231114102122.19712-1-jacopo.mondi@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/3] ipa: rpi: Provide a Camera Helper for\n\tthe OV64A40","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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>, lee.jackson@arducam.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Support the OV64A40 sensor with a camera helper to manage the gain\nmodel, light sensitivity, and control delays.\n\nSigned-off-by: Lee Jackson <lee.jackson@arducam.com>\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/ipa/rpi/cam_helper/cam_helper_ov64a40.cpp | 73 +++++++++++++++++++\n src/ipa/rpi/cam_helper/meson.build            |  1 +\n 2 files changed, 74 insertions(+)\n create mode 100644 src/ipa/rpi/cam_helper/cam_helper_ov64a40.cpp","diff":"diff --git a/src/ipa/rpi/cam_helper/cam_helper_ov64a40.cpp b/src/ipa/rpi/cam_helper/cam_helper_ov64a40.cpp\nnew file mode 100644\nindex 000000000000..041c32dd9222\n--- /dev/null\n+++ b/src/ipa/rpi/cam_helper/cam_helper_ov64a40.cpp\n@@ -0,0 +1,73 @@\n+/* SPDX-License-Identifier: BSD-2-Clause */\n+/*\n+ * Copyright (C) 2021, Raspberry Pi Ltd\n+ *\n+ * cam_helper_ov64a40.cpp - camera information for ov64a40 sensor\n+ */\n+\n+#include <assert.h>\n+\n+#include \"cam_helper.h\"\n+\n+using namespace RPiController;\n+\n+class CamHelperOv64a40 : public CamHelper\n+{\n+public:\n+\tCamHelperOv64a40();\n+\tuint32_t gainCode(double gain) const override;\n+\tdouble gain(uint32_t gainCode) const override;\n+\tvoid getDelays(int &exposureDelay, int &gainDelay,\n+\t\t       int &vblankDelay, int &hblankDelay) const override;\n+\tdouble getModeSensitivity(const CameraMode &mode) 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 = 4;\n+};\n+\n+CamHelperOv64a40::CamHelperOv64a40()\n+\t: CamHelper({}, frameIntegrationDiff)\n+{\n+}\n+\n+uint32_t CamHelperOv64a40::gainCode(double gain) const\n+{\n+\treturn static_cast<uint32_t>(gain * 128.0);\n+}\n+\n+double CamHelperOv64a40::gain(uint32_t gainCode) const\n+{\n+\treturn static_cast<double>(gainCode) / 128.0;\n+}\n+\n+void CamHelperOv64a40::getDelays(int &exposureDelay, int &gainDelay,\n+\t\t\t\t int &vblankDelay, int &hblankDelay) const\n+{\n+\t/* The driver appears to behave as follows: */\n+\texposureDelay = 2;\n+\tgainDelay = 2;\n+\tvblankDelay = 2;\n+\thblankDelay = 2;\n+}\n+\n+double CamHelperOv64a40::getModeSensitivity(const CameraMode &mode) const\n+{\n+\tif (mode.binX >= 2 && mode.scaleX >= 4) {\n+\t\treturn 4.0;\n+\t} else if (mode.binX >= 2 && mode.scaleX >= 2) {\n+\t\treturn 2.0;\n+\t} else {\n+\t\treturn 1.0;\n+\t}\n+}\n+\n+static CamHelper *create()\n+{\n+\treturn new CamHelperOv64a40();\n+}\n+\n+static RegisterCamHelper reg(\"ov64a40\", &create);\ndiff --git a/src/ipa/rpi/cam_helper/meson.build b/src/ipa/rpi/cam_helper/meson.build\nindex bdf2db8eb742..7262505742f3 100644\n--- a/src/ipa/rpi/cam_helper/meson.build\n+++ b/src/ipa/rpi/cam_helper/meson.build\n@@ -9,6 +9,7 @@ rpi_ipa_cam_helper_sources = files([\n     'cam_helper_imx477.cpp',\n     'cam_helper_imx519.cpp',\n     'cam_helper_imx708.cpp',\n+    'cam_helper_ov64a40.cpp',\n     'cam_helper_ov9281.cpp',\n     'md_parser_smia.cpp',\n ])\n","prefixes":["libcamera-devel","2/3"]}