From patchwork Fri Oct 28 03:17:20 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: 17716 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 2F789C3285 for ; Fri, 28 Oct 2022 03:17:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BBE9B62FC5; Fri, 28 Oct 2022 05:17:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666927059; 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=s3F3WCxfZbXxcpfB3WjGUFAbzwYVPSjxfcGjL+ynqCoXMd4e16dDNnSwrosf43pUU gwpCy2n9wE/B6BkKr0yrTt7rlelyQmsvwn6v/6vCAb1C3dmupto6GEU8wf6VpJM/Q9 TLZpHQTMAd+ryUEZ6USPfIL5EegZHeY4Oc0j4GaA1/6QMG7Defpzo6x2CBuNPIvNll AHkyQEI2inakyi70cuITRtIcXiDJJ8Z0LK/uHsmLwEQ+lzPlHQkiSmeA8XiEnFNjej X0fLi5N096QPO0S8oq2aBCHz2LwKD7CpwbGuBpwIxBI8IEjfO5CxbL6gKT0BJf3zli ngRfPYP96XZJQ== 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 5348962FB8 for ; Fri, 28 Oct 2022 05:17:34 +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="idayZRA8"; dkim-atps=neutral Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-13be3ef361dso4957316fac.12 for ; Thu, 27 Oct 2022 20:17:34 -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=idayZRA8Oo+H5eNFz26dCSPThYo2A9FORMsjbhBU//WoPlwuplGrZ3YIP2/4EfvOm+ vRxGv7AyeMsP+KzTqjjzsIp7Lvt/zqpWN9BGoRugZ10pofPqd/VQBVyCTkWI3+dEq4cQ XxP8HtnNdqaFekg68VhYbRrUsZN0PONXm4sOfgjVvoPVjneOfw1+dpjJUJaRYII5CYT5 aohosSS9lYOabU9oIJhvCcZbvGkYEgkyLAdtcqKn0n/4CgocKqS+4z7di7BWBwa2qoVu OMYUJBvvlSIJrbhKqY5Bs+hKJI0/in92+08zVnUYzx8K6q3Yvk+c+15u+hSIpo45roGz u/cA== 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=jI3vfJp2zPApW88nLryqkqZRFb09dSQj/kjb0zlt4eVcvv96Y1fR94Gr6vO2YM+P1z mCNkJulEdxjpxzwvyu6djxGI8OE5iRtzKXdLN2+CblI0Saiy/RG1gcoZ8UkNmdeapIxa otS0H5bymEyQ068xctkrlaG8+uf/qMgfBo7nABZ7qIR9QzdNPPeoBSSu4WeZrQwSFKmY zGEp5K7EaZU28GTSf3WJAFDIdAfJ2ZWt3l1zRM9VszbsNDKgQric2XTbQkK3Kancph7C Ff0bGYDJqu3bXARMLpuIgODlFME1gROW16GXEjygrWtIGK4LxYWDp3N1aiEE1n0fpymm 0jog== X-Gm-Message-State: ACrzQf16D5Z4lccE1u1NFVAdM+ByCABtpnTi7dAqJ4t/U5kOhZYOQV7K yTkdyZEfYSOr+qpp1DVBg4Z6bntmGYqVVpf0P0I= X-Google-Smtp-Source: AMsMyM68lCamEXyqvEojEV0UgHjrMM7PGQuFyrJEu77I9ShQb8SR3klQ8l9LkP6EnrBnJLWI9VFm2g== X-Received: by 2002:a05:6870:c0d5:b0:13a:fb98:713d with SMTP id e21-20020a056870c0d500b0013afb98713dmr7665311oad.199.1666927052589; Thu, 27 Oct 2022 20:17:32 -0700 (PDT) Received: from nroth-pc.attlocal.net ([2600:1700:20:20c0:293a:90ce:6463:244d]) by smtp.gmail.com with ESMTPSA id fp19-20020a056870659300b0013626c1a5f6sm1527738oab.10.2022.10.27.20.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 20:17:32 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Oct 2022 22:17:20 -0500 Message-Id: <20221028031726.4849-5-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028031726.4849-1-nicholas@rothemail.net> References: <20221027224135.348115-1-nicholas@rothemail.net> <20221028031726.4849-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 = {