From patchwork Fri Oct 30 20:57:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Heyne X-Patchwork-Id: 28724 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 E30E4C324C for ; Fri, 30 Oct 2026 21:13:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 03F3D69106; Fri, 30 Oct 2026 22:13:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=firestrike.de header.i=@firestrike.de header.b="RpgiQURB"; dkim-atps=neutral Received: from mx.firestrike.de (mx.firestrike.de [IPv6:2003:a:271f:df02:be24:11ff:fe54:4c8]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ADDA869075 for ; Fri, 30 Oct 2026 21:57:57 +0100 (CET) Received: from pmg.cloud.firestrike.de (localhost [127.0.0.1]) by pmg.cloud.firestrike.de (Proxmox) with ESMTP id EBDB5160F92 for ; Fri, 30 Oct 2026 20:57:56 +0000 (UTC) Received: from mail.firestrike.de (unknown [192.168.28.175]) by pmg.cloud.firestrike.de (Proxmox) with ESMTPS id D44C0160E71 for ; Fri, 30 Oct 2026 20:57:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2EFA412406E; Fri, 30 Oct 2026 21:57:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=firestrike.de; s=dkim; t=1793393876; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding; bh=ddoWe5Nqk4VpdcB+47fU0UC3dbkpHUUm37lChHIs8UA=; b=RpgiQURBuS0J2yRWFullza099HmHFztVVCQlhHIE+r2ycj/rktBoy5zCRznU9sTFdHE5FG youHp5+OVYX4/DqDalTpwZHxJYciluCxtJQ33U9lV1Z9HjV0hmjaKkT6hL4fV0gs54K9Uz xXi1MWm8H00PSAVy+UyEBgjgtlf85QA36OAhk2tdIcWHI1i3Wl6prxM37tX6yxvFyPivEP QyCvsC0HswC10WpVuDuqeoYZWAO8zQjmZLa27Fg0/z66zUgEM7bYxg9oGrqSkB+Fx3bpQg NIUcmRFbahgavm5C8mBOSSRWn/te2mGoQI6R1z2jDwGMglZRliTWx3dNAd83AQ== From: Tim Heyne To: libcamera-devel@lists.libcamera.org Cc: Tim Heyne Subject: [PATCH] ipa: camera_sensor_helper: Add black level for OV8865 Date: Fri, 30 Oct 2026 21:57:06 +0100 Message-ID: <20261030205706.29237-1-tim.heyne@firestrike.de> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Mailman-Approved-At: Fri, 30 Oct 2026 22:13:11 +0100 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 OmniVision OV8865 sensor has a configurable data pedestal (BLC target, registers 0x4004/0x4005) that is 0x10 for 10-bit data, the same as the OV5693. Read back on a Surface Pro 7 while streaming: 0x4004 = 0x00, 0x4005 = 0x10, with BLC enabled (0x4000 = 0xf1). Add the 16-bit representation of that level to CameraSensorHelperOv8865. Without a known black level the software ISP falls back to estimating it from the histogram. In dim scenes with high analogue gain the estimate lands on the noise floor and the whole image is subtracted away, leaving a flat grey frame. With the black level set, the rear camera of the Surface Pro 7 produces a dark but structured image under the same conditions. This change was found and prepared with the help of an AI coding assistant (Claude); the submitter reviewed it and ran the tests on the hardware. Signed-off-by: Tim Heyne --- src/ipa/libipa/camera_sensor_helper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp index 359040ec..f9a17067 100644 --- a/src/ipa/libipa/camera_sensor_helper.cpp +++ b/src/ipa/libipa/camera_sensor_helper.cpp @@ -872,6 +872,7 @@ class CameraSensorHelperOv8865 : public CameraSensorHelper public: CameraSensorHelperOv8865() { + blackLevel_ = 1024; gain_ = AnalogueGainLinear{ 1, 0, 0, 128 }; } };