[{"id":21470,"web_url":"https://patchwork.libcamera.org/comment/21470/","msgid":"<YaaeJd4RGoEbcTQO@pendragon.ideasonboard.com>","date":"2021-11-30T21:56:53","subject":"Re: [libcamera-devel] [PATCH 1/2] libipa: Add CameraSensorHelper\n\tfor ov2680","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Daniel,\n\nThank you for the patch.\n\nOn Tue, Nov 30, 2021 at 09:34:10PM +0000, Daniel Scally wrote:\n> Add a CameraSensorHelperOv2680 class. The OV2680 is found in concert\n> with an IPU3 on the Lenovo Miix 510. The constants set are a bit of a\n> guess, as the datasheet doesn't document the gain control field any\n> further than giving its width in bits, but the default is 0x10 so we\n> assume that to be 1x gain.\n\nWould you be able to test if the gain is linear by capturing images\nwith, for instance, gains set to 16, 32, 48 and 64 and see if the\naverage relative luminance increases linearly ?\n\n> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> ---\n>  src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++\n>  1 file changed, 10 insertions(+)\n> \n> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> index 0b0eb503..fd951505 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> @@ -305,6 +305,16 @@ public:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"imx258\", CameraSensorHelperImx258)\n>  \n> +class CameraSensorHelperOv2680 : public CameraSensorHelper\n> +{\n> +public:\n> +\tCameraSensorHelperOv2680()\n> +\t{\n> +\t\tanalogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 16 };\n> +\t}\n> +};\n> +REGISTER_CAMERA_SENSOR_HELPER(\"ov2680\", CameraSensorHelperOv2680)\n> +\n>  class CameraSensorHelperOv5670 : public CameraSensorHelper\n>  {\n>  public:","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 112C6BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 21:57:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3EF7260720;\n\tTue, 30 Nov 2021 22:57:20 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6AAF2605C4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 22:57:18 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 81ECDEE;\n\tTue, 30 Nov 2021 22:57:17 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"uPFUYkzL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638309437;\n\tbh=0zYu1FEz9uDf+VUZ7+d11mQNFcnGEGP6qrCMA0r5soQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uPFUYkzLtadXwCB90cvqIXRsmZOzpe/evwgWRsmsYftvFRyeLVKAKCkCQBFs6EryV\n\ttFZBpJIQzcREOs5y0FzBGFcr0a1emCTcmznwpz8i/zA90eL6QHiXeADs4Gf5VP8R70\n\tnYJDYVECOxBIfmX86mYjF4Ztx3gN2Q534C6GqrSk=","Date":"Tue, 30 Nov 2021 23:56:53 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<YaaeJd4RGoEbcTQO@pendragon.ideasonboard.com>","References":"<20211130213411.20149-1-djrscally@gmail.com>\n\t<20211130213411.20149-2-djrscally@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211130213411.20149-2-djrscally@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 1/2] libipa: Add CameraSensorHelper\n\tfor ov2680","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21472,"web_url":"https://patchwork.libcamera.org/comment/21472/","msgid":"<f4ae3a52-bd49-b99b-669f-f732a0d2a83c@gmail.com>","date":"2021-11-30T22:09:18","subject":"Re: [libcamera-devel] [PATCH 1/2] libipa: Add CameraSensorHelper\n\tfor ov2680","submitter":{"id":90,"url":"https://patchwork.libcamera.org/api/people/90/","name":"Daniel Scally","email":"djrscally@gmail.com"},"content":"Hi Laurent\n\nOn 30/11/2021 21:56, Laurent Pinchart wrote:\n> Hi Daniel,\n> \n> Thank you for the patch.\n> \n> On Tue, Nov 30, 2021 at 09:34:10PM +0000, Daniel Scally wrote:\n>> Add a CameraSensorHelperOv2680 class. The OV2680 is found in concert\n>> with an IPU3 on the Lenovo Miix 510. The constants set are a bit of a\n>> guess, as the datasheet doesn't document the gain control field any\n>> further than giving its width in bits, but the default is 0x10 so we\n>> assume that to be 1x gain.\n> \n> Would you be able to test if the gain is linear by capturing images\n> with, for instance, gains set to 16, 32, 48 and 64 and see if the\n> average relative luminance increases linearly ?\n\nSure; judging by eye you mean, or something more sophisticated?\n> \n>> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n>> ---\n>>  src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++\n>>  1 file changed, 10 insertions(+)\n>>\n>> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n>> index 0b0eb503..fd951505 100644\n>> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n>> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n>> @@ -305,6 +305,16 @@ public:\n>>  };\n>>  REGISTER_CAMERA_SENSOR_HELPER(\"imx258\", CameraSensorHelperImx258)\n>>  \n>> +class CameraSensorHelperOv2680 : public CameraSensorHelper\n>> +{\n>> +public:\n>> +\tCameraSensorHelperOv2680()\n>> +\t{\n>> +\t\tanalogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 16 };\n>> +\t}\n>> +};\n>> +REGISTER_CAMERA_SENSOR_HELPER(\"ov2680\", CameraSensorHelperOv2680)\n>> +\n>>  class CameraSensorHelperOv5670 : public CameraSensorHelper\n>>  {\n>>  public:\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 1C03FBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 22:09:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C8E4B60720;\n\tTue, 30 Nov 2021 23:09:21 +0100 (CET)","from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4C2B3605C4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 23:09:20 +0100 (CET)","by mail-wr1-x42f.google.com with SMTP id i5so47621054wrb.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 14:09:20 -0800 (PST)","from [192.168.0.16]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\to3sm4189502wms.10.2021.11.30.14.09.19\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 30 Nov 2021 14:09:19 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Y75qBXTH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=/4RoTiK7H4bXPMXWVBFBsE4LXu8eU6i/u8r9UWA0G10=;\n\tb=Y75qBXTHqNqlWh37UOws22X79Nhl2Es717N4ayyCoUAuqDmARyc7Gge3Ur3j05yQJ/\n\ttTA/d4duW8xundLd67jm8h7t4fbJetIq/cFixUNYCAp0dFglX7ORkGUcn+E7ERE9jR9F\n\tmuSdBDhdXyhRk9ReHYs3UxncQO6SOWLenoJBMpWCexOv/6PctZnmLJpl9jAv2DG20m16\n\t0HpfzLkrS2K5keyw5PUiFHZcTeFlx8vs8fRtOOreo33wnjc/saBp8Bl3ABHN1BYu+AUw\n\trpCdzyKQbqKOUBBwXoMWzAdjDHRF7eQzxnMxXjvJjNP5xoqC6YmHQazA1DgTmH/LwjbQ\n\t/alQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=/4RoTiK7H4bXPMXWVBFBsE4LXu8eU6i/u8r9UWA0G10=;\n\tb=RRh0XYNb8mmVoOAx6HiDyH0aznziStRbLkDp6ZESr/KZLMHcNA5RjTQskNWWp52I3G\n\toN7ke5maZxixz4EDDE/nlMvPrVa5+v9bMLGRgxky0f0ktcSXbk4Z6kuSMGzS3/UD9QWa\n\tN9DOgWa6dBU3EybhKv1VO80Gyzut90vgnvSiE9csOFbr09iBv9m7zli1YnJgXtZl32lT\n\t+Q3m+M8tOiXyLRIUQSCgOCmaO75ED9hnQaUL9UQP9G8rFRX+CJe5NcwUKW5wjrk+L5RB\n\t+s9t1mv/fxLe+oDM/LvuPhDbfyL3En08dt/442b/GEF43QQ8K82zK6yRLnp2/CZhsMz5\n\txUCQ==","X-Gm-Message-State":"AOAM531mdKfKwACWkr/t6xaBZC1Kcfm7PVbw4BqHLt5weh60jNrFvlso\n\tYIgj42Edr2jaKH4rXSXgZiRHTm/2wgI=","X-Google-Smtp-Source":"ABdhPJz5jjvkG1HlkK6PxVe3MsFN58fRbORNHCN5WA61/KlpsjaI4NiG25x3kfT7V4Pvur9p3Aw0Xw==","X-Received":"by 2002:adf:82d3:: with SMTP id 77mr1872088wrc.377.1638310159987;\n\tTue, 30 Nov 2021 14:09:19 -0800 (PST)","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20211130213411.20149-1-djrscally@gmail.com>\n\t<20211130213411.20149-2-djrscally@gmail.com>\n\t<YaaeJd4RGoEbcTQO@pendragon.ideasonboard.com>","From":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<f4ae3a52-bd49-b99b-669f-f732a0d2a83c@gmail.com>","Date":"Tue, 30 Nov 2021 22:09:18 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.14.0","MIME-Version":"1.0","In-Reply-To":"<YaaeJd4RGoEbcTQO@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 1/2] libipa: Add CameraSensorHelper\n\tfor ov2680","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21474,"web_url":"https://patchwork.libcamera.org/comment/21474/","msgid":"<YaaojMNnKkb3L+sY@pendragon.ideasonboard.com>","date":"2021-11-30T22:41:16","subject":"Re: [libcamera-devel] [PATCH 1/2] libipa: Add CameraSensorHelper\n\tfor ov2680","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Daniel,\n\nOn Tue, Nov 30, 2021 at 10:09:18PM +0000, Daniel Scally wrote:\n> On 30/11/2021 21:56, Laurent Pinchart wrote:\n> > On Tue, Nov 30, 2021 at 09:34:10PM +0000, Daniel Scally wrote:\n> >> Add a CameraSensorHelperOv2680 class. The OV2680 is found in concert\n> >> with an IPU3 on the Lenovo Miix 510. The constants set are a bit of a\n> >> guess, as the datasheet doesn't document the gain control field any\n> >> further than giving its width in bits, but the default is 0x10 so we\n> >> assume that to be 1x gain.\n> > \n> > Would you be able to test if the gain is linear by capturing images\n> > with, for instance, gains set to 16, 32, 48 and 64 and see if the\n> > average relative luminance increases linearly ?\n> \n> Sure; judging by eye you mean, or something more sophisticated?\n\nAveraging the pixel values in the image would be better. You should try\nto keep the scene luminance constant, and set the exposure time so that\na gain of 64 will be a below saturation (80% of the range would be good\nfor instance).\n\n> >> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> >> ---\n> >>  src/ipa/libipa/camera_sensor_helper.cpp | 10 ++++++++++\n> >>  1 file changed, 10 insertions(+)\n> >>\n> >> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> >> index 0b0eb503..fd951505 100644\n> >> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> >> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> >> @@ -305,6 +305,16 @@ public:\n> >>  };\n> >>  REGISTER_CAMERA_SENSOR_HELPER(\"imx258\", CameraSensorHelperImx258)\n> >>  \n> >> +class CameraSensorHelperOv2680 : public CameraSensorHelper\n> >> +{\n> >> +public:\n> >> +\tCameraSensorHelperOv2680()\n> >> +\t{\n> >> +\t\tanalogueGainConstants_ = { AnalogueGainLinear, 1, 0, 0, 16 };\n> >> +\t}\n> >> +};\n> >> +REGISTER_CAMERA_SENSOR_HELPER(\"ov2680\", CameraSensorHelperOv2680)\n> >> +\n> >>  class CameraSensorHelperOv5670 : public CameraSensorHelper\n> >>  {\n> >>  public:","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 8ABD6BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Nov 2021 22:41:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DE34960720;\n\tTue, 30 Nov 2021 23:41:42 +0100 (CET)","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 A7119605C4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Nov 2021 23:41:41 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 03ACC8F0;\n\tTue, 30 Nov 2021 23:41:40 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"N+KGvN3Y\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1638312101;\n\tbh=4O72cBigiECmEt42I4rjtGEIJptMES++cnB/4VOdqbo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=N+KGvN3Yqm3Jj0J5EQsDLSzubcuiZIQxhsDmde9hLgvm4czeLkeasvf1YjFrmERYO\n\t8Tn08GqyqWuDuqqbzAA5qGJdPnfXd7DfmSmzReP7a0184rsF28edN/jPLSAJgvVJQt\n\tJNT9HJPBYIS91GR8M7jZHMD5aAN3WQWBefHK4q7w=","Date":"Wed, 1 Dec 2021 00:41:16 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<YaaojMNnKkb3L+sY@pendragon.ideasonboard.com>","References":"<20211130213411.20149-1-djrscally@gmail.com>\n\t<20211130213411.20149-2-djrscally@gmail.com>\n\t<YaaeJd4RGoEbcTQO@pendragon.ideasonboard.com>\n\t<f4ae3a52-bd49-b99b-669f-f732a0d2a83c@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<f4ae3a52-bd49-b99b-669f-f732a0d2a83c@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 1/2] libipa: Add CameraSensorHelper\n\tfor ov2680","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]