[{"id":25846,"web_url":"https://patchwork.libcamera.org/comment/25846/","msgid":"<97102931-fda1-b98a-7b8c-2a09a3873f7b@ideasonboard.com>","date":"2022-11-22T08:46:59","subject":"Re: [libcamera-devel] [PATCH] libcamera: camera_sensor: Print\n\tmissing controls names","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn 11/22/22 2:00 PM, Jacopo Mondi via libcamera-devel wrote:\n> Since the very beginning the camera sensor class has validated the\n> controls available from the camera sensor driver, and complained\n> accordingly when any of them was missing.\n>\n> The complaint message reported however only the numerical identifier of\n> the V4L2 control, making debugging harder.\n\nI had similar pain recently but  the printing control-id made things a \nbit better in my case :D\n      ed591e705c (libcamera: v4l2_device: Log control id instead of \nerrorIdx)\n>\n> Associate to each control a human readable identifier and use it in\n> debug messages.\n>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/libcamera/camera_sensor.cpp | 38 ++++++++++++++++-----------------\n>   1 file changed, 19 insertions(+), 19 deletions(-)\n>\n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index ea373458a164..0780ce5a7007 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -213,31 +213,31 @@ int CameraSensor::validateSensorDriver()\n>   \t * Optional controls are used to register optional sensor properties. If\n>   \t * not present, some values will be defaulted.\n>   \t */\n> -\tstatic constexpr uint32_t optionalControls[] = {\n> -\t\tV4L2_CID_CAMERA_SENSOR_ROTATION,\n> +\tstatic const std::map<uint32_t, std::string> optionalControls = {\n> +\t\t{ V4L2_CID_CAMERA_SENSOR_ROTATION, \"Rotation\" },\n>   \t};\n>   \n>   \tconst ControlIdMap &controls = subdev_->controls().idmap();\n> -\tfor (uint32_t ctrl : optionalControls) {\n> +\tfor (const auto &[ctrl, name] : optionalControls) {\n>   \t\tif (!controls.count(ctrl))\n>   \t\t\tLOG(CameraSensor, Debug)\n> -\t\t\t\t<< \"Optional V4L2 control \" << utils::hex(ctrl)\n> -\t\t\t\t<< \" not supported\";\n> +\t\t\t\t<< \"Optional V4L2 control '\" << name\n> +\t\t\t\t<< \"' not supported\";\n>   \t}\n>   \n>   \t/*\n>   \t * Recommended controls are similar to optional controls, but will\n>   \t * become mandatory in the near future. Be loud if they're missing.\n>   \t */\n> -\tstatic constexpr uint32_t recommendedControls[] = {\n> -\t\tV4L2_CID_CAMERA_ORIENTATION,\n> +\tstatic const std::map<uint32_t, std::string> recommendedControls = {\n> +\t\t{ V4L2_CID_CAMERA_ORIENTATION, \"Orientation\" },\n>   \t};\n>   \n> -\tfor (uint32_t ctrl : recommendedControls) {\n> +\tfor (const auto &[ctrl, name] : recommendedControls) {\n>   \t\tif (!controls.count(ctrl)) {\n>   \t\t\tLOG(CameraSensor, Warning)\n> -\t\t\t\t<< \"Recommended V4L2 control \" << utils::hex(ctrl)\n> -\t\t\t\t<< \" not supported\";\n> +\t\t\t\t<< \"Recommended V4L2 control '\" << name\n> +\t\t\t\t<< \"' not supported\";\n>   \t\t\terr = -EINVAL;\n>   \t\t}\n>   \t}\n> @@ -300,20 +300,20 @@ int CameraSensor::validateSensorDriver()\n>   \t * For raw sensors, make sure the sensor driver supports the controls\n>   \t * required by the CameraSensor class.\n>   \t */\n> -\tstatic constexpr uint32_t mandatoryControls[] = {\n> -\t\tV4L2_CID_ANALOGUE_GAIN,\n> -\t\tV4L2_CID_EXPOSURE,\n> -\t\tV4L2_CID_HBLANK,\n> -\t\tV4L2_CID_PIXEL_RATE,\n> -\t\tV4L2_CID_VBLANK,\n> +\tstatic const std::map<uint32_t, std::string> mandatoryControls = {\n> +\t\t{ V4L2_CID_ANALOGUE_GAIN, \"Analogue gain\" },\n> +\t\t{ V4L2_CID_EXPOSURE, \"Exposure\" },\n> +\t\t{ V4L2_CID_HBLANK, \"Horizontal blanking\" },\n> +\t\t{ V4L2_CID_PIXEL_RATE, \"Pixel Rate\" },\n> +\t\t{ V4L2_CID_VBLANK, \"Vertical blanking\" }\n>   \t};\n>   \n>   \terr = 0;\n> -\tfor (uint32_t ctrl : mandatoryControls) {\n> +\tfor (const auto &[ctrl, name] : mandatoryControls) {\n>   \t\tif (!controls.count(ctrl)) {\n>   \t\t\tLOG(CameraSensor, Error)\n> -\t\t\t\t<< \"Mandatory V4L2 control \" << utils::hex(ctrl)\n> -\t\t\t\t<< \" not available\";\n> +\t\t\t\t<< \"Mandatory V4L2 control '\" << name\n> +\t\t\t\t<< \"' not available\";\n>   \t\t\terr = -EINVAL;\n>   \t\t}\n>   \t}","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 80316BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Nov 2022 08:47:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4B4D763313;\n\tTue, 22 Nov 2022 09:47:57 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 31F74632EA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Nov 2022 09:47:55 +0100 (CET)","from [192.168.1.104] (unknown [103.86.18.138])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 358D5A16;\n\tTue, 22 Nov 2022 09:47:53 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669106877;\n\tbh=3JhHO3wlIxUcm04fpXz73yZ32jW27Q5aq3T29A9M+kU=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=VEp7RPTuzqmWFK/Hw39TC6jfl2IsDcLzXgjma90Kl8+gO+N1cLhojEmpp4xnO/983\n\tfJ0WMykDFntXTmBgJiZ3fLpjQXxnBU9DGJfw3BXraYhC/c6WAxSjXDg5X8RoGoE8JU\n\t8Mp6UK94gBk73vvH4ySD+3Yom26VexcrwpHcN0sU/J59yBxePadOfmb9pxoBkgJgch\n\t9IBAPdijK9IHD8OW1+Tb2HhLtUwqEMeQn+Yk2oMjfVpiGhERRMsxEHJ9gaByMAg6yt\n\tIx5U5BQYuzfq2gF0zacXCjRDE0P9yZeQAUnI5Bbc4ylBMzkifgd41bxXTlW5Thqc5A\n\tW3N0ROxBZQuRA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669106874;\n\tbh=3JhHO3wlIxUcm04fpXz73yZ32jW27Q5aq3T29A9M+kU=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=LYuj5wjGFvubi30JKYfro1Qe03X9kZPk6OnMlzG1zNOaMz+6Z6PITLcWt6/1l6LEL\n\tw89PalWmd6D7EgbykBSD4C5iTqYpPlDb4GAxcLk2Rp2PbAsRJcME56SUOOWEhRCUUO\n\t/XV9JKcvxvOzB6yMkc/PPJWkltWb9gcXQCdao6QM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LYuj5wjG\"; dkim-atps=neutral","Message-ID":"<97102931-fda1-b98a-7b8c-2a09a3873f7b@ideasonboard.com>","Date":"Tue, 22 Nov 2022 14:16:59 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.4.1","Content-Language":"en-US","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","References":"<20221122083005.5239-1-jacopo@jmondi.org>","In-Reply-To":"<20221122083005.5239-1-jacopo@jmondi.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH] libcamera: camera_sensor: Print\n\tmissing controls names","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25851,"web_url":"https://patchwork.libcamera.org/comment/25851/","msgid":"<166912775202.1079859.17253301011090237692@Monstersaurus>","date":"2022-11-22T14:35:52","subject":"Re: [libcamera-devel] [PATCH] libcamera: camera_sensor: Print\n\tmissing controls names","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Jacopo Mondi via libcamera-devel (2022-11-22 08:30:05)\n> Since the very beginning the camera sensor class has validated the\n> controls available from the camera sensor driver, and complained\n> accordingly when any of them was missing.\n> \n> The complaint message reported however only the numerical identifier of\n> the V4L2 control, making debugging harder.\n> \n> Associate to each control a human readable identifier and use it in\n> debug messages.\n> \n\nScreams in 'YES PLEASE' [0] [1]\n\n[0] https://patchwork.libcamera.org/patch/13346/ (13/08/2021)\n[1] https://patchwork.libcamera.org/patch/11178/ (05/02/2021)\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/camera_sensor.cpp | 38 ++++++++++++++++-----------------\n>  1 file changed, 19 insertions(+), 19 deletions(-)\n> \n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index ea373458a164..0780ce5a7007 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -213,31 +213,31 @@ int CameraSensor::validateSensorDriver()\n>          * Optional controls are used to register optional sensor properties. If\n>          * not present, some values will be defaulted.\n>          */\n> -       static constexpr uint32_t optionalControls[] = {\n> -               V4L2_CID_CAMERA_SENSOR_ROTATION,\n> +       static const std::map<uint32_t, std::string> optionalControls = {\n> +               { V4L2_CID_CAMERA_SENSOR_ROTATION, \"Rotation\" },\n>         };\n>  \n>         const ControlIdMap &controls = subdev_->controls().idmap();\n> -       for (uint32_t ctrl : optionalControls) {\n> +       for (const auto &[ctrl, name] : optionalControls) {\n>                 if (!controls.count(ctrl))\n>                         LOG(CameraSensor, Debug)\n> -                               << \"Optional V4L2 control \" << utils::hex(ctrl)\n> -                               << \" not supported\";\n> +                               << \"Optional V4L2 control '\" << name\n> +                               << \"' not supported\";\n>         }\n>  \n>         /*\n>          * Recommended controls are similar to optional controls, but will\n>          * become mandatory in the near future. Be loud if they're missing.\n>          */\n> -       static constexpr uint32_t recommendedControls[] = {\n> -               V4L2_CID_CAMERA_ORIENTATION,\n> +       static const std::map<uint32_t, std::string> recommendedControls = {\n> +               { V4L2_CID_CAMERA_ORIENTATION, \"Orientation\" },\n>         };\n>  \n> -       for (uint32_t ctrl : recommendedControls) {\n> +       for (const auto &[ctrl, name] : recommendedControls) {\n>                 if (!controls.count(ctrl)) {\n>                         LOG(CameraSensor, Warning)\n> -                               << \"Recommended V4L2 control \" << utils::hex(ctrl)\n> -                               << \" not supported\";\n> +                               << \"Recommended V4L2 control '\" << name\n> +                               << \"' not supported\";\n>                         err = -EINVAL;\n>                 }\n>         }\n> @@ -300,20 +300,20 @@ int CameraSensor::validateSensorDriver()\n>          * For raw sensors, make sure the sensor driver supports the controls\n>          * required by the CameraSensor class.\n>          */\n> -       static constexpr uint32_t mandatoryControls[] = {\n> -               V4L2_CID_ANALOGUE_GAIN,\n> -               V4L2_CID_EXPOSURE,\n> -               V4L2_CID_HBLANK,\n> -               V4L2_CID_PIXEL_RATE,\n> -               V4L2_CID_VBLANK,\n> +       static const std::map<uint32_t, std::string> mandatoryControls = {\n> +               { V4L2_CID_ANALOGUE_GAIN, \"Analogue gain\" },\n> +               { V4L2_CID_EXPOSURE, \"Exposure\" },\n> +               { V4L2_CID_HBLANK, \"Horizontal blanking\" },\n> +               { V4L2_CID_PIXEL_RATE, \"Pixel Rate\" },\n> +               { V4L2_CID_VBLANK, \"Vertical blanking\" }\n>         };\n>  \n>         err = 0;\n> -       for (uint32_t ctrl : mandatoryControls) {\n> +       for (const auto &[ctrl, name] : mandatoryControls) {\n>                 if (!controls.count(ctrl)) {\n>                         LOG(CameraSensor, Error)\n> -                               << \"Mandatory V4L2 control \" << utils::hex(ctrl)\n> -                               << \" not available\";\n> +                               << \"Mandatory V4L2 control '\" << name\n> +                               << \"' not available\";\n>                         err = -EINVAL;\n>                 }\n>         }\n> -- \n> 2.38.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 1BC9EBE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Nov 2022 14:35:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7229461F2B;\n\tTue, 22 Nov 2022 15:35:56 +0100 (CET)","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 D4759603CE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Nov 2022 15:35:54 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4C51F890;\n\tTue, 22 Nov 2022 15:35:54 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669127756;\n\tbh=A6ZGXx1rGKExfG6vWeVJOyHz3LpoUZaw+7t3/rERtD8=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=fiett6ebAfO8XghGB3lP+8wYNNxFZUxmgPccRKeiHM8mhpWMFl9kwUWkCeXGiEhmh\n\tXCOnGmGYJOvq/Qq7N61/nSdCXMcYf5kYgPNoUFFelkblaugP8WSINeeIVnOnXC9Jb9\n\t7YDY+eS9d3PYd/T9wI9yfRecZRZKGOszdDMfPwxCOBu/x75xt8iVmHTDPFwUMR1hmm\n\t3br4zNgys7kWqJxDMRMBzC97pYs4f45an4lLpkYhDuXD4e3ynq24ERma0r3i+jELit\n\tJzqmRPbLmDF1rhGdSEApI6cO5DPqV57T9p5wJCZty4XWEz2G4Z4muDYpsriDIExBSX\n\t8/+sWoRK+nNTQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669127754;\n\tbh=A6ZGXx1rGKExfG6vWeVJOyHz3LpoUZaw+7t3/rERtD8=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=Zl03jareMRSASUfDrH38GDEFu9ycd8Y1B7d+MVSkLsv9oJ7JTw/tMaa31JI75vK75\n\tQsfDxWB0YdgIQlPG2CfNVoK1SMyfZ8fdhV943onIzqLwVkMKLf5aQ1oLXt800aflzN\n\tMAxHySx7tDMmjtboGhRhUQjSD1F0pQQO7vSAv6+g="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Zl03jare\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20221122083005.5239-1-jacopo@jmondi.org>","References":"<20221122083005.5239-1-jacopo@jmondi.org>","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","Date":"Tue, 22 Nov 2022 14:35:52 +0000","Message-ID":"<166912775202.1079859.17253301011090237692@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] libcamera: camera_sensor: Print\n\tmissing controls names","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25860,"web_url":"https://patchwork.libcamera.org/comment/25860/","msgid":"<Y32GujQvjebZ5/NG@pendragon.ideasonboard.com>","date":"2022-11-23T02:34:34","subject":"Re: [libcamera-devel] [PATCH] libcamera: camera_sensor: Print\n\tmissing controls names","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Tue, Nov 22, 2022 at 09:30:05AM +0100, Jacopo Mondi via libcamera-devel wrote:\n> Since the very beginning the camera sensor class has validated the\n> controls available from the camera sensor driver, and complained\n> accordingly when any of them was missing.\n> \n> The complaint message reported however only the numerical identifier of\n> the V4L2 control, making debugging harder.\n> \n> Associate to each control a human readable identifier and use it in\n> debug messages.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/camera_sensor.cpp | 38 ++++++++++++++++-----------------\n>  1 file changed, 19 insertions(+), 19 deletions(-)\n> \n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index ea373458a164..0780ce5a7007 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -213,31 +213,31 @@ int CameraSensor::validateSensorDriver()\n>  \t * Optional controls are used to register optional sensor properties. If\n>  \t * not present, some values will be defaulted.\n>  \t */\n> -\tstatic constexpr uint32_t optionalControls[] = {\n> -\t\tV4L2_CID_CAMERA_SENSOR_ROTATION,\n> +\tstatic const std::map<uint32_t, std::string> optionalControls = {\n> +\t\t{ V4L2_CID_CAMERA_SENSOR_ROTATION, \"Rotation\" },\n\nWouldn't it be more explicit if the name was \"CAMERA_SENSOR_ROTATION\",\nor even \"V4L2_CID_CAMERA_SENSOR_ROTATION\" ?\n\nWe should centralize the control names somewhere, but that's a topic for\nlater.\n\n>  \t};\n>  \n>  \tconst ControlIdMap &controls = subdev_->controls().idmap();\n> -\tfor (uint32_t ctrl : optionalControls) {\n> +\tfor (const auto &[ctrl, name] : optionalControls) {\n>  \t\tif (!controls.count(ctrl))\n>  \t\t\tLOG(CameraSensor, Debug)\n> -\t\t\t\t<< \"Optional V4L2 control \" << utils::hex(ctrl)\n> -\t\t\t\t<< \" not supported\";\n> +\t\t\t\t<< \"Optional V4L2 control '\" << name\n> +\t\t\t\t<< \"' not supported\";\n>  \t}\n>  \n>  \t/*\n>  \t * Recommended controls are similar to optional controls, but will\n>  \t * become mandatory in the near future. Be loud if they're missing.\n>  \t */\n> -\tstatic constexpr uint32_t recommendedControls[] = {\n> -\t\tV4L2_CID_CAMERA_ORIENTATION,\n> +\tstatic const std::map<uint32_t, std::string> recommendedControls = {\n> +\t\t{ V4L2_CID_CAMERA_ORIENTATION, \"Orientation\" },\n>  \t};\n>  \n> -\tfor (uint32_t ctrl : recommendedControls) {\n> +\tfor (const auto &[ctrl, name] : recommendedControls) {\n>  \t\tif (!controls.count(ctrl)) {\n>  \t\t\tLOG(CameraSensor, Warning)\n> -\t\t\t\t<< \"Recommended V4L2 control \" << utils::hex(ctrl)\n> -\t\t\t\t<< \" not supported\";\n> +\t\t\t\t<< \"Recommended V4L2 control '\" << name\n> +\t\t\t\t<< \"' not supported\";\n>  \t\t\terr = -EINVAL;\n>  \t\t}\n>  \t}\n> @@ -300,20 +300,20 @@ int CameraSensor::validateSensorDriver()\n>  \t * For raw sensors, make sure the sensor driver supports the controls\n>  \t * required by the CameraSensor class.\n>  \t */\n> -\tstatic constexpr uint32_t mandatoryControls[] = {\n> -\t\tV4L2_CID_ANALOGUE_GAIN,\n> -\t\tV4L2_CID_EXPOSURE,\n> -\t\tV4L2_CID_HBLANK,\n> -\t\tV4L2_CID_PIXEL_RATE,\n> -\t\tV4L2_CID_VBLANK,\n> +\tstatic const std::map<uint32_t, std::string> mandatoryControls = {\n> +\t\t{ V4L2_CID_ANALOGUE_GAIN, \"Analogue gain\" },\n> +\t\t{ V4L2_CID_EXPOSURE, \"Exposure\" },\n> +\t\t{ V4L2_CID_HBLANK, \"Horizontal blanking\" },\n> +\t\t{ V4L2_CID_PIXEL_RATE, \"Pixel Rate\" },\n> +\t\t{ V4L2_CID_VBLANK, \"Vertical blanking\" }\n>  \t};\n>  \n>  \terr = 0;\n> -\tfor (uint32_t ctrl : mandatoryControls) {\n> +\tfor (const auto &[ctrl, name] : mandatoryControls) {\n>  \t\tif (!controls.count(ctrl)) {\n>  \t\t\tLOG(CameraSensor, Error)\n> -\t\t\t\t<< \"Mandatory V4L2 control \" << utils::hex(ctrl)\n> -\t\t\t\t<< \" not available\";\n> +\t\t\t\t<< \"Mandatory V4L2 control '\" << name\n> +\t\t\t\t<< \"' not available\";\n>  \t\t\terr = -EINVAL;\n>  \t\t}\n>  \t}","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 AF028BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 23 Nov 2022 02:34:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4437763314;\n\tWed, 23 Nov 2022 03:34:52 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C14361F2B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Nov 2022 03:34:51 +0100 (CET)","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 A965C88F;\n\tWed, 23 Nov 2022 03:34:50 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1669170892;\n\tbh=kwG9a7ijgK/+ggDjdFV776lff3CUD3ptTqARINsYUpE=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=2Kz5W9B1K2PxJgYGAN4HRNtgV6B39HDYmGnY97jLxtSQNnaYvWg2jbTXfnT5t0Hb7\n\t28POmWAkdfCrhxIifC+f7PQceXwKsuAcUEn7EMQfJySxzTJ2qCNrbPTIVUxTKUB7vS\n\twnBxqqoc+W5vE5vkqfSsQSsV2g/L6rRwClD1GZ1TSgAAWVctxCgtywCRV8OkjIKeyO\n\tTmLUZ+VN+mWTAhMEDWyx8Os/o3Gfxxg/Kb6FnAJfha4r4tyxEEIDFH8bANunhtbxWa\n\tE9jg9nVKHzROj7XkkbE8lt7UwAnDw08kc3MpooG663kPOy+dkkYtKib0Y2H+anZ6w8\n\tDCdn6ETwOHTjQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1669170890;\n\tbh=kwG9a7ijgK/+ggDjdFV776lff3CUD3ptTqARINsYUpE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=RAKXJs3ClSn9UCQUPPdmWAjch76ORvJuRJcNKiVJU1c4QW2BLJ1LOT6wibsGYAFRF\n\t3VNlu5BgYtvnpUf7kJAdze8c7tDcBxCvzow+2TyMz4I4JZokBpUY3iOLhUgexKoBlg\n\tq51EmeVZcWtuAfBJ+mBngwABl1/TTNGce/xmOuew="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"RAKXJs3C\"; dkim-atps=neutral","Date":"Wed, 23 Nov 2022 04:34:34 +0200","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<Y32GujQvjebZ5/NG@pendragon.ideasonboard.com>","References":"<20221122083005.5239-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221122083005.5239-1-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: camera_sensor: Print\n\tmissing controls names","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]