[{"id":31102,"web_url":"https://patchwork.libcamera.org/comment/31102/","msgid":"<172561993407.129190.16146704015744653100@ping.linuxembedded.co.uk>","date":"2024-09-06T10:52:14","subject":"Re: [PATCH] libcamera: libipa: camera_sensor: Add Sony IMX214 sensor\n\tproperties","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi André,\n\nQuoting André Apitzsch (2024-09-05 21:47:46)\n> Provide the Sony IMX214 camera sensor properties and registration with\n> libipa for the gain code helpers.\n\nThanks for your continued work on upstream on this! I see an interesting\nseries on the kernel for this too which looks great from a first glance.\n\n> \n> Signed-off-by: André Apitzsch <git@apitzsch.eu>\n> ---\n>  src/ipa/libipa/camera_sensor_helper.cpp           | 13 +++++++++++++\n>  src/libcamera/sensor/camera_sensor_properties.cpp | 10 ++++++++++\n>  2 files changed, 23 insertions(+)\n> \n> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> index ffc7c1d7..f3289b1c 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> @@ -519,6 +519,19 @@ private:\n>  };\n>  REGISTER_CAMERA_SENSOR_HELPER(\"ar0521\", CameraSensorHelperAr0521)\n>  \n> +class CameraSensorHelperImx214 : public CameraSensorHelper\n> +{\n> +public:\n> +       CameraSensorHelperImx214()\n> +       {\n> +               /* From datasheet: 64 at 10bits. */\n> +               blackLevel_ = 4096;\n\nI can't quite determine from the datasheet if this is 0x40 at 10 bit or\n0x40 at 8 bit. But I believe this is reasonable until we determine\notherwise.\n\n\n> +               gainType_ = AnalogueGainLinear;\n\nThe datasheet states:\n\n\tAnalog Gain 18dB (24dB)*\n\tDigital Gain 24dB\n\n* When AD input is doubled for vertical analog addition-average mode, analog gain can be set up to 24dB.\n\nI'm curious if that will need any special handling ... but I don't think\nwe need to worry about that yet. I presume it will be exposed by the\nkernel adjusting the min/max values for the control.\n\n\n> +               gainConstants_.linear = { 0, 512, -1, 512 };\n\nAnd this matches the reference manual.\n\n\n> +       }\n> +};\n> +REGISTER_CAMERA_SENSOR_HELPER(\"imx214\", CameraSensorHelperImx214)\n> +\n>  class CameraSensorHelperImx219 : public CameraSensorHelper\n>  {\n>  public:\n> diff --git a/src/libcamera/sensor/camera_sensor_properties.cpp b/src/libcamera/sensor/camera_sensor_properties.cpp\n> index 4e5217ab..6d4136d0 100644\n> --- a/src/libcamera/sensor/camera_sensor_properties.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_properties.cpp\n> @@ -88,6 +88,16 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen\n>                                  */\n>                         },\n>                 } },\n> +               { \"imx214\", {\n> +                       .unitCellSize = { 1120, 1120 },\n\nAck\n\n> +                       .testPatternModes = {\n> +                               { controls::draft::TestPatternModeOff, 0 },\n> +                               { controls::draft::TestPatternModeColorBars, 1 },\n> +                               { controls::draft::TestPatternModeSolidColor, 2 },\n> +                               { controls::draft::TestPatternModeColorBarsFadeToGray, 3 },\n> +                               { controls::draft::TestPatternModePn9, 4 },\n\nThis (unsurpisingly) appears to match your additions to the driver ;-)\n\nThank you!\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n> +                       },\n> +               } },\n>                 { \"imx219\", {\n>                         .unitCellSize = { 1120, 1120 },\n>                         .testPatternModes = {\n> \n> ---\n> base-commit: f75b8dd26feaca86701704390dea18c71e2f0350\n> change-id: 20240905-imx214-796939bd453c\n> \n> Best regards,\n> -- \n> André Apitzsch <git@apitzsch.eu>\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 7A988BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Sep 2024 10:52:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9C2E7634E3;\n\tFri,  6 Sep 2024 12:52:18 +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 6DD81633CC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Sep 2024 12:52:17 +0200 (CEST)","from pendragon.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 4D62C8A9;\n\tFri,  6 Sep 2024 12:51:03 +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=\"IdXUdnlc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725619863;\n\tbh=kSgs6PGeupZW3PQ9gPNuOxE+2dzB61VFMWSgfhf60RY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=IdXUdnlc7x1tUlcAAYI4/WTXeQrogkjUrdZHdbORX5uVAvUNwilN2uiqAUVpNFW3x\n\te/SaowIJ8m3R7hzmyEgqniNN8HMFK0UMrFG4+0wSgTVrrZiCl7ulW6Li3GpmmBTlIA\n\tstXrqHY+80BrvLnv9ITnq58r9t2qre52oJfgttW8=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240905-imx214-v1-1-740caf6fb0a9@apitzsch.eu>","References":"<20240905-imx214-v1-1-740caf6fb0a9@apitzsch.eu>","Subject":"Re: [PATCH] libcamera: libipa: camera_sensor: Add Sony IMX214 sensor\n\tproperties","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"=?utf-8?b?QW5kcsOp?= Apitzsch <git@apitzsch.eu>","To":"=?utf-8?b?QW5kcsOp?= Apitzsch <git@apitzsch.eu>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 06 Sep 2024 11:52:14 +0100","Message-ID":"<172561993407.129190.16146704015744653100@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]