[{"id":35860,"web_url":"https://patchwork.libcamera.org/comment/35860/","msgid":"<CAEmqJPo7jbMU92nM0nwXc1ACWrAk=h1GkELdPY95C1JtqyY9tA@mail.gmail.com>","date":"2025-09-17T15:25:43","subject":"Re: [PATCH v2 2/4] ipa: rpi: Add vd55g1 support for rpi","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Benjamin,\n\nThanks for the patch.\n\nOn Wed, 17 Sept 2025 at 14:42, Benjamin Mugnier <\nbenjamin.mugnier@foss.st.com> wrote:\n\n> The cam_helper gain formula and frameIntegrationDiff can be found in the\n> vd55g1 user manual.\n>\n> Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com>\n>\n\nAcked-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n> ---\n>  src/ipa/rpi/cam_helper/cam_helper_vd55g1.cpp | 49\n> ++++++++++++++++++++++++++++\n>  src/ipa/rpi/cam_helper/meson.build           |  1 +\n>  2 files changed, 50 insertions(+)\n>\n> diff --git a/src/ipa/rpi/cam_helper/cam_helper_vd55g1.cpp\n> b/src/ipa/rpi/cam_helper/cam_helper_vd55g1.cpp\n> new file mode 100644\n> index\n> 0000000000000000000000000000000000000000..7a262e2332f3039b1fd35330abfb91099ff0e21e\n> --- /dev/null\n> +++ b/src/ipa/rpi/cam_helper/cam_helper_vd55g1.cpp\n> @@ -0,0 +1,49 @@\n> +/* SPDX-License-Identifier: BSD-2-Clause */\n> +/*\n> + * Copyright (C) STMicroelectronics SA 2025\n> + *\n> + * Camera information for vd55g1 sensor\n> + */\n> +\n> +#include <assert.h>\n> +\n> +#include \"cam_helper.h\"\n> +\n> +using namespace RPiController;\n> +\n> +class CamHelperVd55g1 : public CamHelper\n> +{\n> +public:\n> +       CamHelperVd55g1();\n> +       uint32_t gainCode(double gain) const override;\n> +       double gain(uint32_t gainCode) const override;\n> +\n> +private:\n> +       /*\n> +        * Smallest difference between the frame length and integration\n> time,\n> +        * in units of lines.\n> +        */\n> +       static constexpr int frameIntegrationDiff = 64;\n> +};\n> +\n> +CamHelperVd55g1::CamHelperVd55g1()\n> +       : CamHelper({}, frameIntegrationDiff)\n> +{\n> +}\n> +\n> +uint32_t CamHelperVd55g1::gainCode(double gain) const\n> +{\n> +       return static_cast<uint32_t>(32.0 - 32.0 / gain);\n> +}\n> +\n> +double CamHelperVd55g1::gain(uint32_t gainCode) const\n> +{\n> +       return 32.0 / (32.0 - static_cast<double>(gainCode));\n> +}\n> +\n> +static CamHelper *create()\n> +{\n> +       return new CamHelperVd55g1();\n> +}\n> +\n> +static RegisterCamHelper reg(\"vd55g1\", &create);\n> diff --git a/src/ipa/rpi/cam_helper/meson.build\n> b/src/ipa/rpi/cam_helper/meson.build\n> index\n> b70acbee5fcaa94265da1f1ad75487563486679f..87b6a3600b18b5d380a9007f92cc620bfbafb830\n> 100644\n> --- a/src/ipa/rpi/cam_helper/meson.build\n> +++ b/src/ipa/rpi/cam_helper/meson.build\n> @@ -14,6 +14,7 @@ rpi_ipa_cam_helper_sources = files([\n>      'cam_helper_ov64a40.cpp',\n>      'cam_helper_ov7251.cpp',\n>      'cam_helper_ov9281.cpp',\n> +    'cam_helper_vd55g1.cpp',\n>      'cam_helper_vd56g3.cpp',\n>      'md_parser_smia.cpp',\n>  ])\n>\n> --\n> 2.25.1\n>\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 4A6F0BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Sep 2025 15:26:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0446169369;\n\tWed, 17 Sep 2025 17:26:23 +0200 (CEST)","from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com\n\t[IPv6:2607:f8b0:4864:20::e2e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8FCC269367\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Sep 2025 17:26:20 +0200 (CEST)","by mail-vs1-xe2e.google.com with SMTP id\n\tada2fe7eead31-533e41c387bso397021137.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Sep 2025 08:26:20 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"M6V4Mmfl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1758122779; x=1758727579;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=rmZ4BaBU9OKeCheGNF2MezUZOefG74HvA8S/041mGJU=;\n\tb=M6V4MmflM2Q/+ARc765HFpna9yp9ErQCdv5JfcldfeXFZ1K1SmJMMOuSDJmrW6Ch/W\n\tnTaFxT7wJ/dzzloWf64CujD6nrGCNaJu7cHV7olYPtzKjUCRNA6AFqBGQwa5CcjYh4Cp\n\t8RGNUM+zgxHDq7g014mfikkhsMr10M7kckoMQEzx9oqoWWsRRyET+kRjJ5nQ4N6LJY4p\n\tI7dGWVRElfbaBEo2XscbGIofMRB7IxRQrrO9tWaX/93pQKvuK7HZjaDs0d/IsOsZLXH6\n\tyQdPxp2o7KDOa7FNCzNDpZZe8IfmXTJxUflbpjhz3W54TqiMqM5WISZiH3w862f7BMzb\n\tnatQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1758122779; x=1758727579;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=rmZ4BaBU9OKeCheGNF2MezUZOefG74HvA8S/041mGJU=;\n\tb=tGeKxD6OHy+uPXWRRsQzj1m+ItHSJZZLAkqlFz//sUN5EfB6MfnQ1FaY3CZx9+cUFM\n\tS/vU0oOAuuBHI9sNSbvntctIoOtu0oFKZbdNkeoiYC1hQRnoJ5ml8wWwJ3Ov1PHyAoNW\n\tuR6DXx3DNVZJGGCopqE1xPIVF/QF9qcqDHRjDqpEOuQ8WU3nFX4jIyuDOVHzUnYOjpH6\n\tZoaMayZGfeLraVg1hDdmevQHSwfhWYBJ/KndRG7EHm3uJYxvIUsLl42fkI9lCSv9Fnat\n\td2URZ2mGnZNU/yGob7SMqdLv/dTJtDMaJ/W3htsfozv2+yUA/aABc8L++HLvCq83703U\n\tNi8g==","X-Gm-Message-State":"AOJu0Yzap7qQMdCNazw4doqHEvLe++1AZeLnBwNaiSZ7/wHpijWeuIqH\n\t75oQ0S/Vr/+FUSlr9Q0JTzZuEw4NqMI+1zDrt3BxVVZuedM7xTQIE2+bu7AalieTgRXtHQswKpe\n\t2sgnNYzaGKwNDueptRawCAzwiI4xx+hvumJPiEtl43hnNL0s17I3d","X-Gm-Gg":"ASbGnct2i6ocqcN/d5AMxOx1qHEUJrcI05ysZbl9kFAVvhMRDdnnAyHBTotU9fT1Fxp\n\t18O6fMKUFqRjqKKPBcou1Apgm26sKZXq55uEqa9uv6kPPz0ToGVKx3zGGHnzfMi1h/S2R44iZL4\n\tM/uSjaB1DwZrVbWBzO5lXuzUItHMVAZpMAff5RAxRX2hiSVyJTk5tKDk7d1d1yTrlGWIqQ5mPe/\n\tREfl/gVdKBVr/U=","X-Google-Smtp-Source":"AGHT+IHKNS462Ssl+oRr8sgZKpZ8rEQmeHoxeIBGCMbbc7kjV4zp1eoJnE7+cxTG8Y1xCFcD3J6cQyaPH5J8Etah+8E=","X-Received":"by 2002:a05:6102:3f47:b0:4ec:c513:f20 with SMTP id\n\tada2fe7eead31-56d67e503ccmr346070137.5.1758122779116; Wed, 17 Sep 2025\n\t08:26:19 -0700 (PDT)","MIME-Version":"1.0","References":"<20250917-vd55g1_support-v2-0-101b53b66add@foss.st.com>\n\t<20250917-vd55g1_support-v2-2-101b53b66add@foss.st.com>","In-Reply-To":"<20250917-vd55g1_support-v2-2-101b53b66add@foss.st.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Wed, 17 Sep 2025 16:25:43 +0100","X-Gm-Features":"AS18NWDQtRzUgHWIJTiVZwQSUMC3M7BKKlQ7888KHqoPIsp-WeHw5Y77H4OWRs0","Message-ID":"<CAEmqJPo7jbMU92nM0nwXc1ACWrAk=h1GkELdPY95C1JtqyY9tA@mail.gmail.com>","Subject":"Re: [PATCH v2 2/4] ipa: rpi: Add vd55g1 support for rpi","To":"Benjamin Mugnier <benjamin.mugnier@foss.st.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>, \n\tSylvain Petinot <sylvain.petinot@foss.st.com>","Content-Type":"multipart/alternative; boundary=\"000000000000b8a555063f00dbad\"","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>"}}]