Show a patch.

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

{
    "id": 13599,
    "url": "https://patchwork.libcamera.org/api/patches/13599/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13599/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20210902042303.2254-6-laurent.pinchart@ideasonboard.com>",
    "date": "2021-09-02T04:22:56",
    "name": "[libcamera-devel,RFC,v1,05/12] libcamera: framebuffer: Move planes check to constructor",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "314cc566f16d2dafb34ddac3942a57c5c3610788",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13599/mbox/",
    "series": [
        {
            "id": 2435,
            "url": "https://patchwork.libcamera.org/api/series/2435/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2435",
            "date": "2021-09-02T04:22:51",
            "name": "libcamera: Handle fallout of FrameBuffer offset support",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2435/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13599/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13599/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 1F111C3243\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  2 Sep 2021 04:23:30 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D12CA69180;\n\tThu,  2 Sep 2021 06:23:28 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2069869167\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  2 Sep 2021 06:23:25 +0200 (CEST)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A611745E;\n\tThu,  2 Sep 2021 06:23:24 +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=\"o1OcaqG1\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630556604;\n\tbh=p+5LZdOtA9bp4navCtHQ0fcbILuRsaD5UZbhHGPVtBk=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=o1OcaqG1INo32oE/ffmnbSL9BCfP0393krZ2CYhjaSgzFPYGdj8cVHIgp4rLSDFFT\n\t41UY926VapdAyqcn54RQQA9qtp/b/7pqv0Cq97dWz7jDqmaCrS70k6DtUHB1Dl6ksY\n\thNvMyUUnSWxtR9XDYsESt2mA7bMlWNeGPgyaX1r0=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu,  2 Sep 2021 07:22:56 +0300",
        "Message-Id": "<20210902042303.2254-6-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210902042303.2254-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20210902042303.2254-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH v1 05/12] libcamera: framebuffer: Move\n\tplanes check to constructor",
        "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 FrameBuffer::planes() function checks that planes are correctly\ninitialized with an offset. This can be done at construction time\ninstead, as the planes are constant. The runtime overhead is reduced,\nand the backtrace generated by the assertion will show where the faulty\nframe buffer is created instead of where it is used, easing debugging.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/framebuffer.h | 9 +--------\n src/libcamera/framebuffer.cpp   | 3 +++\n 2 files changed, 4 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h\nindex d5aeff00387b..fd68ed0a139d 100644\n--- a/include/libcamera/framebuffer.h\n+++ b/include/libcamera/framebuffer.h\n@@ -51,14 +51,7 @@ public:\n \n \tFrameBuffer(const std::vector<Plane> &planes, unsigned int cookie = 0);\n \n-\tconst std::vector<Plane> &planes() const\n-\t{\n-\t\t/* \\todo Remove the assertions after sufficient testing */\n-\t\tfor (const auto &plane : planes_)\n-\t\t\tassert(plane.offset != Plane::kInvalidOffset);\n-\t\treturn planes_;\n-\t}\n-\n+\tconst std::vector<Plane> &planes() const { return planes_; }\n \tRequest *request() const;\n \tconst FrameMetadata &metadata() const { return metadata_; }\n \ndiff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp\nindex c99f5b15e6ff..53ef89bf458f 100644\n--- a/src/libcamera/framebuffer.cpp\n+++ b/src/libcamera/framebuffer.cpp\n@@ -199,6 +199,9 @@ FrameBuffer::FrameBuffer(const std::vector<Plane> &planes, unsigned int cookie)\n \t: Extensible(std::make_unique<Private>()), planes_(planes),\n \t  cookie_(cookie)\n {\n+\t/* \\todo Remove the assertions after sufficient testing */\n+\tfor (const auto &plane : planes_)\n+\t\tASSERT(plane.offset != Plane::kInvalidOffset);\n }\n \n /**\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "v1",
        "05/12"
    ]
}