[{"id":2866,"web_url":"https://patchwork.libcamera.org/comment/2866/","msgid":"<20191013133211.xvci3vw577g5juiy@uno.localdomain>","date":"2019-10-13T13:32:11","subject":"Re: [libcamera-devel] [PATCH v2 00/14] Use ControlList for both\n\tlibcamera and V4L2 controls","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n    thank you for this work\n\nOn Sat, Oct 12, 2019 at 09:43:53PM +0300, Laurent Pinchart wrote:\n> Hello,\n>\n> This patch series generalises usage of ControlList for all controls,\n> both libcamera and V4L2.\n\nThank you for having clarified my design related concerns.\nYou can hvae my\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nfor the first 6 patches, while I'll review the other ones separately\nbut I think I will mostly find minor issues now.\n\nThanks\n   j\n\n>\n> The rationale is that using a single container to store controls allows\n> better sharing of code, especially when we will implement serialisation\n> and deserialisation. Additionally, a single container type simplifies\n> the IPA API.\n>\n> Compared to v1, the series has been rebased on top of the IPA API, which\n> unveiled issues I hadn't foreseen. Large parts of the code have thus\n> been rewritten.\n>\n> Patches 01/14 and 02/14 are small cleanups and fixes, and patch 03/14\n> restores the global list of libcamera controls that used to be\n> auto-generated. While this wasn't strictly required in v1, this version\n> now depends on it.\n>\n> The next three patches are also small enhancements to simplify usage of\n> ControlValue, ControlList and ControlId (04/14 to 06/14).\n>\n> Patch 07/14 is the first large change, and extends the ControlLis API to\n> support accessing controls by numerical ID. This was previously\n> implemented in the V4L2ControlList class and got moved to ControlList as\n> this API will likely be used for deserialisation. As a result, the\n> ControlList now needs to be constructed with a reference to a\n> ControlIdMap to support mapping numerical IDs to ControlId instances.\n>\n> Patch 08/14 adds a new test for V4L2 controls, based on the vivid\n> driver. The test uses the existing V4L2ControlList API, and gets\n> migrated to ControlList further down in the series, to ensure that the\n> API switch doesn't create regressions.\n>\n> Patch 09/14 is another small enhancement, after which patch 10/14 starts\n> the migration of V4L2 controls by using ControlId in V4L2ControlInfo. To\n> do so, a new V4L2ControlId class is introduced that simply wraps\n> ControlId with a convenience constructor. Patch 11/14 then removes the\n> V4L2ControlInfo::type field that duplicates ControlId::type, and patch\n> 12/14 turns V4L2ControlInfoMap into a real class in preparation for\n> extending it.\n>\n> Patch 13/14 is the bulk of the work, and by far the largest in the\n> series (but with a nice net removal of 168 lines of code). It moves\n> V4L2ControlList to become an optional thin convenience wrapper around\n> ControlList, and ControlList can be used directly for V4L2 controls if\n> desired.\n>\n> Finally patch 14/14 merges the control and v4l2controls fields in\n> IPAOperationData, simplifying the IPA API.\n>\n> More code sharing between V4L2 and libcamera controls may still be\n> possible, especially around V4L2ControlInfo and V4L2ControlInfoMap. I\n> believe it can be built on top of this series.\n>\n> The series is based on top of the master branch, patches have been\n> compiled and tested individually with gcc 5.4.0, and the whole series\n> has been compiled with gcc 5 to 9 and clang 6 to 8. Niklas, would you be\n> able to run your manual rkisp1 IPA tests ?\n>\n> Laurent Pinchart (14):\n>   libcamera: pipeline: rkisp1: Avoid copy assignment of V4L2 control map\n>   libcamera: control_ids: Fix documentation for controls namespace\n>   libcamera: control_ids: Generate map of all supported controls\n>   libcamera: controls: Add comparison operators for ControlValue\n>   libcamera: controls: Default ControlList validator argument to nullptr\n>   libcamera: controls: Store control name in ControlId\n>   libcamera: controls: Support accessing controls by numerical ID\n>   test: v4l2_videodevice: Add V4L2 control test\n>   libcamera: v4l2_device: Avoid copy of V4L2ControlInfo\n>   libcamera: v4l2_controls: Add V4L2ControlId\n>   libcamera: v4l2_controls: Remove V4L2ControlInfo type field\n>   libcamera: v4l2_controls: Turn V4L2ControlInfoMap into a class\n>   libcamera: v4l2_device: Replace V4L2ControlList with ControlList\n>   libcamera: ipa: Merge controls and v4l2controls in IPAOperationData\n>\n>  include/ipa/ipa_interface.h              |   1 -\n>  include/libcamera/control_ids.h.in       |   2 +\n>  include/libcamera/controls.h             |  30 ++-\n>  src/ipa/rkisp1/rkisp1.cpp                |  22 +-\n>  src/libcamera/camera_sensor.cpp          |   4 +-\n>  src/libcamera/control_ids.cpp.in         |  20 +-\n>  src/libcamera/controls.cpp               | 181 ++++++++++++---\n>  src/libcamera/gen-controls.py            |  21 +-\n>  src/libcamera/include/camera_sensor.h    |   7 +-\n>  src/libcamera/include/v4l2_controls.h    |  74 +++---\n>  src/libcamera/include/v4l2_device.h      |   6 +-\n>  src/libcamera/ipa_interface.cpp          |   8 -\n>  src/libcamera/pipeline/ipu3/ipu3.cpp     |   9 +-\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp |   8 +-\n>  src/libcamera/pipeline/uvcvideo.cpp      |  24 +-\n>  src/libcamera/pipeline/vimc.cpp          |  25 +--\n>  src/libcamera/request.cpp                |   5 +-\n>  src/libcamera/v4l2_controls.cpp          | 273 ++++++++---------------\n>  src/libcamera/v4l2_device.cpp            |  71 +++---\n>  test/controls/control_list.cpp           |   2 +-\n>  test/v4l2_videodevice/controls.cpp       |  98 ++++++++\n>  test/v4l2_videodevice/meson.build        |   1 +\n>  22 files changed, 526 insertions(+), 366 deletions(-)\n>  create mode 100644 test/v4l2_videodevice/controls.cpp\n>\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 relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[217.70.183.194])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B6EC061562\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Oct 2019 15:30:28 +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 relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 3C3AF40006;\n\tSun, 13 Oct 2019 13:30:28 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Sun, 13 Oct 2019 15:32:11 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191013133211.xvci3vw577g5juiy@uno.localdomain>","References":"<20191012184407.31684-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"mdrauul2b7z444on\"","Content-Disposition":"inline","In-Reply-To":"<20191012184407.31684-1-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH v2 00/14] Use ControlList for both\n\tlibcamera and V4L2 controls","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 13:30:28 -0000"}},{"id":2877,"web_url":"https://patchwork.libcamera.org/comment/2877/","msgid":"<20191013151636.GI23166@bigcity.dyn.berto.se>","date":"2019-10-13T15:16:36","subject":"Re: [libcamera-devel] [PATCH v2 00/14] Use ControlList for both\n\tlibcamera and V4L2 controls","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 work.\n\nOn 2019-10-12 21:43:53 +0300, Laurent Pinchart wrote:\n> The series is based on top of the master branch, patches have been\n> compiled and tested individually with gcc 5.4.0, and the whole series\n> has been compiled with gcc 5 to 9 and clang 6 to 8. Niklas, would you be\n> able to run your manual rkisp1 IPA tests ?\n\nI have now run my tests and all looks OK,\n\nTested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x144.google.com (mail-lf1-x144.google.com\n\t[IPv6:2a00:1450:4864:20::144])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8F4C61562\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Oct 2019 17:16:37 +0200 (CEST)","by mail-lf1-x144.google.com with SMTP id w6so10090628lfl.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Oct 2019 08:16: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\tn5sm4144067ljh.54.2019.10.13.08.16.36\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 13 Oct 2019 08:16: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=LycpQ52vb0SSoWgWn08rTdFaXCNaYUDqj8sOdIfsk8c=;\n\tb=h1Zzm0ZD4mksthx4XvWqOTJoQPNE045ACVeG8rCu+xD1lVdSdfefw3hZ4uIYTgSuM3\n\tbWPUf/nlXtLmssogmuT64ilGDm/uwWvxM2zSMPJce61+KRN1+X5t9EwSXMaF0y7LX5Nw\n\t6XvXD52+lDDBsqSbwLTgKPEeDVIe1BsxuDp/M8iL5h9ShpRYpbclLbfkmA50vK29C0Q+\n\tqH8Qoyd5WkbsS920rOHbgORE1ycS8svEt9l5YdnydT1mFxwHM2RuxeSRsd5WXTk4hKbR\n\tpwvPYcHA3gRMhptf3obMnzmCOGw8cSXHNQtFGwUKSC5+3Par2FTn5D28hAoJeT7kYRcs\n\tY9mA==","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=LycpQ52vb0SSoWgWn08rTdFaXCNaYUDqj8sOdIfsk8c=;\n\tb=IlOH0aV6MWKb39I0Rm2kdHd8/bYNbKtkBdoB56sVtTkwj6wvWEwViVXlSxah9SfSxy\n\tCGTSP3TiYnOpsEXCnhwbW2Ba5WB1Pf/KIawYLjTVaOzoN2YoAZmC2Jkbf86vS40fUCSo\n\toe/ZFVriO9bylOB2BzibNdRk77PYLJ/i0JekDJXt/KFBa5WojDJ17uVjQ3mBOrZd63VE\n\txq5dAPaVOr7X6ghjsLgC1BGx91TL0SENX23xuQ0bYI4UluXsjMfmGwRUR9ClvJB1mQEs\n\ttF8a0A+F1OTriAKIVp4naaXRbZN0/kfLhHN2ju6zP4cV8DcURIZ0kZrX0HmVakf4OMN5\n\tDneA==","X-Gm-Message-State":"APjAAAUDOq3iw3Weahj1drv0h7gGeJptWJtdg9jTRoAwRyrecPRSuJb/\n\t9YkZ/p/OCB7cPZsUAok1ar8sxdFAD5M=","X-Google-Smtp-Source":"APXvYqw8QDKjKWNjlaG4hDz10L6kWltiw6srItrwolAkttmBSi2t/EJcHQEWxoV2BREm5Qsaxbj2jg==","X-Received":"by 2002:a19:8c5a:: with SMTP id\n\ti26mr14775042lfj.118.1570979796963; \n\tSun, 13 Oct 2019 08:16:36 -0700 (PDT)","Date":"Sun, 13 Oct 2019 17:16:36 +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":"<20191013151636.GI23166@bigcity.dyn.berto.se>","References":"<20191012184407.31684-1-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-1-laurent.pinchart@ideasonboard.com>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH v2 00/14] Use ControlList for both\n\tlibcamera and V4L2 controls","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:16:37 -0000"}}]