From patchwork Sun Oct 30 23:05:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Roth X-Patchwork-Id: 17734 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 092B0C3287 for ; Sun, 30 Oct 2022 23:05:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1DD1D6303F; Mon, 31 Oct 2022 00:05:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1667171125; bh=e+8IwqVi/c7EJiL3s4FzMtHpcKsgZKb9Ahldqi9AONs=; 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=jzy4O4KV8t9Jn8gqWz08RUtvB4zdo2vztDsBQkeOLVleUB2OVe8wGrMuYWV5mHjvO dFpjx70KEf/ago1Hpe1t/3ybIGCJxUK8rY4FcPpg0ceNHKYumnS0vx6KGnmpkwKPHS 6TbuAuVMUmrn9l/TyDfiImEL57ljDvA8W1DmtdV1JJ28K6F7mzxxH88drsW5oD8Q0i CYayuDtgFdXSo9ep2pnDv+H1/rH3JDQ51ZDOx3ptAFZE7LzmogYeD8CJYvD58vV17I mvnYS/g624E1/oXJPFJsmq/VUzBTU1a5qRverNjHDP8lmIQeuWhH3X6LMawDMKo6RR 8Kw03b1uSh3tA== Received: from mail-ot1-x32f.google.com (mail-ot1-x32f.google.com [IPv6:2607:f8b0:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CD84563030 for ; Mon, 31 Oct 2022 00:05:20 +0100 (CET) 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="HGmmMx87"; dkim-atps=neutral Received: by mail-ot1-x32f.google.com with SMTP id w26-20020a056830061a00b0066c320f5b49so3617992oti.5 for ; Sun, 30 Oct 2022 16:05:20 -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:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mR05dEDGrNfuxWaMNIDSUORfQ6Kz6zmdMqsBUnLIkK8=; b=HGmmMx87k5VnFYJ9T3obOW3TS0cmJYaYukTzf2wQIHuuek28STrGW+LZ2LVbQ7vtRw es1jUhNK/JlEY1Xspix21RMeubGCVmA2fVkIOnh6KfTvKDU7dIiDsRT4AXzyXrnWtT7h Zju9egrhcmam9qhvu0ir0+/5aIpXM87/rZnmnNVLL0sl717fNTW/WZU+7zqpyg22GCFg 6a8UPHvfFS0ojMwW+bsnK0LVc2fAQAcuOjtkWMB/LABt/Vua2/ovfjPQ+9p4p7RULZMI a63tKuIS/t+lVHLVRHbG+NVbOXTxTGARoAT7jtF/LzPrhq2Oo/Ak1HWg0ysIi3y2V4Kt +efQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version: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=mR05dEDGrNfuxWaMNIDSUORfQ6Kz6zmdMqsBUnLIkK8=; b=AEW+EDi8FeLW8x8c3jWZG1AbANpL+N4UU3ea4gWDsuadiQVJ9d75nSjJCL8xgr0jA5 alGzXFgzL2qBy7KGSi71BsZFN9/aXdZTIuONh6by57hfyMMdlfiqz/YCYnPugIDx81p2 6OoQEl/KjXR9PiuSnes3te8zrObqSOwni0PlSRA3yuETypLoRMeOp8XSRyqn7GtHQmtv qGPa83JSvS0Ko1I5x2sulpe+uFKkThhL+nzW0NrNpeDyYb+NKgohcHPInMItdzPODgo+ tB2PisGeSD2hB2KN15DrrP5Xe180ZI+J827FzV91wjfZuMbaOGuUpRaHklw9jhGNPLBI M4iQ== X-Gm-Message-State: ACrzQf33Jzw7/ak5zHBPOcPSp8QLvGzwevYoRczJVi+ZYoIBg3lkl0H1 jr2HnViJVX5HVVWOQRrURGCgRjQ11y9iUg== X-Google-Smtp-Source: AMsMyM6I0wLpBZE02VBDquMXbswPGsK2lS14P1qwLFsshKgMfICs05WVraMHBNxmzQICIDz4b+gtJQ== X-Received: by 2002:a05:6830:4115:b0:661:a2c4:3bcd with SMTP id w21-20020a056830411500b00661a2c43bcdmr5325743ott.368.1667171119243; Sun, 30 Oct 2022 16:05:19 -0700 (PDT) Received: from nroth-pc.attlocal.net (104-5-61-214.lightspeed.austtx.sbcglobal.net. [104.5.61.214]) by smtp.gmail.com with ESMTPSA id u4-20020a056871008400b0013c8ae74a14sm2269403oaa.42.2022.10.30.16.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 16:05:18 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Sun, 30 Oct 2022 18:05:00 -0500 Message-Id: <20221030230500.74842-6-nicholas@rothemail.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221030230500.74842-1-nicholas@rothemail.net> References: <20221030230500.74842-1-nicholas@rothemail.net> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 5/5] 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: Nicholas Roth Reply-To: Nicholas Roth Cc: Nicholas Roth Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 = {