Show a patch.

GET /api/1.1/patches/23368/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 23368,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/23368/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/23368/",
    "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": "<20250515120012.3127231-4-barnabas.pocze@ideasonboard.com>",
    "date": "2025-05-15T12:00:07",
    "name": "[RFC,v1,3/8] utils: codegen: ipc: Add `deserializer()` function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c7e8d79f985661f3f177f90e75f96f4cdeaa45b6",
    "submitter": {
        "id": 216,
        "url": "https://patchwork.libcamera.org/api/1.1/people/216/?format=api",
        "name": "Barnabás Pőcze",
        "email": "barnabas.pocze@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/23368/mbox/",
    "series": [
        {
            "id": 5173,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5173/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5173",
            "date": "2025-05-15T12:00:04",
            "name": "utils: codegen: ipc: Simplify deserialization",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5173/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/23368/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/23368/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 426D8C3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 May 2025 12:00:29 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B38768D72;\n\tThu, 15 May 2025 14:00:24 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4041468B6F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 May 2025 14:00:17 +0200 (CEST)",
            "from pb-laptop.local (185.221.142.248.nat.pool.zt.hu\n\t[185.221.142.248])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 34FA0A98;\n\tThu, 15 May 2025 14:00:00 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"YW6wJd6F\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747310400;\n\tbh=/B3sXhpwkTa5Gg7mdJMHshgtvVqSlm4UlwZ4Fsaw5Cg=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=YW6wJd6FelkBbcRCTVmV28Nog00My/9EQqd7bnmYcg2K8Rf+majKhO6/zv6hwefb7\n\tNaIgDED4QaJn2Uq1ysPKWvNsjJ6T/Dv3iEfzSa0KLO77gG8uzJu/dRfXigVFLedw0I\n\teaNOGsAb//8aK/LuJUqopFysWJJ2GwcPhShEpD7U=",
        "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Paul Elder <paul.elder@ideasonboard.com>",
        "Subject": "[RFC PATCH v1 3/8] utils: codegen: ipc: Add `deserializer()`\n\tfunction",
        "Date": "Thu, 15 May 2025 14:00:07 +0200",
        "Message-ID": "<20250515120012.3127231-4-barnabas.pocze@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.49.0",
        "In-Reply-To": "<20250515120012.3127231-1-barnabas.pocze@ideasonboard.com>",
        "References": "<20250515120012.3127231-1-barnabas.pocze@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "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": "Add `deserializer()` in `serializer.tmpl` to have a single function\nthat generates all the necessary functions into the template specialization\nlike `serializer()`. This also avoids the duplication of some\nconditional logic.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n .../libcamera_templates/core_ipa_serializer.h.tmpl |  7 +------\n .../module_ipa_serializer.h.tmpl                   |  7 +------\n .../generators/libcamera_templates/serializer.tmpl | 14 ++++++++++++++\n 3 files changed, 16 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/utils/codegen/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl\nindex cbb35ef51..ac84963dc 100644\n--- a/utils/codegen/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl\n+++ b/utils/codegen/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl\n@@ -32,12 +32,7 @@ class IPADataSerializer<{{struct|name}}>\n {\n public:\n {{- serializer.serializer(struct)}}\n-{%- if struct|has_fd %}\n-{{serializer.deserializer_fd(struct)}}\n-{%- else %}\n-{{serializer.deserializer_no_fd(struct)}}\n-{{serializer.deserializer_fd_simple(struct)}}\n-{%- endif %}\n+{{- serializer.deserializer(struct)}}\n };\n {% endfor %}\n \ndiff --git a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl\nindex f3b8e3b15..65a7dd11c 100644\n--- a/utils/codegen/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl\n+++ b/utils/codegen/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl\n@@ -33,12 +33,7 @@ class IPADataSerializer<{{struct|name_full}}>\n {\n public:\n {{- serializer.serializer(struct)}}\n-{%- if struct|has_fd %}\n-{{serializer.deserializer_fd(struct)}}\n-{%- else %}\n-{{serializer.deserializer_no_fd(struct)}}\n-{{serializer.deserializer_fd_simple(struct)}}\n-{%- endif %}\n+{{- serializer.deserializer(struct)}}\n };\n {% endfor %}\n \ndiff --git a/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl b/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl\nindex 114e349c9..d07836cc1 100644\n--- a/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl\n+++ b/utils/codegen/ipc/generators/libcamera_templates/serializer.tmpl\n@@ -317,3 +317,17 @@\n \t\treturn ret;\n \t}\n {%- endmacro %}\n+\n+{#\n+ # \\brief Deserialize a struct\n+ #\n+ # Generate code for IPADataSerializer specialization, for deserializing \\a struct.\n+ #}\n+{%- macro deserializer(struct) %}\n+{%- if struct|has_fd %}\n+{{deserializer_fd(struct)}}\n+{%- else %}\n+{{deserializer_no_fd(struct)}}\n+{{deserializer_fd_simple(struct)}}\n+{%- endif %}\n+{%- endmacro %}\n",
    "prefixes": [
        "RFC",
        "v1",
        "3/8"
    ]
}