Show a patch.

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

{
    "id": 4189,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/4189/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/4189/",
    "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": "<20200623190836.53446-16-paul.elder@ideasonboard.com>",
    "date": "2020-06-23T19:08:29",
    "name": "[libcamera-devel,v3,15/22] v4l2: v4l2_camera_proxy: Reset buffer flags on reqbufs 0",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "afbdaaf61558ff4750e15a732094250de9e8ce8f",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/4189/mbox/",
    "series": [
        {
            "id": 1034,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1034/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1034",
            "date": "2020-06-23T19:08:14",
            "name": "Support v4l2-compliance",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/1034/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/4189/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/4189/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<paul.elder@ideasonboard.com>",
        "Received": [
            "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 99E98609A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 23 Jun 2020 21:09:38 +0200 (CEST)",
            "from jade.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:8147:f2a2:a8c6:9087])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0274E2A9;\n\tTue, 23 Jun 2020 21:09:36 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Sr52AgkZ\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592939378;\n\tbh=Yyj4xtvYW+wee9Xuq3BHsxeamh1FqaAfROOsLOxumEY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Sr52AgkZNdJ/6cgyz0IJXVTiDAvRESHUwVlwCOzDoijEQuF7plT6Egdv1tqYkLSKM\n\tln5b6K1T5U4/UAJmAbKX95mUuAr7exyzeekpdCg5rsN4qS70NSKCEylBUuRWpZdo+J\n\t0IDoPJXAejVNrFBZ/1T5aI9AzfRg0taiSvSd79ew=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 24 Jun 2020 04:08:29 +0900",
        "Message-Id": "<20200623190836.53446-16-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.27.0",
        "In-Reply-To": "<20200623190836.53446-1-paul.elder@ideasonboard.com>",
        "References": "<20200623190836.53446-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 15/22] v4l2: v4l2_camera_proxy: Reset\n\tbuffer flags on reqbufs 0",
        "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>",
        "X-List-Received-Date": "Tue, 23 Jun 2020 19:09:38 -0000"
    },
    "content": "Clear the queued and done buffer flags on VIDIOC_REQBUFS with count = 0\nif the stream is not on. If the stream is on and reqbufs is called with\ncount = 0, return -EBUSY.\n\nNote that this is contrary to what the V4L2 docs say (reqbufs 0 when\nstreaming should also streamoff), but it is how the V4L2 implementation\nworks. v4l2-compliance doesn't seem to care either way, however, so we\ncater to the implementation.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v3:\n- don't streamoff in reqbufs 0; return -EBUSY instead\n\nChanges in v2:\n- call only the necessary components, instead of\n  V4L2CameraProxy::vidioc_streamoff\n---\n src/v4l2/v4l2_camera_proxy.cpp | 11 ++++++-----\n 1 file changed, 6 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex 06fef21..fa58585 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -444,11 +444,6 @@ int V4L2CameraProxy::freeBuffers()\n {\n \tLOG(V4L2Compat, Debug) << \"Freeing libcamera bufs\";\n \n-\tint ret = vcam_->streamOff();\n-\tif (ret < 0) {\n-\t\tLOG(V4L2Compat, Error) << \"Failed to stop stream\";\n-\t\treturn ret;\n-\t}\n \tvcam_->freeBuffers();\n \tbufferCount_ = 0;\n \n@@ -476,6 +471,12 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf\n \tmemset(arg->reserved, 0, sizeof(arg->reserved));\n \n \tif (arg->count == 0) {\n+\t\tif (vcam_->isRunning())\n+\t\t\treturn -EBUSY;\n+\n+\t\tfor (struct v4l2_buffer &buf : buffers_)\n+\t\t\tbuf.flags &= ~(V4L2_BUF_FLAG_QUEUED | V4L2_BUF_FLAG_DONE);\n+\n \t\trelease(file);\n \t\treturn freeBuffers();\n \t}\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "15/22"
    ]
}