Patch Detail
Show a patch.
GET /api/1.1/patches/12435/?format=api
{ "id": 12435, "url": "https://patchwork.libcamera.org/api/1.1/patches/12435/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12435/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210527053230.1329602-1-paul.elder@ideasonboard.com>", "date": "2021-05-27T05:32:30", "name": "[libcamera-devel] utils: ipc: mojo: Error if ControlInfoMap/List doesn't prefix libcamera", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c224facf279ea2355cb28f6bcb2d9dbd255c07dc", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12435/mbox/", "series": [ { "id": 2078, "url": "https://patchwork.libcamera.org/api/1.1/series/2078/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2078", "date": "2021-05-27T05:32:30", "name": "[libcamera-devel] utils: ipc: mojo: Error if ControlInfoMap/List doesn't prefix libcamera", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2078/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12435/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12435/checks/", "tags": {}, "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 1B992BDB80\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 May 2021 05:32:55 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 920DF68924;\n\tThu, 27 May 2021 07:32:54 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C1DF6891F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 May 2021 07:32:53 +0200 (CEST)", "from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D1CF78DE;\n\tThu, 27 May 2021 07:32:51 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"JLI9ORCp\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1622093573;\n\tbh=B+vcNZDxjfiHzqQxZGDB1Jevljx3n/7Lk2ch6jO7TvY=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=JLI9ORCpnyGkRyh2JzlSesMgbdSgoty7Ix56rpjWR0RCahozzsHmzlNjOYg0C1OMt\n\tuD6myg106LlU0pJ23uFJtZYDbCZntxRpS9xEd/RtzBgpQVzqDGLhZrqlHgTLXctJd3\n\ttN3aMbyfP1rlu4IpXOBKf8VGW1QjSTRmRa//zHKw=", "From": "Paul Elder <paul.elder@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 27 May 2021 14:32:30 +0900", "Message-Id": "<20210527053230.1329602-1-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] utils: ipc: mojo: Error if\n\tControlInfoMap/List doesn't prefix libcamera", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The mojo parser is fine if there are types that are used in array/map\nmembers that it does not know about. These are usually caught by the C++\ncompiler, because the generated code refers to unknown types. This\nfeature is necessary for us for supporting FrameBuffer::Plane as an\narray/map member, since as long as the type has an IPADataSerializer and\nthe struct defined in C++, the generated code will run fine\n(FrameBuffer::Plane is not defined anywhere in mojom but is used as an\narray member in IPABuffer).\n\nThe types that are defined in controls.h (or any header included in\nipa_interface.h) will all be compiled by the C++ compiler fine, since\nthe generated files all include controls.h. The types that are there\nthat are not ControlInfoMap or ControlList (like ControlValue) will\nstill fail at the linker stage. For example:\n\nstruct A {\n\tarray<ControlValue> a;\n};\n\nwill compile fine, but will fail to link, since\nIPADataSerializer<ControlValue> doesn't exist. This behavior, although\nnot the best, is acceptable.\n\nThe issue is that if ControlInfoMap or ControlList are used as array/map\nmembers without the libcamera prefix, the compiler will not complain, as\nthe types are valid, and the linker will also not complain, as\nIPADataSerializer<ControlList> and IPADataSerializer<ControlInfoMap>\nboth exist. However, the code generator will not recognize them as\ntypes that require a ControlSerializer (since mojo doesn't recognize\nthem, so they are different from the ones that it does recognize with\nthe libcamera namespace), and so the ControlSerializer will not be\npassed to the serializer in the generated code. This is the cause of the\nFATAL breakage:\n\n FATAL IPADataSerializer ipa_data_serializer.cpp:437 ControlSerializer\n not provided for serialization of ControlInfoMap\n\nSince ControlInfoMap and ControlList are the only types that will run\ninto this issue, we solve this by simply detecting if they are used\nwithout the prefix, and produce an error at that point in the code\ngenerator. As the code generator stage no longer has information on the\nsource code file and line, we output the struct name in which the error\nwas found (ninja will output the file name).\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n utils/ipc/generators/mojom_libcamera_generator.py | 4 ++++\n 1 file changed, 4 insertions(+)", "diff": "diff --git a/utils/ipc/generators/mojom_libcamera_generator.py b/utils/ipc/generators/mojom_libcamera_generator.py\nindex effdfed6..25cacf9a 100644\n--- a/utils/ipc/generators/mojom_libcamera_generator.py\n+++ b/utils/ipc/generators/mojom_libcamera_generator.py\n@@ -129,6 +129,10 @@ def GetAllAttrs(element):\n \n def NeedsControlSerializer(element):\n types = GetAllTypes(element)\n+ if 'x:ControlList' in types:\n+ raise Exception(f'Unknown type \"ControlList\" in {element.mojom_name}, did you mean \"libcamera.ControlList\"?')\n+ if 'x:ControlInfoMap' in types:\n+ raise Exception(f'Unknown type \"ControlInfoMap\" in {element.mojom_name}, did you mean \"libcamera.ControlInfoMap\"?')\n return \"ControlList\" in types or \"ControlInfoMap\" in types\n \n def HasFd(element):\n", "prefixes": [ "libcamera-devel" ] }