{"id":2183,"url":"https://patchwork.libcamera.org/api/patches/2183/?format=json","web_url":"https://patchwork.libcamera.org/patch/2183/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20191013232755.3292-2-laurent.pinchart@ideasonboard.com>","date":"2019-10-13T23:27:47","name":"[libcamera-devel,01/10] libcamera: v4l2_controls: Remove V4L2ControlInfo::size()","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"174b95cec1ee095d7f1d905c4459234d4149026d","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2183/mbox/","series":[{"id":534,"url":"https://patchwork.libcamera.org/api/series/534/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=534","date":"2019-10-13T23:27:46","name":"Merge V4L2ControlInfoMap and ControlInfoMap","version":1,"mbox":"https://patchwork.libcamera.org/series/534/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2183/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2183/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5464361563\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Oct 2019 01:28:03 +0200 (CEST)","from pendragon.bb.dnainternet.fi\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CA6DA80B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Oct 2019 01:28:02 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1571009282;\n\tbh=NCqyGMry2g4r6rw9Pzmv/oLQwsqOyF7thxVr+RN9MZ0=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=c1YE8cWzdjJkFmeTEILvHSSYadLIyM26f1c+0hE2EEsfs74uZ9xPomgEsiizeo/cC\n\tepj5TzaSJSXOwMsmVQ51u542Or8LofkDUiqqRofQhIQCm9CuoepLonU2D6jJu8oOmB\n\tsvxw0eNVp/0d2a6FCIOQ3it5OQI9odjzdZrTNFt8=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 14 Oct 2019 02:27:47 +0300","Message-Id":"<20191013232755.3292-2-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20191013232755.3292-1-laurent.pinchart@ideasonboard.com>","References":"<20191013232755.3292-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 01/10] libcamera: v4l2_controls: Remove\n\tV4L2ControlInfo::size()","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 23:28:03 -0000"},"content":"We don't support V4L2 compound controls, the size field is thus unused.\nRemove it to ease merging of the libcamera and V4L2 control info\nclasses. Support for array controls can then be added later on top, and\nwould be useful for libcamera controls too.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/include/v4l2_controls.h |  4 ----\n src/libcamera/v4l2_controls.cpp       |  8 --------\n src/libcamera/v4l2_device.cpp         | 14 ++++++++++++--\n 3 files changed, 12 insertions(+), 14 deletions(-)","diff":"diff --git a/src/libcamera/include/v4l2_controls.h b/src/libcamera/include/v4l2_controls.h\nindex 89cc74485e6f..133f5262febf 100644\n--- a/src/libcamera/include/v4l2_controls.h\n+++ b/src/libcamera/include/v4l2_controls.h\n@@ -31,14 +31,10 @@ public:\n \tV4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl);\n \n \tconst ControlId &id() const { return id_; }\n-\tsize_t size() const { return size_; }\n-\n \tconst ControlRange &range() const { return range_; }\n \n private:\n \tV4L2ControlId id_;\n-\tsize_t size_;\n-\n \tControlRange range_;\n };\n \ndiff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp\nindex c45d3fda2e1f..dcf31b7a8f26 100644\n--- a/src/libcamera/v4l2_controls.cpp\n+++ b/src/libcamera/v4l2_controls.cpp\n@@ -127,8 +127,6 @@ V4L2ControlId::V4L2ControlId(const struct v4l2_query_ext_ctrl &ctrl)\n V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl)\n \t: id_(ctrl)\n {\n-\tsize_ = ctrl.elem_size * ctrl.elems;\n-\n \tif (ctrl.type == V4L2_CTRL_TYPE_INTEGER64)\n \t\trange_ = ControlRange(static_cast<int64_t>(ctrl.minimum),\n \t\t\t\t      static_cast<int64_t>(ctrl.maximum));\n@@ -143,12 +141,6 @@ V4L2ControlInfo::V4L2ControlInfo(const struct v4l2_query_ext_ctrl &ctrl)\n  * \\return The V4L2 control ID\n  */\n \n-/**\n- * \\fn V4L2ControlInfo::size()\n- * \\brief Retrieve the control value data size (in bytes)\n- * \\return The V4L2 control value data size\n- */\n-\n /**\n  * \\fn V4L2ControlInfo::range()\n  * \\brief Retrieve the control value range\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex b47ba448f354..54cc214ecce9 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -8,11 +8,13 @@\n #include \"v4l2_device.h\"\n \n #include <fcntl.h>\n+#include <iomanip>\n #include <string.h>\n #include <sys/ioctl.h>\n #include <unistd.h>\n \n #include \"log.h\"\n+#include \"utils.h\"\n #include \"v4l2_controls.h\"\n \n /**\n@@ -360,6 +362,13 @@ void V4L2Device::listControls()\n \t\t    ctrl.flags & V4L2_CTRL_FLAG_DISABLED)\n \t\t\tcontinue;\n \n+\t\tif (ctrl.elems != 1 || ctrl.nr_of_dims) {\n+\t\t\tLOG(V4L2, Debug)\n+\t\t\t\t<< \"Array control \" << utils::hex(ctrl.id)\n+\t\t\t\t<< \" not supported\";\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tswitch (ctrl.type) {\n \t\tcase V4L2_CTRL_TYPE_INTEGER:\n \t\tcase V4L2_CTRL_TYPE_BOOLEAN:\n@@ -371,8 +380,9 @@ void V4L2Device::listControls()\n \t\t\tbreak;\n \t\t/* \\todo Support compound controls. */\n \t\tdefault:\n-\t\t\tLOG(V4L2, Debug) << \"Control type '\" << ctrl.type\n-\t\t\t\t\t << \"' not supported\";\n+\t\t\tLOG(V4L2, Debug)\n+\t\t\t\t<< \"Control \" << utils::hex(ctrl.id)\n+\t\t\t\t<< \" has unsupported type \" << ctrl.type;\n \t\t\tcontinue;\n \t\t}\n \n","prefixes":["libcamera-devel","01/10"]}