[{"id":39651,"web_url":"https://patchwork.libcamera.org/comment/39651/","msgid":"<178359870164.1021520.7550796952720028841@ping.linuxembedded.co.uk>","date":"2026-07-09T12:05:01","subject":"Re: [PATCH] ipa: camera_sensor_helper: Add black levels for OV5693","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Daniel Scally (2026-07-09 12:30:55)\n> The OmniVision OV5693 sensor has a configurable data pedestal that is\n> set by default to 0x10 for 10-bit data. Add the 16-bit representation\n> of that level to CameraSensorHelperOv5693.\n> \n> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n> ---\n>  src/ipa/libipa/camera_sensor_helper.cpp | 1 +\n>  1 file changed, 1 insertion(+)\n> \n> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> index 9ab7a52f2644c93454520f0a20a4c3e370ce9d15..b73ecae6c1d010aad7a49cb3c1d75b4caad97c01 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> @@ -752,6 +752,7 @@ class CameraSensorHelperOv5693 : public CameraSensorHelper\n>  public:\n>         CameraSensorHelperOv5693()\n>         {\n> +               blacklevel_ = 1024;\n\nI see the sensor does 'automatic black level correction'. Do you know if\nthat's disabled in the kernel driver?\n\n> There are two main functions of the BLC:\n> •adjusting all normal pixel values based on the values of the black levels\n> •applying multiplication to all pixel values based on digital gain\n\nSo I guess it normalises the range too after subtraction...\n\n\nAnyway, \n\n0x4009 BLC_TARGET 0x10 RW Bit[7:0]: Black target level[7:0]\n\nand 0x10 << 6 == 1024\n\nSo:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n\n\n>                 gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };\n>         }\n>  };\n> \n> ---\n> base-commit: 32b0d940baaf182a9d01d4833e30bd340d4dc918\n> change-id: 20260628-ov5693-735ea0d9ade1\n> \n> Best regards,\n> -- \n> Daniel Scally <dan.scally@ideasonboard.com>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 64C0ABF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Jul 2026 12:05:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A273A660DD;\n\tThu,  9 Jul 2026 14:05:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ABADC65FA2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Jul 2026 14:05:04 +0200 (CEST)","from monstersaurus.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1BF71289;\n\tThu,  9 Jul 2026 14:04:14 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VLsyDsDJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1783598654;\n\tbh=dHvSzmXldIJpvwzCdI1Y2JjZOqz4F2IkMxeS+HcDHQ0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=VLsyDsDJUjwsMbzVzSKEhHimEcldNoIx3aFDRIGzKhZi413L9fg5/kNXhVtUHtuIG\n\tdi/GTkdqpebCgWShUhUquog55dyTvSEgk47kNnWndvsd39cCL3MKBDHcfbdAFfdI88\n\t5ZbUgyPG63XhCoHMkK3Yr4xMZgQ2WovRpq/v9hM4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260709-ov5693-v1-1-a17e72273f43@ideasonboard.com>","References":"<20260709-ov5693-v1-1-a17e72273f43@ideasonboard.com>","Subject":"Re: [PATCH] ipa: camera_sensor_helper: Add black levels for OV5693","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Daniel Scally <dan.scally@ideasonboard.com>","To":"Daniel Scally <dan.scally@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 09 Jul 2026 13:05:01 +0100","Message-ID":"<178359870164.1021520.7550796952720028841@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":39654,"web_url":"https://patchwork.libcamera.org/comment/39654/","msgid":"<6d56341a-eba1-4cc9-8d52-bfce445b6a20@ideasonboard.com>","date":"2026-07-09T12:40:39","subject":"Re: [PATCH] ipa: camera_sensor_helper: Add black levels for OV5693","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"content":"Hi Kieran\n\nOn 09/07/2026 13:05, Kieran Bingham wrote:\n> Quoting Daniel Scally (2026-07-09 12:30:55)\n>> The OmniVision OV5693 sensor has a configurable data pedestal that is\n>> set by default to 0x10 for 10-bit data. Add the 16-bit representation\n>> of that level to CameraSensorHelperOv5693.\n>>\n>> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n>> ---\n>>   src/ipa/libipa/camera_sensor_helper.cpp | 1 +\n>>   1 file changed, 1 insertion(+)\n>>\n>> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n>> index 9ab7a52f2644c93454520f0a20a4c3e370ce9d15..b73ecae6c1d010aad7a49cb3c1d75b4caad97c01 100644\n>> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n>> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n>> @@ -752,6 +752,7 @@ class CameraSensorHelperOv5693 : public CameraSensorHelper\n>>   public:\n>>          CameraSensorHelperOv5693()\n>>          {\n>> +               blacklevel_ = 1024;\n> \n> I see the sensor does 'automatic black level correction'. Do you know if\n> that's disabled in the kernel driver?\n\nNo, it's enabled in the kernel driver...the double correction won't have an impact currently, as the \nIPU3 BLC algorithm does not currently actually read the levels from the CameraSensorHelper, it just \nhardcodes the value 64. That will need to change of course but it's a little unclear to me what \nbitdepth the ISP expects the values in so I need to do some experimentation.\n\nThanks\nDan\n\n> \n>> There are two main functions of the BLC:\n>> •adjusting all normal pixel values based on the values of the black levels\n>> •applying multiplication to all pixel values based on digital gain\n> \n> So I guess it normalises the range too after subtraction.t..\n> \n> \n> Anyway,\n> \n> 0x4009 BLC_TARGET 0x10 RW Bit[7:0]: Black target level[7:0]\n> \n> and 0x10 << 6 == 1024\n> \n> So:\n> \n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> \n> \n> \n>>                  gain_ = AnalogueGainLinear{ 1, 0, 0, 16 };\n>>          }\n>>   };\n>>\n>> ---\n>> base-commit: 32b0d940baaf182a9d01d4833e30bd340d4dc918\n>> change-id: 20260628-ov5693-735ea0d9ade1\n>>\n>> Best regards,\n>> -- \n>> Daniel Scally <dan.scally@ideasonboard.com>\n>>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C75FBBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Jul 2026 12:40:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7E766660E3;\n\tThu,  9 Jul 2026 14:40:44 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 02A9E65FA2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Jul 2026 14:40:43 +0200 (CEST)","from [192.168.0.43]\n\t(chfd-03-b2-v4wan-176392-cust229.vm15.cable.virginm.net\n\t[82.19.20.230])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 85FD1289;\n\tThu,  9 Jul 2026 14:39:52 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"b3zLheAm\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1783600792;\n\tbh=ChIJwv3a/jcUlkv+28cZGD99MMn+5oOhnXQoqJXhZAk=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=b3zLheAmPGNB8gy24Lgnlg6E/YMg5ZK8nLKuY5FciQ1EwfycQfVEC5vdJ6EQYtTd0\n\t9Q9Ag1nRT5uEU++HwTB096rOVee7G9WiZ18aLr1pzNaB+1wFKSm6EnfcEWFqugsaWv\n\t9npQR3y+W60xM8nHoARnyuzipplvhvsCGNhzouLI=","Message-ID":"<6d56341a-eba1-4cc9-8d52-bfce445b6a20@ideasonboard.com>","Date":"Thu, 9 Jul 2026 13:40:39 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] ipa: camera_sensor_helper: Add black levels for OV5693","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20260709-ov5693-v1-1-a17e72273f43@ideasonboard.com>\n\t<178359870164.1021520.7550796952720028841@ping.linuxembedded.co.uk>","Content-Language":"en-US","From":"Dan Scally <dan.scally@ideasonboard.com>","In-Reply-To":"<178359870164.1021520.7550796952720028841@ping.linuxembedded.co.uk>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]