From patchwork Thu Oct 27 22:41:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Dufresne via libcamera-devel X-Patchwork-Id: 17706 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 7356ABDB16 for ; Thu, 27 Oct 2022 22:41:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA5C262FC4; Fri, 28 Oct 2022 00:41:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666910510; bh=daE6WY54HAjKlN885/mrlKW4bKHReC2Ox9JTDd8H68w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=y0EVYu0Dl1XWGH8FfZdynSp3kCb6jBHG1ixz1LdRL++U+YObkOU04B+aIQ11pOW5V ckF0N5gOzxrfPT+YDG7pnEBJTjHKoporkzZSJv9X5btwHfMrVde/wQjWqtycre7A2S j3xWcWTOb48zulxrWO/ibDmy69SZeY65b46GrZffGvxh0K+MRGOJo/djx6qWEnF5V6 FFg24yrNKg15HDDOaK7rKRD99LTpf0XKkpRvHE+joz6YPdViAO1j3lNPKSolm26W7e nLiveN/0elg17HwsFjv3yIIy0h7N1ItpnXL7Gq9HiNRUsYRUI86/LKmX9ELRGCjQ37 4IbflmcIWHj3g== Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com [IPv6:2001:4860:4864:20::34]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D1C4462FA0 for ; Fri, 28 Oct 2022 00:41:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=rothemail-net.20210112.gappssmtp.com header.i=@rothemail-net.20210112.gappssmtp.com header.b="rVB+ZD6H"; dkim-atps=neutral Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-12c8312131fso4315392fac.4 for ; Thu, 27 Oct 2022 15:41:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rothemail-net.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=Nx/vHY66gELOXMwShEVVfeaHqV/OVGT2Ylh4eoO+CP8=; b=rVB+ZD6H/Nt57SFsAK95bhsBqgJNZpNTIrIFoKM8fPv5BSCVExWfxzhDxjMHZOYiTP 8cVk9jsCVXo7Oj8A6BjbhOQG2fzZo+IE2luhbA7vWsm67suW5Gyc+XIgGtfpdcsBRsli +IZ5cGOfdKHiXxk8C7/mpPXSnPkNFO4cq/7k3ranfbakdT36xjtvzec2SZ7u+de2QRg2 xozsWXJP2POV7r6lnoM0xsX6VG4/622qtS/605Zdfb786Nugmg7KCbWftMJNg0luF8Ok mSxsQSGgM+YgyrwhLTbZfEE/xqZDK5sZx//STidyQwA1NjWD1OlNKoyMPQt3VDLFCP+Q Vwxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Nx/vHY66gELOXMwShEVVfeaHqV/OVGT2Ylh4eoO+CP8=; b=BPueyZHSY5k58cjcI4Sj6BaAcXKVX7TIy1fxF8nfbulnUgW+AvOWMcVd5z+RjaBr3r rUYyWnOtbiKAfo3D6g8+W/iswZgrsBrc+/OiwJgFddCisANFO5hSdGGMVp3l3IODWolB 64rfiCoH7KaJp9YoTTHdydvchguox26WFzHEGml0VCGMyiN0UKUp+AArEDcRBS2jeneG HoE/gvESwvS2rAWI935AV9AmV75MAvSl/6Q1Qbuz9NlESSe99Jr1aDiOS28ugqa+xiWF 3aIRCFtVNTdwNo6uGKcvPYgTB30NbFmSBFnTPc+YAbAEAwunzGIhkvOVEsO9KglZ7gDj UQoQ== X-Gm-Message-State: ACrzQf34ylsivrXPjcP3ukpPy1R8L4rzLusfa3y1fKngozQSwr4ZaH7x msjHVeVtP0V4FZnKlmAhF9v8ZuykAATk30xl X-Google-Smtp-Source: AMsMyM5wpO2WJUi6LNpnTfgqfE9bfRcVy9pvrHwKX8JhwlYzUxSBohuzFelcNk+sZAEUDb8QUSFWsw== X-Received: by 2002:a05:6870:3409:b0:13b:5dee:40d with SMTP id g9-20020a056870340900b0013b5dee040dmr7173622oah.121.1666910502834; Thu, 27 Oct 2022 15:41:42 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:6a4b:7aa7:dda2:75cb]) by smtp.gmail.com with ESMTPSA id r20-20020a056830419400b006619533d1ddsm976825otu.76.2022.10.27.15.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 15:41:42 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 17:41:29 -0500 Message-Id: <20221027224135.348115-5-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027224135.348115-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 04/10] ipa: libcamera: add support for ov8858 sensor X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Nicholas Roth via libcamera-devel From: Nicolas Dufresne via libcamera-devel Reply-To: libcamera-devel@lists.libcamera.org Cc: nicholas@rothemail.net Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nicholas Roth Currently, libcamera does not have information for the ov8858 sensor used in the PinePhone Pro, a phone designed to run Linux. This commit adds metadata, especially that sensor gain is reported and set in 1/16 discrete increments. For more information, see "5.8 manual exposure compensation/ manual gain compensation" in [0] and the driver in [1]. [0] http://www.ahdsensor.com/uploadfile/202008/55322e75316871.pdf [1] https://github.com/megous/linux/blob/orange-pi-5.19/drivers/media/i2c/ov8858.c Signed-off-by: Nicholas Roth --- src/ipa/libipa/camera_sensor_helper.cpp | 11 +++++++++++ src/libcamera/camera_sensor_properties.cpp | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 35056bec..f2040cbd 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -476,6 +476,17 @@ public: }; REGISTER_CAMERA_SENSOR_HELPER("ov5693", CameraSensorHelperOv5693) +class CameraSensorHelperOv8858 : public CameraSensorHelper +{ +public: + CameraSensorHelperOv8858() + { + gainType_ = AnalogueGainLinear; + gainConstants_.linear = { 1, 0, 0, 16 }; + } +}; +REGISTER_CAMERA_SENSOR_HELPER("m00_f_ov8858", CameraSensorHelperOv8858) + class CameraSensorHelperOv8865 : public CameraSensorHelper { public: diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp index e5f27f06..d0757c15 100644 --- a/src/libcamera/camera_sensor_properties.cpp +++ b/src/libcamera/camera_sensor_properties.cpp @@ -146,6 +146,20 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen */ }, } }, + { "m00_f_ov8858", { + .unitCellSize = { 1200, 1200 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeColorBars, 1 }, + /* + * No best corresponding test pattern for: + * 1: "Vertical Color Bar Type 1", + * 2: "Vertical Color Bar Type 2", + * 3: "Vertical Color Bar Type 3", + * 4: "Vertical Color Bar Type 4" + */ + }, + } }, { "ov8865", { .unitCellSize = { 1400, 1400 }, .testPatternModes = {