[{"id":23514,"web_url":"https://patchwork.libcamera.org/comment/23514/","msgid":"<57d64c08-dff5-c4a6-2d09-d93e2bc34f65@yoseli.org>","date":"2022-06-21T18:22:30","subject":"Re: [libcamera-devel] [PATCH 2/3] libcamera: control_ids: Separate\n\tthe id numerical space","submitter":{"id":127,"url":"https://patchwork.libcamera.org/api/people/127/","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@yoseli.org"},"content":"Hi Jacopo,\n\nOn 21/06/2022 17:03, Jacopo Mondi via libcamera-devel wrote:\n> Separate the internal and public control id numerical space by\n> placing the internal controls at offset 0x1000.\n\nI don't expect we will have more than 4096 controls in the public part:\nReviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>\n\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>   utils/gen-controls.py | 10 +++++++---\n>   1 file changed, 7 insertions(+), 3 deletions(-)\n> \n> diff --git a/utils/gen-controls.py b/utils/gen-controls.py\n> index 978179f63858..63e888546277 100755\n> --- a/utils/gen-controls.py\n> +++ b/utils/gen-controls.py\n> @@ -118,7 +118,7 @@ ${description}\n>       }\n>   \n>   \n> -def generate_h(controls):\n> +def generate_h(internal, controls):\n>       enum_template_start = string.Template('''enum ${name}Enum {''')\n>       enum_value_template = string.Template('''\\t${name} = ${value},''')\n>       enum_values_template = string.Template('''extern const std::array<const ControlValue, ${size}> ${name}Values;''')\n> @@ -133,7 +133,11 @@ def generate_h(controls):\n>           name, ctrl = ctrl.popitem()\n>           id_name = snake_case(name).upper()\n>   \n> -        ids.append('\\t' + id_name + ' = ' + str(id_value) + ',')\n> +        # Separate the internal and public controls id space\n> +        if internal:\n> +            ids.append('\\t' + id_name + ' = ' + \"0x1000 | \" + str(id_value) + ',')\n> +        else:\n> +            ids.append('\\t' + id_name + ' = ' + str(id_value) + ',')\n>   \n>           ctrl_type = ctrl['type']\n>           if ctrl_type == 'string':\n> @@ -218,7 +222,7 @@ def main(argv):\n>       if args.template.endswith('.cpp.in'):\n>           data = generate_cpp(controls)\n>       elif args.template.endswith('.h.in'):\n> -        data = generate_h(controls)\n> +        data = generate_h(args.internal, controls)\n>       else:\n>           raise RuntimeError('Unknown template type')\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 3AF9BBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 21 Jun 2022 18:22:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E658D65634;\n\tTue, 21 Jun 2022 20:22:32 +0200 (CEST)","from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E98260473\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jun 2022 20:22:31 +0200 (CEST)","(Authenticated sender: jeanmichel.hautbois@yoseli.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 1E71120009;\n\tTue, 21 Jun 2022 18:22:30 +0000 (UTC)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655835753;\n\tbh=LvYxhRWLtuQ28w1gRzXig7EEAzos8fD2sYK43Sw4Jzg=;\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=0NHhzEZAFLjgXyEI8PF8MJYZI0G4wGJ6ZHfxLIIi7JVSd1xwUxf1zGVb7V1pQauNv\n\t/nHKTLfYu35g8y+qfBjxBaCpjoCCVQXQ2wWAeB+i/tx2eMxjxhHWbS7+dp8fejECix\n\tPMjN++RXqXJJxQIgrJT2EGWWkyCeIQM2qJkw2TbyY98GgRA8DdL9+eySHx9qBY8Tyk\n\t9vxNcwkdwJGFHntwGOqRIOR45d4+0gVg9VOXWkwrS+/nO5VbI3MH2n1rCckt1WgflB\n\tDzdnWeQin2tiJnQVY8pphrMIoNCdXD6+EqdyFZnYLhrpAIkPJ3YVBBqka/PhWlbe4H\n\t03GJ/XfQHqkTQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoseli.org; s=gm1;\n\tt=1655835751;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=U6baseVF5bsllMrKXPXiReo0K8N31GKtMSBkZ8ZHOXU=;\n\tb=UZZMj0sikGlnE8aZrGGpYQMYLTgHseabbS+PZ1+FzPi5k26ekWpqJaru803SqeHb/A47Bf\n\tj0bsyESUvQYdAG9PufjmuWIGgpo0eoK11LSt3Y0zF/4luuVcc+ukPTj+QL5h+KMVcZ6Nsx\n\tYIEAsSZqIiyuBW7B/qK/HWFzIm0Kj0r7FHwOmy1J7msdsxUwImNdz+wXIZdx6M3T/vd/Dd\n\tTJie21ySzbO/ggrN6UQmMIekC3ToRTmJV1XurATs4RMw3mC/0vFWipeVYBAGH4YXt8iO6b\n\thq5sZgmpubujZpdWVLNXm4L4in5P7IVTJhDVrB8rIfa6+uIHr3ATCF5Z7IWKoQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=yoseli.org\n\theader.i=@yoseli.org header.b=\"UZZMj0si\"; \n\tdkim-atps=neutral","Message-ID":"<57d64c08-dff5-c4a6-2d09-d93e2bc34f65@yoseli.org>","Date":"Tue, 21 Jun 2022 20:22:30 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.9.1","Content-Language":"en-US","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","References":"<20220621150337.47839-1-jacopo@jmondi.org>\n\t<20220621150337.47839-3-jacopo@jmondi.org>","In-Reply-To":"<20220621150337.47839-3-jacopo@jmondi.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 2/3] libcamera: control_ids: Separate\n\tthe id numerical space","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":"Jean-Michel Hautbois via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]