[{"id":17698,"web_url":"https://patchwork.libcamera.org/comment/17698/","msgid":"<CAEmqJPrEuw1wyx=tT9zu_bPLr=PWjVQ4T2DiaZvoLP9BosYeBQ@mail.gmail.com>","date":"2021-06-22T13:30:51","subject":"Re: [libcamera-devel] [PATCH v2 0/2] Raspberry Pi: Metadata parsing\n\timprovements (II)","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Tue, 22 Jun 2021 at 14:20, Naushir Patuck <naush@raspberrypi.com> wrote:\n\n> Hi,\n>\n> Here is version 2 of this series.  The following changes have been\n> introduced\n> over v1:\n>\n> - Rework patch 1/2 to use a unique_ptr to store the parser object in the\n> CamHelper class.\n> - Switch to using std::initialiser_list in the constructor of MdParserSmia.\n> - All suggestions from Laurent's feedback have been addressed in patch 2/2.\n>\n> The constructor for the unique_ptr<MdParserSmia> in patch 2/2 looks a bit\n> awkward now since I have to explicitly write std::initialiser_list within\n> std::make_unique, but I cannot see nice way around this.\n>\n\nSomething like the following could arguably be neater, but functionally\nequivalent in patch 2/2:\n\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp\nb/src/ipa/raspberrypi/cam_helper_imx219.cpp\nindex 18f5c3e7e520..bd42536085d9 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n@@ -30,6 +30,7 @@ using namespace RPiController;\n constexpr uint32_t gainReg = 0x157;\n constexpr uint32_t expHiReg = 0x15a;\n constexpr uint32_t expLoReg = 0x15b;\n+constexpr std::initializer_list<uint32_t> registerList = { expHiReg,\nexpLoReg, gainReg };\n\n class CamHelperImx219 : public CamHelper\n {\n@@ -53,9 +54,7 @@ private:\n\n CamHelperImx219::CamHelperImx219()\n #if ENABLE_EMBEDDED_DATA\n-       : CamHelper(std::make_unique<MdParserSmia>\n-                       (std::initializer_list<uint32_t>({ expHiReg,\nexpLoReg, gainReg })),\n-                   frameIntegrationDiff)\n+       : CamHelper(std::make_unique<MdParserSmia>(registerList),\nframeIntegrationDiff)\n #else\n        : CamHelper({}, frameIntegrationDiff)\n #endif\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp\nb/src/ipa/raspberrypi/cam_helper_imx477.cpp\nindex 8869af6620cf..4c7f7fd9561b 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n@@ -23,6 +23,7 @@ constexpr uint32_t expHiReg = 0x0202;\n constexpr uint32_t expLoReg = 0x0203;\n constexpr uint32_t gainHiReg = 0x0204;\n constexpr uint32_t gainLoReg = 0x0205;\n+constexpr std::initializer_list<uint32_t> registerList = { expHiReg,\nexpLoReg, gainHiReg, gainLoReg };\n\n class CamHelperImx477 : public CamHelper\n {\n@@ -46,9 +47,7 @@ private:\n };\n\n CamHelperImx477::CamHelperImx477()\n-       : CamHelper(std::make_unique<MdParserSmia>\n-                       (std::initializer_list<uint32_t>({ expHiReg,\nexpLoReg, gainHiReg, gainLoReg })),\n-                   frameIntegrationDiff)\n+       : CamHelper(std::make_unique<MdParserSmia>(registerList),\nframeIntegrationDiff)\n {\n }\n\nIf folks think this is better, I am happy to change it.\n\nNaush\n\n\n\n>\n> I have removed all previous tags from 1/2, as this is a completely\n> different\n> approach to the previous revision.\n>\n> Thanks,\n> Naush\n>\n> Naushir Patuck (2):\n>   ipa: raspberrypi: Use a unique_ptr for the metadata parser\n>   ipa: raspberrypi: Generalise the SMIA metadata parser\n>\n>  src/ipa/raspberrypi/cam_helper.cpp        |  38 ++++---\n>  src/ipa/raspberrypi/cam_helper.hpp        |   7 +-\n>  src/ipa/raspberrypi/cam_helper_imx219.cpp | 117 ++++----------------\n>  src/ipa/raspberrypi/cam_helper_imx290.cpp |   2 +-\n>  src/ipa/raspberrypi/cam_helper_imx477.cpp | 123 ++++------------------\n>  src/ipa/raspberrypi/cam_helper_ov5647.cpp |   2 +-\n>  src/ipa/raspberrypi/md_parser.hpp         |  42 +++++---\n>  src/ipa/raspberrypi/md_parser_smia.cpp    |  66 ++++++++++--\n>  8 files changed, 155 insertions(+), 242 deletions(-)\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 D9F53C321A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Jun 2021 13:31:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1916068935;\n\tTue, 22 Jun 2021 15:31:09 +0200 (CEST)","from mail-lf1-x129.google.com (mail-lf1-x129.google.com\n\t[IPv6:2a00:1450:4864:20::129])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C103860292\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jun 2021 15:31:07 +0200 (CEST)","by mail-lf1-x129.google.com with SMTP id a11so22934840lfg.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jun 2021 06:31:07 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"futPg4+9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to;\n\tbh=YWSvDGJH+8LSFdImEu2ECxrS4cHH82wyg/sDElb+nQo=;\n\tb=futPg4+9nR2MMwIiD81GjK+G1HwXJNB2Vas5S//Le460NLto0R8h5OdGHtN7GCObG0\n\tn7lT16fvYKGPnntYG1cg8HfTXPmj9QPgxORZvV5VmRAiA4gUbHS4V+YPUAcXGHrQseAT\n\t0Z+mcWSdtETS9Mtf6ol+vl94u2ULczEK2Mbb7fzlvNZSySH9Ei02cCMK2keE4qh3YOmC\n\tmpxHAyYwJ/zrcp2n7/nctZcwymTpepGxkvG4k34f6DjBE+58/EIjvGohi1C78mgKDsJN\n\thoQxkXl1wX1nkqdHnAPJ76XYBYe2WHv39M93/ITn4rFHNyYPks26uF6db3oflHtiooFW\n\txjQg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to;\n\tbh=YWSvDGJH+8LSFdImEu2ECxrS4cHH82wyg/sDElb+nQo=;\n\tb=r6sBNpXzT8kW5gAc38UCU04y23gbu/9M4wtGtE/Xdm626QVaHjPsWvgP5Ltj+biGFz\n\tNZm3mCUrAfkAMOzzw92iFPnouSpc9Duuy2Jh91zxUNX/PnCJfhra7obnLDP2l5FGCMSV\n\ttmY6lpHQ7kc7STszpZxxRTFOv67xJUyDKA0lflHcOnaKFpPVrWxFlGRxo4G24Sl7cDJK\n\ttp8FkazMuwP+2GIPwPr+NEph7joE7ZV3TOiRMFkfEbcFLGTO0iBNFSD10RcsHeayNfui\n\tf5lTgLchA52BQOJY4x/o0jzKNzWc6C0YEQ+j502aOq8DYzb5lBdyAWVrPumFF0Lbm6K1\n\tc7AA==","X-Gm-Message-State":"AOAM530ZIVLQQOwzuLS9gHLLacgIx6C9P1T78Jeucafbe07fSJ5xfxXS\n\tCvdFxmXeaIl5fNxN60uRpbZ+Om90/CcHZXjvpNSWw0CGRmAWGQ==","X-Google-Smtp-Source":"ABdhPJylip/PufhDi8fkGasXIvIRqlxcyNY1XIzFlCnWyx0YLkA+dGqSPH0UN9LqH660x/dmAt3UZt8csPO+kgQ5EDc=","X-Received":"by 2002:ac2:4d8f:: with SMTP id\n\tg15mr2846503lfe.133.1624368666977; \n\tTue, 22 Jun 2021 06:31:06 -0700 (PDT)","MIME-Version":"1.0","References":"<20210622132014.949961-1-naush@raspberrypi.com>","In-Reply-To":"<20210622132014.949961-1-naush@raspberrypi.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 22 Jun 2021 14:30:51 +0100","Message-ID":"<CAEmqJPrEuw1wyx=tT9zu_bPLr=PWjVQ4T2DiaZvoLP9BosYeBQ@mail.gmail.com>","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"multipart/alternative; boundary=\"000000000000613ce805c55acdbe\"","Subject":"Re: [libcamera-devel] [PATCH v2 0/2] Raspberry Pi: Metadata parsing\n\timprovements (II)","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":17700,"web_url":"https://patchwork.libcamera.org/comment/17700/","msgid":"<CAHW6GYKB-vuoZDXUS9p4f4Rwa=YdxcWV15Ap8Mq7cvd5CZtTqg@mail.gmail.com>","date":"2021-06-22T14:25:52","subject":"Re: [libcamera-devel] [PATCH v2 0/2] Raspberry Pi: Metadata parsing\n\timprovements (II)","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi again Naush\n\nOn Tue, 22 Jun 2021 at 14:31, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n>\n>\n> On Tue, 22 Jun 2021 at 14:20, Naushir Patuck <naush@raspberrypi.com> wrote:\n>>\n>> Hi,\n>>\n>> Here is version 2 of this series.  The following changes have been introduced\n>> over v1:\n>>\n>> - Rework patch 1/2 to use a unique_ptr to store the parser object in the\n>> CamHelper class.\n>> - Switch to using std::initialiser_list in the constructor of MdParserSmia.\n>> - All suggestions from Laurent's feedback have been addressed in patch 2/2.\n>>\n>> The constructor for the unique_ptr<MdParserSmia> in patch 2/2 looks a bit\n>> awkward now since I have to explicitly write std::initialiser_list within\n>> std::make_unique, but I cannot see nice way around this.\n>\n>\n> Something like the following could arguably be neater, but functionally equivalent in patch 2/2:\n>\n> diff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> index 18f5c3e7e520..bd42536085d9 100644\n> --- a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> +++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> @@ -30,6 +30,7 @@ using namespace RPiController;\n>  constexpr uint32_t gainReg = 0x157;\n>  constexpr uint32_t expHiReg = 0x15a;\n>  constexpr uint32_t expLoReg = 0x15b;\n> +constexpr std::initializer_list<uint32_t> registerList = { expHiReg, expLoReg, gainReg };\n>\n>  class CamHelperImx219 : public CamHelper\n>  {\n> @@ -53,9 +54,7 @@ private:\n>\n>  CamHelperImx219::CamHelperImx219()\n>  #if ENABLE_EMBEDDED_DATA\n> -       : CamHelper(std::make_unique<MdParserSmia>\n> -                       (std::initializer_list<uint32_t>({ expHiReg, expLoReg, gainReg })),\n> -                   frameIntegrationDiff)\n> +       : CamHelper(std::make_unique<MdParserSmia>(registerList), frameIntegrationDiff)\n>  #else\n>         : CamHelper({}, frameIntegrationDiff)\n>  #endif\n> diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> index 8869af6620cf..4c7f7fd9561b 100644\n> --- a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> +++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> @@ -23,6 +23,7 @@ constexpr uint32_t expHiReg = 0x0202;\n>  constexpr uint32_t expLoReg = 0x0203;\n>  constexpr uint32_t gainHiReg = 0x0204;\n>  constexpr uint32_t gainLoReg = 0x0205;\n> +constexpr std::initializer_list<uint32_t> registerList = { expHiReg, expLoReg, gainHiReg, gainLoReg };\n>\n>  class CamHelperImx477 : public CamHelper\n>  {\n> @@ -46,9 +47,7 @@ private:\n>  };\n>\n>  CamHelperImx477::CamHelperImx477()\n> -       : CamHelper(std::make_unique<MdParserSmia>\n> -                       (std::initializer_list<uint32_t>({ expHiReg, expLoReg, gainHiReg, gainLoReg })),\n> -                   frameIntegrationDiff)\n> +       : CamHelper(std::make_unique<MdParserSmia>(registerList), frameIntegrationDiff)\n>  {\n>  }\n>\n> If folks think this is better, I am happy to change it.\n\nPossibly, but I can't really get sufficiently worked up over it to\nwarrant a new patch set... :)\n\nDavid\n\n>\n> Naush\n>\n>\n>>\n>>\n>> I have removed all previous tags from 1/2, as this is a completely different\n>> approach to the previous revision.\n>>\n>> Thanks,\n>> Naush\n>>\n>> Naushir Patuck (2):\n>>   ipa: raspberrypi: Use a unique_ptr for the metadata parser\n>>   ipa: raspberrypi: Generalise the SMIA metadata parser\n>>\n>>  src/ipa/raspberrypi/cam_helper.cpp        |  38 ++++---\n>>  src/ipa/raspberrypi/cam_helper.hpp        |   7 +-\n>>  src/ipa/raspberrypi/cam_helper_imx219.cpp | 117 ++++----------------\n>>  src/ipa/raspberrypi/cam_helper_imx290.cpp |   2 +-\n>>  src/ipa/raspberrypi/cam_helper_imx477.cpp | 123 ++++------------------\n>>  src/ipa/raspberrypi/cam_helper_ov5647.cpp |   2 +-\n>>  src/ipa/raspberrypi/md_parser.hpp         |  42 +++++---\n>>  src/ipa/raspberrypi/md_parser_smia.cpp    |  66 ++++++++++--\n>>  8 files changed, 155 insertions(+), 242 deletions(-)\n>>\n>> --\n>> 2.25.1\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 07E3EC321B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Jun 2021 14:26:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5AAE260294;\n\tTue, 22 Jun 2021 16:26:05 +0200 (CEST)","from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 12BC760292\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jun 2021 16:26:03 +0200 (CEST)","by mail-wr1-x433.google.com with SMTP id f15so8467609wro.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jun 2021 07:26:03 -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=\"ZOe+E2Wd\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=ADG5GpIVEKrscD8I3wi90Hi35O5cL6UlYuUn0J+a2To=;\n\tb=ZOe+E2WdW2RFCLJEWpmeEf9Hf1bPcepHidzo2GUbdJ1JzskpbxBdB+Eh/f08Gsn4mm\n\t+VDLt/PeKbiCFGIS6humAZ6kjTXE+ucw23vcQ8jFWji6PgniX9I8vRpwzAuY3NXoMyMv\n\tp5ZE4mAx5spbQw+NRAk4fYH4npAxS006i2VJokUP4lY5+nWiEj0fQen3XqLmlwkPuI+M\n\tDO39cvHma4/p1A0RNBjtlHSgE/Ts0Gd8M/094CCsSrZZEz4ePWeh8+zLZZgwiwpaKkYC\n\t/SR9FuMKq/BMs0u2pQ60KzXZp0RDB5HZ/xgLlVPbUvgxneaOmicGfKsmbRgIDGdrm0Iz\n\tHjDw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=ADG5GpIVEKrscD8I3wi90Hi35O5cL6UlYuUn0J+a2To=;\n\tb=U3Y0099fhARO0TAMRD85VuKSCAJOLyumXdJqp81wAMF10YheCe/zxPTuTXNkcLzLZP\n\tDtR3LmLu3zgvAe3hifuRoyatHA3WoppPe7LXKiS96F2UzX8/ws1QHofpeRSCzsOz8Tfc\n\t6Xk2txTQDuI0LRj8PgAPS0mmJAKG+4JJ154A08X21Qm37pcq5LKDjB6OTC8D37Elosdk\n\tJFmQk6ueUTCKxAJLxWyXUEsGYM8705bEpi6IjIAUGnSqSm81BJ0bjhb31uXk4OighXXh\n\tjus/QFDsoglLj56JLBBLPVWOVXOz3VueVfkPA0M+k5+FWbQ57saOdHXFQR+Mj+K7XShO\n\tIp7Q==","X-Gm-Message-State":"AOAM530jqQELGOZwlnIsYQO533OT/RB8Kn3XmWvlLCXAHvWyh1eobPCr\n\t8cub19sOkBel5aMPW7RQCjUsck6mk3WxUFPZwbbY6A==","X-Google-Smtp-Source":"ABdhPJxyiY/LRPkMIVjum9tSM9UMk1LqzQeoChFImv621G2dVS61Sfa80PaY3dR08We1Jsn/U1WCjXxjoBACoeNNwCY=","X-Received":"by 2002:a5d:6412:: with SMTP id\n\tz18mr5216202wru.163.1624371962713; \n\tTue, 22 Jun 2021 07:26:02 -0700 (PDT)","MIME-Version":"1.0","References":"<20210622132014.949961-1-naush@raspberrypi.com>\n\t<CAEmqJPrEuw1wyx=tT9zu_bPLr=PWjVQ4T2DiaZvoLP9BosYeBQ@mail.gmail.com>","In-Reply-To":"<CAEmqJPrEuw1wyx=tT9zu_bPLr=PWjVQ4T2DiaZvoLP9BosYeBQ@mail.gmail.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Tue, 22 Jun 2021 15:25:52 +0100","Message-ID":"<CAHW6GYKB-vuoZDXUS9p4f4Rwa=YdxcWV15Ap8Mq7cvd5CZtTqg@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 0/2] Raspberry Pi: Metadata parsing\n\timprovements (II)","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17900,"web_url":"https://patchwork.libcamera.org/comment/17900/","msgid":"<YNoDvT+TEmfm6X+C@pendragon.ideasonboard.com>","date":"2021-06-28T17:15:41","subject":"Re: [libcamera-devel] [PATCH v2 0/2] Raspberry Pi: Metadata parsing\n\timprovements (II)","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nOn Tue, Jun 22, 2021 at 02:30:51PM +0100, Naushir Patuck wrote:\n> On Tue, 22 Jun 2021 at 14:20, Naushir Patuck <naush@raspberrypi.com> wrote:\n> > Hi,\n> >\n> > Here is version 2 of this series.  The following changes have been\n> > introduced\n> > over v1:\n> >\n> > - Rework patch 1/2 to use a unique_ptr to store the parser object in the\n> > CamHelper class.\n> > - Switch to using std::initialiser_list in the constructor of MdParserSmia.\n> > - All suggestions from Laurent's feedback have been addressed in patch 2/2.\n> >\n> > The constructor for the unique_ptr<MdParserSmia> in patch 2/2 looks a bit\n> > awkward now since I have to explicitly write std::initialiser_list within\n> > std::make_unique, but I cannot see nice way around this.\n> \n> Something like the following could arguably be neater, but functionally\n> equivalent in patch 2/2:\n> \n> diff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> index 18f5c3e7e520..bd42536085d9 100644\n> --- a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> +++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> @@ -30,6 +30,7 @@ using namespace RPiController;\n>  constexpr uint32_t gainReg = 0x157;\n>  constexpr uint32_t expHiReg = 0x15a;\n>  constexpr uint32_t expLoReg = 0x15b;\n> +constexpr std::initializer_list<uint32_t> registerList = { expHiReg,\n> expLoReg, gainReg };\n> \n>  class CamHelperImx219 : public CamHelper\n>  {\n> @@ -53,9 +54,7 @@ private:\n> \n>  CamHelperImx219::CamHelperImx219()\n>  #if ENABLE_EMBEDDED_DATA\n> -       : CamHelper(std::make_unique<MdParserSmia>\n> -                       (std::initializer_list<uint32_t>({ expHiReg,\n> expLoReg, gainReg })),\n> -                   frameIntegrationDiff)\n> +       : CamHelper(std::make_unique<MdParserSmia>(registerList),\n> frameIntegrationDiff)\n>  #else\n>         : CamHelper({}, frameIntegrationDiff)\n>  #endif\n> diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> index 8869af6620cf..4c7f7fd9561b 100644\n> --- a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> +++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> @@ -23,6 +23,7 @@ constexpr uint32_t expHiReg = 0x0202;\n>  constexpr uint32_t expLoReg = 0x0203;\n>  constexpr uint32_t gainHiReg = 0x0204;\n>  constexpr uint32_t gainLoReg = 0x0205;\n> +constexpr std::initializer_list<uint32_t> registerList = { expHiReg,\n> expLoReg, gainHiReg, gainLoReg };\n> \n>  class CamHelperImx477 : public CamHelper\n>  {\n> @@ -46,9 +47,7 @@ private:\n>  };\n> \n>  CamHelperImx477::CamHelperImx477()\n> -       : CamHelper(std::make_unique<MdParserSmia>\n> -                       (std::initializer_list<uint32_t>({ expHiReg,\n> expLoReg, gainHiReg, gainLoReg })),\n> -                   frameIntegrationDiff)\n> +       : CamHelper(std::make_unique<MdParserSmia>(registerList),\n> frameIntegrationDiff)\n>  {\n>  }\n> \n> If folks think this is better, I am happy to change it.\n\nI like that better as it's a bit more readable, but it's up to you.\n\nIf you post a new version, you'll need to address the ov9281 that has\njust been merged, otherwise I can do so when applying. Please let me\nknow how you'd like to proceed.\n\n> > I have removed all previous tags from 1/2, as this is a completely different\n> > approach to the previous revision.\n> >\n> > Thanks,\n> > Naush\n> >\n> > Naushir Patuck (2):\n> >   ipa: raspberrypi: Use a unique_ptr for the metadata parser\n> >   ipa: raspberrypi: Generalise the SMIA metadata parser\n> >\n> >  src/ipa/raspberrypi/cam_helper.cpp        |  38 ++++---\n> >  src/ipa/raspberrypi/cam_helper.hpp        |   7 +-\n> >  src/ipa/raspberrypi/cam_helper_imx219.cpp | 117 ++++----------------\n> >  src/ipa/raspberrypi/cam_helper_imx290.cpp |   2 +-\n> >  src/ipa/raspberrypi/cam_helper_imx477.cpp | 123 ++++------------------\n> >  src/ipa/raspberrypi/cam_helper_ov5647.cpp |   2 +-\n> >  src/ipa/raspberrypi/md_parser.hpp         |  42 +++++---\n> >  src/ipa/raspberrypi/md_parser_smia.cpp    |  66 ++++++++++--\n> >  8 files changed, 155 insertions(+), 242 deletions(-)","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 A6FE0C321F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 28 Jun 2021 17:15:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0C211684D4;\n\tMon, 28 Jun 2021 19:15:45 +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 B52066028C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Jun 2021 19:15:43 +0200 (CEST)","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 2B52AB8A;\n\tMon, 28 Jun 2021 19:15:43 +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=\"TOx3GP6q\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1624900543;\n\tbh=f/mkGJLEN2rYtDCV4oTcVIOHtijYW7nzl8QnEJqTshw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TOx3GP6qKqrBLNwT/ZZdZL1PeCIpfzTrtrczDeQPVTnVCLd8pH0eKwrfJK8wwoRvU\n\t66W+d5hf+6ApdB4/eXonVU95aqbdjnm+A/izpHzPi6fuS2Y7tUjqm2ZFyXSmfXjy1T\n\t/9/kMZBDRoIrlKAX0xytNqK2lf2wk9+KU73T+8b8=","Date":"Mon, 28 Jun 2021 20:15:41 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YNoDvT+TEmfm6X+C@pendragon.ideasonboard.com>","References":"<20210622132014.949961-1-naush@raspberrypi.com>\n\t<CAEmqJPrEuw1wyx=tT9zu_bPLr=PWjVQ4T2DiaZvoLP9BosYeBQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAEmqJPrEuw1wyx=tT9zu_bPLr=PWjVQ4T2DiaZvoLP9BosYeBQ@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v2 0/2] Raspberry Pi: Metadata parsing\n\timprovements (II)","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17908,"web_url":"https://patchwork.libcamera.org/comment/17908/","msgid":"<CAEmqJPpsi-80m4SGVhCJHSfp4eLoMDP=QDzNgQ3uFOZPsf3Tqg@mail.gmail.com>","date":"2021-06-29T09:03:28","subject":"Re: [libcamera-devel] [PATCH v2 0/2] Raspberry Pi: Metadata parsing\n\timprovements (II)","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Laurent,\n\nThank you for your review feedback.\n\nOn Mon, 28 Jun 2021 at 18:15, Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Naush,\n>\n> On Tue, Jun 22, 2021 at 02:30:51PM +0100, Naushir Patuck wrote:\n> > On Tue, 22 Jun 2021 at 14:20, Naushir Patuck <naush@raspberrypi.com>\n> wrote:\n> > > Hi,\n> > >\n> > > Here is version 2 of this series.  The following changes have been\n> > > introduced\n> > > over v1:\n> > >\n> > > - Rework patch 1/2 to use a unique_ptr to store the parser object in\n> the\n> > > CamHelper class.\n> > > - Switch to using std::initialiser_list in the constructor of\n> MdParserSmia.\n> > > - All suggestions from Laurent's feedback have been addressed in patch\n> 2/2.\n> > >\n> > > The constructor for the unique_ptr<MdParserSmia> in patch 2/2 looks a\n> bit\n> > > awkward now since I have to explicitly write std::initialiser_list\n> within\n> > > std::make_unique, but I cannot see nice way around this.\n> >\n> > Something like the following could arguably be neater, but functionally\n> > equivalent in patch 2/2:\n> >\n> > diff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> > b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> > index 18f5c3e7e520..bd42536085d9 100644\n> > --- a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> > +++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n> > @@ -30,6 +30,7 @@ using namespace RPiController;\n> >  constexpr uint32_t gainReg = 0x157;\n> >  constexpr uint32_t expHiReg = 0x15a;\n> >  constexpr uint32_t expLoReg = 0x15b;\n> > +constexpr std::initializer_list<uint32_t> registerList = { expHiReg,\n> > expLoReg, gainReg };\n> >\n> >  class CamHelperImx219 : public CamHelper\n> >  {\n> > @@ -53,9 +54,7 @@ private:\n> >\n> >  CamHelperImx219::CamHelperImx219()\n> >  #if ENABLE_EMBEDDED_DATA\n> > -       : CamHelper(std::make_unique<MdParserSmia>\n> > -                       (std::initializer_list<uint32_t>({ expHiReg,\n> > expLoReg, gainReg })),\n> > -                   frameIntegrationDiff)\n> > +       : CamHelper(std::make_unique<MdParserSmia>(registerList),\n> > frameIntegrationDiff)\n> >  #else\n> >         : CamHelper({}, frameIntegrationDiff)\n> >  #endif\n> > diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> > b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> > index 8869af6620cf..4c7f7fd9561b 100644\n> > --- a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> > +++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n> > @@ -23,6 +23,7 @@ constexpr uint32_t expHiReg = 0x0202;\n> >  constexpr uint32_t expLoReg = 0x0203;\n> >  constexpr uint32_t gainHiReg = 0x0204;\n> >  constexpr uint32_t gainLoReg = 0x0205;\n> > +constexpr std::initializer_list<uint32_t> registerList = { expHiReg,\n> > expLoReg, gainHiReg, gainLoReg };\n> >\n> >  class CamHelperImx477 : public CamHelper\n> >  {\n> > @@ -46,9 +47,7 @@ private:\n> >  };\n> >\n> >  CamHelperImx477::CamHelperImx477()\n> > -       : CamHelper(std::make_unique<MdParserSmia>\n> > -                       (std::initializer_list<uint32_t>({ expHiReg,\n> > expLoReg, gainHiReg, gainLoReg })),\n> > -                   frameIntegrationDiff)\n> > +       : CamHelper(std::make_unique<MdParserSmia>(registerList),\n> > frameIntegrationDiff)\n> >  {\n> >  }\n> >\n> > If folks think this is better, I am happy to change it.\n>\n> I like that better as it's a bit more readable, but it's up to you.\n>\n> If you post a new version, you'll need to address the ov9281 that has\n> just been merged, otherwise I can do so when applying. Please let me\n> know how you'd like to proceed.\n>\n\nI'll submit an updated patch series with your suggestions and rebased\nonto master shortly.\n\nThanks!\nNaush\n\n\n>\n> > > I have removed all previous tags from 1/2, as this is a completely\n> different\n> > > approach to the previous revision.\n> > >\n> > > Thanks,\n> > > Naush\n> > >\n> > > Naushir Patuck (2):\n> > >   ipa: raspberrypi: Use a unique_ptr for the metadata parser\n> > >   ipa: raspberrypi: Generalise the SMIA metadata parser\n> > >\n> > >  src/ipa/raspberrypi/cam_helper.cpp        |  38 ++++---\n> > >  src/ipa/raspberrypi/cam_helper.hpp        |   7 +-\n> > >  src/ipa/raspberrypi/cam_helper_imx219.cpp | 117 ++++----------------\n> > >  src/ipa/raspberrypi/cam_helper_imx290.cpp |   2 +-\n> > >  src/ipa/raspberrypi/cam_helper_imx477.cpp | 123 ++++------------------\n> > >  src/ipa/raspberrypi/cam_helper_ov5647.cpp |   2 +-\n> > >  src/ipa/raspberrypi/md_parser.hpp         |  42 +++++---\n> > >  src/ipa/raspberrypi/md_parser_smia.cpp    |  66 ++++++++++--\n> > >  8 files changed, 155 insertions(+), 242 deletions(-)\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\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 050B1C321F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Jun 2021 09:03:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 32B79684E8;\n\tTue, 29 Jun 2021 11:03:46 +0200 (CEST)","from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com\n\t[IPv6:2a00:1450:4864:20::12a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 038ED684D3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Jun 2021 11:03:44 +0200 (CEST)","by mail-lf1-x12a.google.com with SMTP id u13so38229866lfk.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Jun 2021 02:03:44 -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=\"DyT0T8r4\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=u5EdIeIVRLfevbW5uFx2zEJFLs6awhhowlOH/2bBhxI=;\n\tb=DyT0T8r4pSOYr/XbPl5e9HfwmDPGwBeA8KOsIFsCxupv+eYEfYU9JovESWvyWqbqaW\n\tGJMxU1tD9GUWZh7cRylIES/jEF6HkRI8NUZRakzqpkJHf807VqeR7hwV5xxMfdAVcWLS\n\tzhG91igHlM6MBltaZPi64+2WFJYmjGTPgUYrZ3S702qvAqSgqAM4hi+GpvgC1P8M0/ci\n\tYeHcgY8LJALsf92nITC99NJuZ/xWBlIJZDkn0Ry55hAAYdS/MSB9oompohUrTQVVvzZo\n\tIYgHMsRsFGFWoqcSH2q+aoYAmu/nMqnwEiNy8CmoLVtvsRXQ+ZY5z019hTn5EltyUX0v\n\tIv/Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=u5EdIeIVRLfevbW5uFx2zEJFLs6awhhowlOH/2bBhxI=;\n\tb=F9I4dxMwrj/WiutXnzUqnESWqvByr06DOe9OXj4NhEl4JfWzqVYQ6RNI+i4Srqnflk\n\tMiaOYG8MdAZkF2KlBCj9AH/ZAkEpqFvVMea+k6A2qGMDcHJj/TNb5C7v1RH513XIS7u2\n\tO00E0mOYOvKRXkGd/brRj8MtWfgEQDD1uSkO6eLBQ0RnQk9eiCW4gJ2oEFgWA7RrUfJv\n\tJY2jTDsPGn2+AkxE1Ho1MPYoPnepjVTxtpRvN2HTLmGs0klWzIWm0aBBQHO+JKbHenVE\n\tTs3NEVNJ17GWztDEl8q9mSF0xo5fqYP50SI05IvnUYWo+Wa2mYOHy40uVlQbrhpRGrTH\n\t4Lkw==","X-Gm-Message-State":"AOAM5334MKAcJ5c6PT4TkWLNEtNyThLGtikxwpVNuxs4A1lhJ1dHRJAm\n\tLriabup7jN6C5+7M5jNTqmBdGUz3t8KpmjHCr64U1JV5U+w=","X-Google-Smtp-Source":"ABdhPJyv2BwK4dkVBDtUiopgXfcWrenErTR3mHeE4BCiYH84ys/04mIHHn6hmC7q9NiWCbJs8/1kLDCfiCMM8Itm/bc=","X-Received":"by 2002:ac2:4db6:: with SMTP id\n\th22mr21399754lfe.171.1624957424035; \n\tTue, 29 Jun 2021 02:03:44 -0700 (PDT)","MIME-Version":"1.0","References":"<20210622132014.949961-1-naush@raspberrypi.com>\n\t<CAEmqJPrEuw1wyx=tT9zu_bPLr=PWjVQ4T2DiaZvoLP9BosYeBQ@mail.gmail.com>\n\t<YNoDvT+TEmfm6X+C@pendragon.ideasonboard.com>","In-Reply-To":"<YNoDvT+TEmfm6X+C@pendragon.ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 29 Jun 2021 10:03:28 +0100","Message-ID":"<CAEmqJPpsi-80m4SGVhCJHSfp4eLoMDP=QDzNgQ3uFOZPsf3Tqg@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"0000000000000900d505c5e3e2f0\"","Subject":"Re: [libcamera-devel] [PATCH v2 0/2] Raspberry Pi: Metadata parsing\n\timprovements (II)","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]