From patchwork Tue Oct 11 10:58:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 17578 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8587FC0DA4 for ; Tue, 11 Oct 2022 10:59:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B447C62D6F; Tue, 11 Oct 2022 12:59:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665485953; bh=1zLTBDEgUo//Xd4pdASXI/Mt5/UiH0bRq2+dpitgs5E=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=NsOoObD8cQxE2dK1M4sQ7L4Q3g5y2S4YD36MJQRzWHzPyJS1Dj/mrUAUpGcWEEoIR Mx5p9YuhjWMyd3S3zwYocXgZCCoFjvRPIOMLwcZGjrtF3T8WmJf1kjYHomyprbi1lp gEHZhtDkToGr7wKTlN264/612nqZp8LpCzuvPHvo9/4v+18I0b1PTdqon/gNICdk4R zzwDjhklJ+kqe4gKNudPQWkLp/zpaLPUKWn+j4D/vaMkRpFFaE/avcBP+c9xgwMRM8 dUIGJ9gHOsxtwAdM/xgUQefLbEtaCOCVa2aBcbESDT9nOUXDmy7hwwtDM7N/F/RUeT gJL9AwX/EiuLw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A5E53603F3 for ; Tue, 11 Oct 2022 12:59:12 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="mKIns3mX"; dkim-atps=neutral Received: from pyrite.rasen.tech (h175-177-042-159.catv02.itscom.jp [175.177.42.159]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id F35DC907; Tue, 11 Oct 2022 12:59:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1665485952; bh=1zLTBDEgUo//Xd4pdASXI/Mt5/UiH0bRq2+dpitgs5E=; h=From:To:Cc:Subject:Date:From; b=mKIns3mX7pMjjN7UaRRYcmf3z1nRRjRZ6naN9j/HmA+TuvZ0G5QI2rCXY4RVtLinz EBUvn9WrdBiHdOM+uYfqDxyYDSIww+xr5aECKKWcGzIdZWPi/RUc/AGiWqnH5uq8Kq V+im7Q2XHdoo8Co2UAQyxs0SQ+TZt5JrSTEKu8UU= To: libcamera-devel@lists.libcamera.org Date: Tue, 11 Oct 2022 19:58:50 +0900 Message-Id: <20221011105859.457567-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/9] utils: ipc: Add support for enums and Flags X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" v5 fixes a mistake in the scopedEnum implementation in v4, and adds support for skipHeader to enums defined in core.mojom, so that they can be defined in a C++ header and not redefined in mojom. This patch series adds support for enums in function parameters, and Flags all-around. "all-around" does happen to exclude direct function return values, though. Patches 1~2 touch enums, where the first patch adds a test for current enum support that hasn't been tested before, and the second actually adds support for enums in function parameters. Patches 3~4 add support for Flags, and 5 adds a test for it. Patches 6 and 7 extend vimc to have dummy function parameters that are enums and Flags to test enums and Flags as function parameters. Patch 8 (new in v5) adds support for skipHeader. This was originally going to posted on top after the rest of the series was merged, but I found an issue with serialization of scoped enums directly, so this series is getting a new version :/ Patch 9 adds a test for scoped enums and flags that are designated as skipHeader. It touches core components (it has to, because that's the only place that skipHeader enums can be defined), so it's set as RFC. Paul Elder (9): test: generated_serializer: Test enum that is struct member utils: ipc: Add support for enums in function parameters libcamera: ipa_data_serializer: Add serializer for Flags utils: ipc: Add support for Flags test: generated_serializer: Test Flags that is struct member ipa: vimc: Add IPAOperationCode to init() parameter list ipa: vimc: Add Flags to parameters utils: ipc: Allow the skipHeader attribute on enums [RFC] test: generated_serializer: Test skipHeader enums and flags .../libcamera/internal/ipa_data_serializer.h | 46 +++++++++++++++++++ include/libcamera/ipa/core.mojom | 15 +++++- include/libcamera/ipa/ipa_interface.h | 12 ++++- include/libcamera/ipa/vimc.mojom | 14 +++++- src/ipa/vimc/vimc.cpp | 22 +++++++-- src/libcamera/pipeline/vimc/vimc.cpp | 15 ++++-- test/ipa/ipa_interface_test.cpp | 6 ++- .../generated_serializer_test.cpp | 36 +++++++++++++++ .../include/libcamera/ipa/test.mojom | 14 ++++++ .../core_ipa_interface.h.tmpl | 2 +- .../definition_functions.tmpl | 2 +- .../module_ipa_interface.h.tmpl | 2 +- .../module_ipa_proxy.h.tmpl | 2 +- .../libcamera_templates/proxy_functions.tmpl | 20 +++++++- .../libcamera_templates/serializer.tmpl | 6 +++ .../generators/mojom_libcamera_generator.py | 39 ++++++++++++++-- 16 files changed, 231 insertions(+), 22 deletions(-)