Show a patch.

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

{
    "id": 1683,
    "url": "https://patchwork.libcamera.org/api/patches/1683/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1683/",
    "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": "<20190713172351.25452-3-laurent.pinchart@ideasonboard.com>",
    "date": "2019-07-13T17:23:37",
    "name": "[libcamera-devel,v2,02/16] libcamera: camera: Don't check buffer count before freeing buffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "00efee6c2aabb99a805d0440bf7f859776138c78",
    "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/1683/mbox/",
    "series": [
        {
            "id": 430,
            "url": "https://patchwork.libcamera.org/api/series/430/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=430",
            "date": "2019-07-13T17:23:35",
            "name": "Add support for external buffers",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/430/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1683/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1683/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1A93E6175D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Jul 2019 19:24:28 +0200 (CEST)",
            "from pendragon.ideasonboard.com (softbank126209254147.bbtec.net\n\t[126.209.254.147])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BD85A2B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Jul 2019 19:24:26 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1563038667;\n\tbh=CgQ2O/+AQhBnbdoGGmgOysR85DTzo4B4OUSV1DEUV4o=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=HwJBjqfDgOfFTNdLG9507rho6r9AQGtQJirAw5eEO1uuI1sQ2rV3vA1rPUFr/CyJy\n\t9Clhc/XoAsy905aMjUu9pFahDjP2Pmz/ODTqVu8wG/XP+w4zGL0GDaRQh42ccklELA\n\t0kcV1zahq5EbupRw+SJTzkmlKfrHs2oo9w11+jWU=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 13 Jul 2019 20:23:37 +0300",
        "Message-Id": "<20190713172351.25452-3-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190713172351.25452-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20190713172351.25452-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 02/16] libcamera: camera: Don't check\n\tbuffer count before freeing buffers",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Sat, 13 Jul 2019 17:24:28 -0000"
    },
    "content": "There's no need to check if buffers have been allocated before freeing\nthem as the BufferPool::destroyBuffers() method is a no-op when no\nbuffers have been allocated. Document this fact explicitly, and remove\nthe buffer count check.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/buffer.cpp | 3 +++\n src/libcamera/camera.cpp | 3 ---\n 2 files changed, 3 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp\nindex d86278a8a90a..c0a020942f5c 100644\n--- a/src/libcamera/buffer.cpp\n+++ b/src/libcamera/buffer.cpp\n@@ -311,6 +311,9 @@ void BufferPool::createBuffers(unsigned int count)\n \n /**\n  * \\brief Release all buffers from pool\n+ *\n+ * If no buffers have been created or if buffers have already been released no\n+ * operation is performed.\n  */\n void BufferPool::destroyBuffers()\n {\ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 094f1b63b7f1..810cb1295f34 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -740,9 +740,6 @@ int Camera::freeBuffers()\n \t\treturn -EACCES;\n \n \tfor (Stream *stream : activeStreams_) {\n-\t\tif (!stream->bufferPool().count())\n-\t\t\tcontinue;\n-\n \t\t/*\n \t\t * All mappings must be destroyed before buffers can be freed\n \t\t * by the V4L2 device that has allocated them.\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "02/16"
    ]
}