[{"id":26911,"web_url":"https://patchwork.libcamera.org/comment/26911/","msgid":"<20230420025518.GD631@pendragon.ideasonboard.com>","date":"2023-04-20T02:55:18","subject":"Re: [libcamera-devel] [PATCH 1/3] libcamera: controls: Support\n\tdev_t in an Integer32 type.","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Wed, Apr 19, 2023 at 09:58:19AM +0100, Kieran Bingham via libcamera-devel wrote:\n> Allow dev_t device numbers to be stored in a ControlValue utilising the\n> space of a 32 bit integer.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n> \n> Note that dev_t is typedef'd as an unsigned long, and this allows all\n> unsigned long types to be mapped to a ControlTypeInteger32.\n\n\"unsigned long\" is a 64-bit value on 64-bit platforms.\n\n> I'm not sure I like that bit, so I'm very open to ideas and suggestions\n> here. Ideally without having to duplicate the devnum vector just after\n> it's created, just to retype it.\n\nHow about using ControlTypeInteger64 and converting the devnums vector\nto a vector or int64_t internally ?\n\n>  include/libcamera/controls.h | 5 +++++\n>  1 file changed, 5 insertions(+)\n> \n> diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\n> index cf94205577a5..84033babbcd5 100644\n> --- a/include/libcamera/controls.h\n> +++ b/include/libcamera/controls.h\n> @@ -62,6 +62,11 @@ struct control_type<int32_t> {\n>  \tstatic constexpr ControlType value = ControlTypeInteger32;\n>  };\n>  \n> +template<>\n> +struct control_type<dev_t> {\n> +\tstatic constexpr ControlType value = ControlTypeInteger32;\n> +};\n> +\n>  template<>\n>  struct control_type<int64_t> {\n>  \tstatic constexpr ControlType value = ControlTypeInteger64;","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 CF1C0BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Apr 2023 02:55:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 22BF7627C2;\n\tThu, 20 Apr 2023 04:55:07 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9C00761EB6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Apr 2023 04:55:05 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(133-32-181-51.west.xps.vectant.ne.jp [133.32.181.51])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DA0F89DE;\n\tThu, 20 Apr 2023 04:54:57 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681959307;\n\tbh=H6GoAZHT4ElZF8+cG0IM5kRhWTf4pIoz+G1xJOo/t24=;\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=yyAgj1HRjPboVT7iWDD7rui3EeVvSvlCAkI6f4VbW9E1nOIM8gYCf82mH8/9x08qV\n\tzWHrw+EBrRoHlUdgIrZixITYrf9ts3Q3k52+Tb1r3vo65qunGLUbCkLwdJkzDx6s3+\n\tq5JvsLCNX4bPuGcDfg/Gjrh2Cce4Uc/AuMCI9OWSfhOLFvNkARfClIPjEsimylIdYD\n\tkpFf+O9apNebymtiwZrZYznFBUpoahH0fN8EaoWzFZr2saxKWB1AerscU5AKur4ERt\n\taKCs5u3IysUaXzWS3jQ/i5897+fksQeGMrCO2afkoTBQlFR9Kn6Plv20j7p/wpKPte\n\t66Hg/RM00uJ+w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681959298;\n\tbh=H6GoAZHT4ElZF8+cG0IM5kRhWTf4pIoz+G1xJOo/t24=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=nTpuc84LJVr0gsfIMA54xgN8CXZmbKDm+PnNcn11/V5IjmFfdmeVPUuL6xM/dm4lU\n\tlLS8Ms6xNSim6siNMsiVv/owCay6+Rxv/q2WMM9aU2A3vMepSksBkt1Ovk+80wNBPN\n\tRXF3IacaEi/VSVdvSLABc3gbKLthP8SOe6JNtfjQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"nTpuc84L\"; dkim-atps=neutral","Date":"Thu, 20 Apr 2023 05:55:18 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20230420025518.GD631@pendragon.ideasonboard.com>","References":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>\n\t<20230419085821.2682901-2-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230419085821.2682901-2-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 1/3] libcamera: controls: Support\n\tdev_t in an Integer32 type.","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 <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]