From patchwork Tue Sep 24 08:26:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 21340 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 6EBA8C3257 for ; Tue, 24 Sep 2024 09:01:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 03B5863514; Tue, 24 Sep 2024 11:01:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jJT7hgX2"; dkim-atps=neutral Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EA8DA634F9 for ; Tue, 24 Sep 2024 11:00:58 +0200 (CEST) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2054e22ce3fso52218015ad.2 for ; Tue, 24 Sep 2024 02:00:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727168457; x=1727773257; darn=lists.libcamera.org; 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=foSmkcJXyx1QavPPb4g+Uwf2bhegj0k51OKwBYu/aGE=; b=jJT7hgX26qIujkxC4Ik+zJU77oL5qi+LJsVQeubv70AHmTNLr/TY+P2e0IaLuE8x8d 37aeOCjJyNHLaAcKJ+dARJ+/FqEUDMFQelC+ks6VrUJ4GYkpRH4ZHAy8fXpwwS8oJEMT 5zdBiKe4Rq9sQbWRrKPfzXQrCNpYaDDa0qayA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727168457; x=1727773257; 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=foSmkcJXyx1QavPPb4g+Uwf2bhegj0k51OKwBYu/aGE=; b=Eqte5gi+Fg2dXzMJB72zC2PibxL0HEVzX6QPHm/TA8hqnrbw5Q0O1YtzK6acXRiOLW dpQ7LTBuTdX1DR5cRtFa+tyQj1uc7OULGFfGishixR8wL8cifBMjlpiFBCagvhdJ3ONG c1WU0zU/cPeIRsRdToraw8TpGqB/gEKr+YVOsqYBZ29Md6YIP2VPqcS5URssMPl09omz 0gUOPBk22O+ETMYAPrpD/cHANcz+yAS2L5COe7gtV2TJYUA+pjH5NsBqIJdgCt8tWqHm 0FMwEjdWWrJ0DzHiHWRfRRemMhpivVSxxhLOD/s7McIe8sWUfq8bNRFOSsUBxlp8IwZs JGlQ== X-Gm-Message-State: AOJu0YwFPntSaIlhIthkBNmH387XtABM6GTxai+UosnJUcFnF2yDr5Tv RrFYoRz0t5uOmRiAH7WZC9/J/DCz+bmI39ahANMOSDVpOB7KoQGtPgsUt72a85YtV8pw57WcTCo = X-Google-Smtp-Source: AGHT+IEZnBjlPgOVCRg3NqE3tfO8Fz3rYqhTo3jhxEiTj+OMp7GriisanarzML1ZX/mB90IoKUujhw== X-Received: by 2002:a17:902:d4c9:b0:205:674f:31c2 with SMTP id d9443c01a7336-208d83040d7mr182854655ad.9.1727168457079; Tue, 24 Sep 2024 02:00:57 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (0.223.81.34.bc.googleusercontent.com. [34.81.223.0]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af185853dsm6803885ad.265.2024.09.24.02.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 02:00:56 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang , Han-Lin Chen , Xing Gu , Yudhistira Erlandinata , Harvey Yang Subject: [PATCH v2 1/2] libcamera: Add gc05a2 camera sensor proprietary for ciri Date: Tue, 24 Sep 2024 08:26:10 +0000 Message-ID: <20240924090051.1617040-2-chenghaoyang@google.com> X-Mailer: git-send-email 2.46.0.792.g87dc391469-goog In-Reply-To: <20240924090051.1617040-1-chenghaoyang@google.com> References: <20240924090051.1617040-1-chenghaoyang@google.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" gc05a2 is the first sensor used by ciri. Signed-off-by: Han-Lin Chen Co-developed-by: Xing Gu Co-developed-by: Yudhistira Erlandinata Co-developed-by: Harvey Yang --- src/ipa/libipa/camera_sensor_helper.cpp | 17 +++++++++++++++++ .../sensor/camera_sensor_properties.cpp | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index ffc7c1d7..cd7d12d6 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -519,6 +519,23 @@ private: }; REGISTER_CAMERA_SENSOR_HELPER("ar0521", CameraSensorHelperAr0521) +class CameraSensorHelperGc05a2 : public CameraSensorHelper +{ +public: + uint32_t gainCode(double gain) const override + { + uint32_t aeGain = std::clamp((uint32_t)gain, kAeBaseGain_, kStep_ * kAeBaseGain_); + return aeGain * 0x400 / kAeBaseGain_; + } + + // `double gain(uint32_t gainCode)` will not be used. + +private: + static constexpr uint32_t kStep_ = 16; + static constexpr uint32_t kAeBaseGain_ = 1024; +}; +REGISTER_CAMERA_SENSOR_HELPER("gc05a2", CameraSensorHelperGc05a2) + class CameraSensorHelperImx219 : public CameraSensorHelper { public: diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 4e5217ab..3e1bd85e 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -70,6 +70,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen { controls::draft::TestPatternModeColorBarsFadeToGray, 3 }, }, } }, + { "gc05a2", { + .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeColorBars, 1 }, + }, + } }, { "hi846", { .unitCellSize = { 1120, 1120 }, .testPatternModes = { From patchwork Tue Sep 24 08:26:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 21341 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 27851C32D4 for ; Tue, 24 Sep 2024 09:01:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6B7BA63513; Tue, 24 Sep 2024 11:01:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="COkv8pOY"; dkim-atps=neutral Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E6A4B63513 for ; Tue, 24 Sep 2024 11:01:00 +0200 (CEST) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-206b9455460so40066585ad.0 for ; Tue, 24 Sep 2024 02:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727168459; x=1727773259; darn=lists.libcamera.org; 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=+NCC7SL2eB+/9TOyBTPsQ+hL3qvY0sKdb0xgfgyUC3E=; b=COkv8pOYa8O1fFmsNeKrzs3N+7myAjn+cFel1EizPdaqzCwzQIn2dYF6hviFq//QQv sPU2Vo8WgHpOKTIR/6sH4blsAtdzzsmy85GrMiO5Xqm1zWTJry0zVa3VVyCsPNz4xslB YvMI4Cv6FORZewlJ4s7EspOOb9H4clRWH6D6U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727168459; x=1727773259; 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=+NCC7SL2eB+/9TOyBTPsQ+hL3qvY0sKdb0xgfgyUC3E=; b=txzUmNEPlaU4e2KJwlJrFdB2s5iG/OtXLuWLKlFVIytOx9BUSf2QZiKIESsm8uyIm8 znQ1DdIa+6oy0Q3acLZ+67MQ5O7R514m1Wiq4YBSW6cpEgtU1jxflxqj9PlHdVljpbPv 2UOQjxvtjnbXZvbclrUf2weLh8P/DjHudgQSeWCHYW6R2QsMvOGEFod+f8H+zO+bcKrl eGsuDJUEfCNr/CZydcWliXWZ+1wGUpwUDAGXGnk+AOe7tV2A12WRKJM3UBzEdZv7hzPf jvZOYaVPXwfMnkEG8HiAO6ZO35JbMtuKUN4B0qMMz99d3bZa9qEjIP/CZDzS/PmPq3qc xtlA== X-Gm-Message-State: AOJu0YybI8QyXAKndavr++Z+mjHvkEfTaqs6gsqbshc/CVQuL45OpogP Jh72pJOHQaYlvcMpPfabnVq82p5TvEjI5kOZW5Q8n57LidBe/lfB5TNDXkX3m8WH/UPQHdXn6PU = X-Google-Smtp-Source: AGHT+IF0kGs1qL4BPHPVSnRV3JOIPvwroAd9a8XJYE86mpJ8aNGozfdBFEJe6bQspVpe4uP0jAt5XQ== X-Received: by 2002:a17:902:e74b:b0:205:7b04:dde1 with SMTP id d9443c01a7336-20aed111f57mr43291855ad.20.1727168458889; Tue, 24 Sep 2024 02:00:58 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (0.223.81.34.bc.googleusercontent.com. [34.81.223.0]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af185853dsm6803885ad.265.2024.09.24.02.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 02:00:58 -0700 (PDT) From: Harvey Yang X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang , Han-Lin Chen , Xing Gu , Yudhistira Erlandinata , Harvey Yang Subject: [PATCH v2 2/2] libcamera: Add gc08a3 camera sensor proprietary for ciri Date: Tue, 24 Sep 2024 08:26:11 +0000 Message-ID: <20240924090051.1617040-3-chenghaoyang@google.com> X-Mailer: git-send-email 2.46.0.792.g87dc391469-goog In-Reply-To: <20240924090051.1617040-1-chenghaoyang@google.com> References: <20240924090051.1617040-1-chenghaoyang@google.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" gc08a3 is the second sensor used by ciri. Signed-off-by: Han-Lin Chen Co-developed-by: Xing Gu Co-developed-by: Yudhistira Erlandinata Co-developed-by: Harvey Yang --- src/ipa/libipa/camera_sensor_helper.cpp | 17 +++++++++++++++++ .../sensor/camera_sensor_properties.cpp | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index cd7d12d6..afa177fe 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -536,6 +536,23 @@ private: }; REGISTER_CAMERA_SENSOR_HELPER("gc05a2", CameraSensorHelperGc05a2) +class CameraSensorHelperGc08a3 : public CameraSensorHelper +{ +public: + uint32_t gainCode(double gain) const override + { + uint32_t aeGain = std::clamp((uint32_t)gain, kAeBaseGain_, kStep_ * kAeBaseGain_); + return aeGain * 0x400 / kAeBaseGain_; + } + + // `double gain(uint32_t gainCode)` will not be used. + +private: + static constexpr uint32_t kStep_ = 16; + static constexpr uint32_t kAeBaseGain_ = 1024; +}; +REGISTER_CAMERA_SENSOR_HELPER("gc08a3", CameraSensorHelperGc08a3) + class CameraSensorHelperImx219 : public CameraSensorHelper { public: diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp index 3e1bd85e..c76c8088 100644 --- a/src/libcamera/sensor/camera_sensor_properties.cpp +++ b/src/libcamera/sensor/camera_sensor_properties.cpp @@ -77,6 +77,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen { controls::draft::TestPatternModeColorBars, 1 }, }, } }, + { "gc08a3", { + .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { controls::draft::TestPatternModeOff, 0 }, + { controls::draft::TestPatternModeColorBars, 2 }, + }, + } }, { "hi846", { .unitCellSize = { 1120, 1120 }, .testPatternModes = {