From patchwork Thu Sep 10 17:21:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Manresa" X-Patchwork-Id: 28226 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 DF670BDCBE for ; Thu, 10 Sep 2026 17:21:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9D7F06865E; Thu, 10 Sep 2026 19:21:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rGSX5dJj"; dkim-atps=neutral Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 32BA268615 for ; Thu, 10 Sep 2026 19:21:08 +0200 (CEST) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-4843f205a5bso5041707f8f.1 for ; Thu, 10 Sep 2026 10:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789060868; x=1789665668; 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:content-type; bh=se6BENrywLu0mAUaUSqbrUeQSArODb2U+yBezrMFg+M=; b=rGSX5dJjgD8pZzkLD1KANLC8J0dnafK9NzH1xYyQ4U4836tFotNI9E4RWUeL+AoaHr narnVNDWPuvYPk/DwyMnVzt82IsydH8++tm+vlugOURyK7mxu7CUzdTyjdOsI+9ljfsL ywDxGMdR6INLZzA5Szc/v+BqvWBR+0Na7NGmnrZoOja+FirUKaUOWya61Dv0pGZN75Pi U2wZKT+6caGVZNsr4EqQDI4X347fWj6sjBW6G0yW7BESGnQ7umLOH7xMugM5qG9vaakz h/nd4DOzrONwtsjo9kL1tWLNek5W7ZnjpV07alO5YtdUJQOQrR6KpHDG1r+gzoqPFsL3 8qJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789060868; x=1789665668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=se6BENrywLu0mAUaUSqbrUeQSArODb2U+yBezrMFg+M=; b=furHI+TAVoEiljHou7QIY/8x0CXVpBpJOlRIpCD8mu6KSbpONyf4MaLWtX02rsvOKt yjADXUaUSC7O4Be/YTGzFU7rR7kVNC40LQ07Yg1y8gQPHqM5IPPGiilhXW2cIeTbtHLR pEHkQhyRtRvRqs+nYyh0V8bNKXmusuN6NDYfb7flrCMSjJbvsIdZmjqQenu0WrtAbmsK qjzTfKwFK+ro95t+2eH3Ky3yT2OGVk0y0ESkB1yJBuZWYTsKHvRpI0qHmZSkp417HWoW cuHjB0Fb49YedZ59xGEbNJJMsoJ5AnsIvYAeL03lrgkS+JgXd+c88VuzHXD2nZ0wM2sa 6uSA== X-Gm-Message-State: AFuF++lOWtXR+YIWihqP/ndN4om5zvrqT/rCFSCrgIdLTzAqtvhCkdiY JZHvkshZEQjoQwi24yHnFwBxZflDMA+om+Mele7PO0JK2XL2hU86T642KvGcZmc= X-Gm-Gg: AYBFou3qqRq5MPeKao4Rq6AFMpgcR98ww3AtRNDxIkNTIVrLKV/mqC6Gy+3hfyWRuvD HOGwMa8IpBXiSyIJW60igCtw4/zP8jDauTY82PIOdim1ZOi175B0jVJqo9mBCcXiSYtnKhjdJUo gYOhyZzkHe/kaIdQ8/Fk4PQNJuCR4v63nVVaDvqIt5JOyH+N5aj4B3V4OHWxEs68IEgboZHTg62 YvLsyckQ1uWCksYbjM8+IqWsz8ath5uaoRPWK/dkiUjgsBqFahFTO5cZIqXVl7ZKkWon1J91Ju/ ynLY3FUmERfkw3hr/OgVUeqbvzV4hJcdnrjMHclARS5Z3e+GMvrdMYWWqVyZfMQ5DzZQUg3cGOT C8ZsLC53GsUqO3SuQXjfAlMVARAUGUV1vEgZZkDjmOi14B+NrejHNYQs0y7u61VZpmWjybNNBTB H3FDs76G94KRBvL4fcoCBX+eN3FdL6Qke5skVQlSlDYhwccT6LcHhs+1NU6BWqGJ7pIfN4y2/pW 2Ml0fnYtYHEEfxfXZthjd2wGV9kbeWc54tRs+R5DVZG8qfl+1bQ9m4xQwU= X-Received: by 2002:a05:6000:490e:b0:485:8a46:b3bc with SMTP id ffacd0b85a97d-4858a46b4b8mr43074943f8f.36.1789060867472; Thu, 10 Sep 2026 10:21:07 -0700 (PDT) Received: from latitude7275 (84.124.213.91.dyn.user.ono.com. [84.124.213.91]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-485883c5bc5sm55236940f8f.24.2026.09.10.10.21.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 10:21:06 -0700 (PDT) From: "D. Manresa" To: libcamera-devel@lists.libcamera.org Cc: Daniel Scally Subject: [PATCH v3 1/2] ipa: libipa: camera_sensor_helper: Add OV5670 black level Date: Thu, 10 Sep 2026 19:21:19 +0200 Message-ID: <20260910172120.73148-2-dmanresa@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260910172120.73148-1-dmanresa@gmail.com> References: <20260908163708.341308-1-dmanresa@gmail.com> <20260910172120.73148-1-dmanresa@gmail.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" The OV5670 has a black level of 64 at 10 bits, the sensor's default BLC target. This was confirmed on a Dell Latitude 7275 by reading the ImgU statistics and dark frames with different black level corrections. Provide it in the camera sensor helper so that IPAs can use it instead of hard-coded or tuning-file values. Signed-off-by: D. Manresa --- src/ipa/libipa/camera_sensor_helper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 82bf255..eeb3277 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -802,6 +802,8 @@ class CameraSensorHelperOv5670 : public CameraSensorHelper public: CameraSensorHelperOv5670() { + /* Default BLC target of 64 at 10bits, confirmed by measurement. */ + blackLevel_ = 4096; gain_ = AnalogueGainLinear{ 1, 0, 0, 128 }; } };