[{"id":2875,"web_url":"https://patchwork.libcamera.org/comment/2875/","msgid":"<20191013150226.ehyh5zzzthcwc5yw@uno.localdomain>","date":"2019-10-13T15:02:26","subject":"Re: [libcamera-devel] [PATCH v2 14/14] libcamera: ipa: Merge\n\tcontrols and v4l2controls in IPAOperationData","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Sat, Oct 12, 2019 at 09:44:07PM +0300, Laurent Pinchart wrote:\n> Now that the V4L2ControlList is merely a helper to construct a\n> ControlList for V4L2 controls, without any data member, all controls can\n> be transferred between pipeline handlers and IPAs using ControlList\n> only. Remove the v4l2controls member for IPAOperationData and use the\n> control member instead.\n\nGreat to see this simplified!\nWe should aim to do the same with the V4L2ControlInfoMap!\n\nThis all seems good!\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n   j\n\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  include/ipa/ipa_interface.h              | 1 -\n>  src/ipa/rkisp1/rkisp1.cpp                | 2 +-\n>  src/libcamera/ipa_interface.cpp          | 8 --------\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 6 +++---\n>  4 files changed, 4 insertions(+), 13 deletions(-)\n>\n> diff --git a/include/ipa/ipa_interface.h b/include/ipa/ipa_interface.h\n> index c393b64f6aa1..dfb1bcbee516 100644\n> --- a/include/ipa/ipa_interface.h\n> +++ b/include/ipa/ipa_interface.h\n> @@ -33,7 +33,6 @@ struct IPAOperationData {\n>  \tunsigned int operation;\n>  \tstd::vector<uint32_t> data;\n>  \tstd::vector<ControlList> controls;\n> -\tstd::vector<V4L2ControlList> v4l2controls;\n>  };\n>\n>  class IPAInterface\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 69ced840585f..13059d99036c 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -215,7 +215,7 @@ void IPARkISP1::setControls(unsigned int frame)\n>  \tV4L2ControlList ctrls(ctrls_);\n>  \tctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_));\n>  \tctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));\n> -\top.v4l2controls.push_back(ctrls);\n> +\top.controls.push_back(ctrls);\n>\n>  \tqueueFrameAction.emit(frame, op);\n>  }\n> diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\n> index 4fb178298f4c..0571b8e6bf8b 100644\n> --- a/src/libcamera/ipa_interface.cpp\n> +++ b/src/libcamera/ipa_interface.cpp\n> @@ -120,14 +120,6 @@ namespace libcamera {\n>   * by the IPA protocol.\n>   */\n>\n> -/**\n> - * \\var IPAOperationData::v4l2controls\n> - * \\brief Operation V4L2 controls data\n> - *\n> - * The interpretation and position of different values in the array are defined\n> - * by the IPA protocol.\n> - */\n> -\n>  /**\n>   * \\class IPAInterface\n>   * \\brief Interface for IPA implementation\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 32b023730009..9b19bde8a274 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -324,7 +324,7 @@ RkISP1FrameInfo *RkISP1Frames::find(Request *request)\n>  class RkISP1ActionSetSensor : public FrameAction\n>  {\n>  public:\n> -\tRkISP1ActionSetSensor(unsigned int frame, CameraSensor *sensor, V4L2ControlList controls)\n> +\tRkISP1ActionSetSensor(unsigned int frame, CameraSensor *sensor, const ControlList &controls)\n>  \t\t: FrameAction(frame, SetSensor), sensor_(sensor), controls_(controls) {}\n>\n>  protected:\n> @@ -335,7 +335,7 @@ protected:\n>\n>  private:\n>  \tCameraSensor *sensor_;\n> -\tV4L2ControlList controls_;\n> +\tControlList controls_;\n>  };\n>\n>  class RkISP1ActionQueueBuffers : public FrameAction\n> @@ -387,7 +387,7 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,\n>  {\n>  \tswitch (action.operation) {\n>  \tcase RKISP1_IPA_ACTION_V4L2_SET: {\n> -\t\tV4L2ControlList controls = action.v4l2controls[0];\n> +\t\tconst ControlList &controls = action.controls[0];\n>  \t\ttimeline_.scheduleAction(utils::make_unique<RkISP1ActionSetSensor>(frame,\n>  \t\t\t\t\t\t\t\t\t\t   sensor_,\n>  \t\t\t\t\t\t\t\t\t\t   controls));\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22CF661562\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Oct 2019 17:00:39 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id A43FA100004;\n\tSun, 13 Oct 2019 15:00:38 +0000 (UTC)"],"Date":"Sun, 13 Oct 2019 17:02:26 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191013150226.ehyh5zzzthcwc5yw@uno.localdomain>","References":"<20191012184407.31684-1-laurent.pinchart@ideasonboard.com>\n\t<20191012184407.31684-15-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"4zy24zi3sgaenx7r\"","Content-Disposition":"inline","In-Reply-To":"<20191012184407.31684-15-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH v2 14/14] libcamera: ipa: Merge\n\tcontrols and v4l2controls in IPAOperationData","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>","X-List-Received-Date":"Sun, 13 Oct 2019 15:00:39 -0000"}},{"id":2892,"web_url":"https://patchwork.libcamera.org/comment/2892/","msgid":"<20191013162935.GW23166@bigcity.dyn.berto.se>","date":"2019-10-13T16:29:35","subject":"Re: [libcamera-devel] [PATCH v2 14/14] libcamera: ipa: Merge\n\tcontrols and v4l2controls in IPAOperationData","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your patch.\n\nOn 2019-10-12 21:44:07 +0300, Laurent Pinchart wrote:\n> Now that the V4L2ControlList is merely a helper to construct a\n> ControlList for V4L2 controls, without any data member, all controls can\n> be transferred between pipeline handlers and IPAs using ControlList\n> only. Remove the v4l2controls member for IPAOperationData and use the\n> control member instead.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  include/ipa/ipa_interface.h              | 1 -\n>  src/ipa/rkisp1/rkisp1.cpp                | 2 +-\n>  src/libcamera/ipa_interface.cpp          | 8 --------\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 6 +++---\n>  4 files changed, 4 insertions(+), 13 deletions(-)\n> \n> diff --git a/include/ipa/ipa_interface.h b/include/ipa/ipa_interface.h\n> index c393b64f6aa1..dfb1bcbee516 100644\n> --- a/include/ipa/ipa_interface.h\n> +++ b/include/ipa/ipa_interface.h\n> @@ -33,7 +33,6 @@ struct IPAOperationData {\n>  \tunsigned int operation;\n>  \tstd::vector<uint32_t> data;\n>  \tstd::vector<ControlList> controls;\n> -\tstd::vector<V4L2ControlList> v4l2controls;\n>  };\n>  \n>  class IPAInterface\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 69ced840585f..13059d99036c 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -215,7 +215,7 @@ void IPARkISP1::setControls(unsigned int frame)\n>  \tV4L2ControlList ctrls(ctrls_);\n>  \tctrls.set(V4L2_CID_EXPOSURE, static_cast<int32_t>(exposure_));\n>  \tctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast<int32_t>(gain_));\n> -\top.v4l2controls.push_back(ctrls);\n> +\top.controls.push_back(ctrls);\n>  \n>  \tqueueFrameAction.emit(frame, op);\n>  }\n> diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\n> index 4fb178298f4c..0571b8e6bf8b 100644\n> --- a/src/libcamera/ipa_interface.cpp\n> +++ b/src/libcamera/ipa_interface.cpp\n> @@ -120,14 +120,6 @@ namespace libcamera {\n>   * by the IPA protocol.\n>   */\n>  \n> -/**\n> - * \\var IPAOperationData::v4l2controls\n> - * \\brief Operation V4L2 controls data\n> - *\n> - * The interpretation and position of different values in the array are defined\n> - * by the IPA protocol.\n> - */\n> -\n>  /**\n>   * \\class IPAInterface\n>   * \\brief Interface for IPA implementation\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 32b023730009..9b19bde8a274 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -324,7 +324,7 @@ RkISP1FrameInfo *RkISP1Frames::find(Request *request)\n>  class RkISP1ActionSetSensor : public FrameAction\n>  {\n>  public:\n> -\tRkISP1ActionSetSensor(unsigned int frame, CameraSensor *sensor, V4L2ControlList controls)\n> +\tRkISP1ActionSetSensor(unsigned int frame, CameraSensor *sensor, const ControlList &controls)\n>  \t\t: FrameAction(frame, SetSensor), sensor_(sensor), controls_(controls) {}\n>  \n>  protected:\n> @@ -335,7 +335,7 @@ protected:\n>  \n>  private:\n>  \tCameraSensor *sensor_;\n> -\tV4L2ControlList controls_;\n> +\tControlList controls_;\n>  };\n>  \n>  class RkISP1ActionQueueBuffers : public FrameAction\n> @@ -387,7 +387,7 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,\n>  {\n>  \tswitch (action.operation) {\n>  \tcase RKISP1_IPA_ACTION_V4L2_SET: {\n> -\t\tV4L2ControlList controls = action.v4l2controls[0];\n> +\t\tconst ControlList &controls = action.controls[0];\n>  \t\ttimeline_.scheduleAction(utils::make_unique<RkISP1ActionSetSensor>(frame,\n>  \t\t\t\t\t\t\t\t\t\t   sensor_,\n>  \t\t\t\t\t\t\t\t\t\t   controls));\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x143.google.com (mail-lf1-x143.google.com\n\t[IPv6:2a00:1450:4864:20::143])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A3286196D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Oct 2019 18:29:37 +0200 (CEST)","by mail-lf1-x143.google.com with SMTP id 72so10148597lfh.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Oct 2019 09:29:37 -0700 (PDT)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\th3sm3446096lfc.26.2019.10.13.09.29.36\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 13 Oct 2019 09:29:36 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=kiXsNcHqZnUIq+JjllWsu0jzwj/6aF1XFZzPw0GcYTM=;\n\tb=VYTxjSZbazWrrT2uW06U59qi6r8Wstf+35L0rWLpVS38vkvlyghlTm7ov7VHgwsNsZ\n\tCDEuGr1EFCk9cV4dj3at/BQIP5L5wf4BRVVPi58NNqL8gINT7CFp3m6H7heiS/k9eyvi\n\tBpEXywG5uE6PeffhN9E8c0+wILtRG3K4KDuO/xttK/7sTd4j+krmoLCALLF/MK9EeCyZ\n\t9kgIWKECh2d5mm3RcmzT5kc1WSTTN15j43IwksYdvG/0/wLA+cuuf54vbZxEZANyD6Hw\n\tsmXFS0ETBjk/BvYyMzdO8Wn/g9baV9DcNHqboI9HBpDXumoDd2SwRk+ewilz4HLYmVXz\n\t1lig==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=kiXsNcHqZnUIq+JjllWsu0jzwj/6aF1XFZzPw0GcYTM=;\n\tb=Vr/R1qrA8MCuRLTT4W8gF7Du4HsDVvlgxdKe46CwPDQk2l9TBy06cJUWTnetofylA3\n\tCB9pukWZNe6marpeC9pOKzkSTJErLXEnnUqXhUz2DmaigorVHg4YUfFeY//+auYs57PB\n\tOffKIJqRSRFoV12mcUzOPPKpsrksSY4t/eQGr2h5BJZV/2ucv/rIWb/TDHUEVulU7Oqp\n\tqofiI36uyWUcPUpSDkhbyhmycx63msii31D9RpSde7yIk3PZ7ZrKlDO3aQIGohkyQFvU\n\tS9tWfUuwLWVLTaKCsEzV1yXXiWZiJPd/e5EN6x6r2q7gl38ZgPym0OOCw6ZgYIJyMr6B\n\tg6oA==","X-Gm-Message-State":"APjAAAUDotAhra0KRroxCb2jnm4Md8sA7xSXgxGoo+xBMtgouiogyHsp\n\tBTRz4HIDCQ+nHpRBIvSYAMoOIsInGhc=","X-Google-Smtp-Source":"APXvYqwH2EBsaEJkiOQVyQ5uPoE1W5y8ovWhdKEmYBUlNPIFRm8ztqmBLqU8lrbzix2I6o0OPoc5IA==","X-Received":"by 2002:a19:6e0a:: with SMTP id\n\tj10mr15629811lfc.131.1570984176668; \n\tSun, 13 Oct 2019 09:29:36 -0700 (PDT)","Date":"Sun, 13 Oct 2019 18:29:35 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191013162935.GW23166@bigcity.dyn.berto.se>","References":"<20191012184407.31684-1-laurent.pinchart@ideasonboard.com>\n\t<20191012184407.31684-15-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191012184407.31684-15-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH v2 14/14] libcamera: ipa: Merge\n\tcontrols and v4l2controls in IPAOperationData","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>","X-List-Received-Date":"Sun, 13 Oct 2019 16:29:37 -0000"}}]