Show a patch.

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

{
    "id": 14133,
    "url": "https://patchwork.libcamera.org/api/patches/14133/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14133/",
    "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": "<20211014085405.3795243-1-kieran.bingham@ideasonboard.com>",
    "date": "2021-10-14T08:54:05",
    "name": "[libcamera-devel] libcamera: v4l2_videodevice: Explain multiplanar bytesused reasoning",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "80c9b07bce510d70f621f3ce6190bc2f927290c6",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14133/mbox/",
    "series": [
        {
            "id": 2625,
            "url": "https://patchwork.libcamera.org/api/series/2625/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2625",
            "date": "2021-10-14T08:54:05",
            "name": "[libcamera-devel] libcamera: v4l2_videodevice: Explain multiplanar bytesused reasoning",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2625/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14133/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14133/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 8DA96BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 14 Oct 2021 08:54:13 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D4CAA68F4F;\n\tThu, 14 Oct 2021 10:54:12 +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 2539268F4A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 14 Oct 2021 10:54:11 +0200 (CEST)",
            "from Monstersaurus.ksquared.org.uk.beta.tailscale.net\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A3FB62F3;\n\tThu, 14 Oct 2021 10:54:10 +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=\"hC9Blztf\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634201650;\n\tbh=s/DOZzV76+3i2lS9/fxtMqv9SFBa1sxZIIohC3noL3s=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=hC9BlztfHg+xR2uLpZOw0DyF1CMlA1oleil8O4Oh0LuQpBen5bMGa24ikRycdDlQo\n\tbtAbcqkpgaEldo9p2MU7q6d032obN21dQZyIVI7JUQz4qFm1kEfUf1izzscW3/mel1\n\tX0DKWGpFujQuf0bbLeHpYUgFXt5kDAxvkfmrT3zU=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Thu, 14 Oct 2021 09:54:05 +0100",
        "Message-Id": "<20211014085405.3795243-1-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Explain\n\tmultiplanar bytesused reasoning",
        "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 ternary operation used to get the total bytesused of a V4L2 single\nplanar format which is stored in a multiplanar buffer can easily be\nmis-read to think it's a bug, and appears to be reading the value of the\nfirst of N planes as the total.\n\nDirectly explain the reasoning for why it looks like the condition is\ninverted, as it is correct that the total bytes used is stored in only\nthe first plane of the multiplanar buffer.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/v4l2_videodevice.cpp | 1 +\n 1 file changed, 1 insertion(+)",
    "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex ba5f88cd41ed..f4752f8bb23f 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1711,6 +1711,7 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer()\n \t\t\treturn buffer;\n \t\t}\n \n+\t\t/* Single planar format stored in a multiplanar buffer */\n \t\tunsigned int bytesused = multiPlanar ? planes[0].bytesused\n \t\t\t\t       : buf.bytesused;\n \n",
    "prefixes": [
        "libcamera-devel"
    ]
}