Show a patch.

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

{
    "id": 9202,
    "url": "https://patchwork.libcamera.org/api/patches/9202/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9202/",
    "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": "<20200804214711.177645-10-kieran.bingham@ideasonboard.com>",
    "date": "2020-08-04T21:47:07",
    "name": "[libcamera-devel,v3,09/13] android: camera_device: Query plane length",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "db433df4a3a3028a4cd3e98fa1622d850e54dc25",
    "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/9202/mbox/",
    "series": [
        {
            "id": 1191,
            "url": "https://patchwork.libcamera.org/api/series/1191/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1191",
            "date": "2020-08-04T21:46:58",
            "name": "android: JPEG support",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1191/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9202/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9202/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 3BB31BD87A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  4 Aug 2020 21:47:25 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 053BC60561;\n\tTue,  4 Aug 2020 23:47:25 +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 145D660555\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  4 Aug 2020 23:47:20 +0200 (CEST)",
            "from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net\n\t[86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 93D3ED3A;\n\tTue,  4 Aug 2020 23:47:19 +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=\"rcj8GHeT\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1596577639;\n\tbh=UrIP0C+Mn5wKh68gwLr6O3QsOlhjsxdlRpDD5geknQQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rcj8GHeTMuq8wdyrqJ/7eTQOOKG35krmSdbzAKuwA4is/ackuGFUY4Mn6DSdoaEwD\n\tt4KLp99kKl3ZhRaEBo0VGHlWro2GLMhQpNC+SFWfRHn5ag0pVja2x+sBcCmZjLg2Fy\n\tQVhcL3IgnDl5rM3xZo9kCbCpapf7aBEAKF/eRgCE=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "libcamera devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Tue,  4 Aug 2020 22:47:07 +0100",
        "Message-Id": "<20200804214711.177645-10-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200804214711.177645-1-kieran.bingham@ideasonboard.com>",
        "References": "<20200804214711.177645-1-kieran.bingham@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v3 09/13] android: camera_device: Query\n\tplane length",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Use lseek to query the length of planes where possible rather than leaving\nthe plane.length as zero, which prevents mapping buffers for software\nprocessing.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\nv3\n - Return nullptr if we fail to query plane length\n\nv2:\n - no longer support an invalid plane length.\n---\n src/android/camera_device.cpp | 13 +++++++------\n 1 file changed, 7 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 087e226f5a82..5899154b3e78 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1096,12 +1096,13 @@ FrameBuffer *CameraDevice::createFrameBuffer(const buffer_handle_t camera3buffer\n \t\t\tbreak;\n \t\t}\n \n-\t\t/*\n-\t\t * Setting length to zero here is OK as the length is only used\n-\t\t * to map the memory of the plane. Libcamera do not need to poke\n-\t\t * at the memory content queued by the HAL.\n-\t\t */\n-\t\tplane.length = 0;\n+\t\toff_t length = lseek(plane.fd.fd(), 0, SEEK_END);\n+\t\tif (length == -1) {\n+\t\t\tLOG(HAL, Error) << \"Failed to query plane length\";\n+\t\t\treturn nullptr;\n+\t\t}\n+\n+\t\tplane.length = length;\n \t\tplanes.push_back(std::move(plane));\n \t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "09/13"
    ]
}