Show a patch.

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

{
    "id": 1093,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1093/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1093/",
    "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": "<20190419132531.17856-8-jacopo@jmondi.org>",
    "date": "2019-04-19T13:25:30",
    "name": "[libcamera-devel,v8,7/8] libcamera: ipu3: Connect viewfinder's BufferReady signal",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b7ab3eab0ef1f8f9d67689af4c78dc0afbac0f53",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1093/mbox/",
    "series": [
        {
            "id": 263,
            "url": "https://patchwork.libcamera.org/api/1.1/series/263/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=263",
            "date": "2019-04-19T13:25:23",
            "name": "libcamera: ipu3: Multiple streams support",
            "version": 8,
            "mbox": "https://patchwork.libcamera.org/series/263/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1093/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1093/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net\n\t[217.70.183.200])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4059660DCB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Apr 2019 15:24:49 +0200 (CEST)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 94AEC20004;\n\tFri, 19 Apr 2019 13:24:48 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 19 Apr 2019 15:25:30 +0200",
        "Message-Id": "<20190419132531.17856-8-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190419132531.17856-1-jacopo@jmondi.org>",
        "References": "<20190419132531.17856-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v8 7/8] libcamera: ipu3: Connect\n\tviewfinder's BufferReady signal",
        "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": "Fri, 19 Apr 2019 13:24:51 -0000"
    },
    "content": "The viewfinder and main output require identical logic for buffer and\nrequest completion. Connect the viewfinder bufferReady signal to the slot\nand handle requests for both main output and viewfinder there.\n\nUpdate the slot logic to complete the request only when the last buffer\nhas completed, and make sure to complete requests in the same order they\nhave been queued to the pipeline handler.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 18 +++++++++++++++---\n 1 file changed, 15 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex f71227c6c408..43c28c30cfc7 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -760,6 +760,8 @@ int PipelineHandlerIPU3::registerCameras()\n \t\t\t\t\t&IPU3CameraData::imguInputBufferReady);\n \t\tdata->imgu_->output_.dev->bufferReady.connect(data.get(),\n \t\t\t\t\t&IPU3CameraData::imguOutputBufferReady);\n+\t\tdata->imgu_->viewfinder_.dev->bufferReady.connect(data.get(),\n+\t\t\t\t\t&IPU3CameraData::imguOutputBufferReady);\n \n \t\t/* Create and register the Camera instance. */\n \t\tstd::string cameraName = cio2->sensor_->entity()->name() + \" \"\n@@ -805,10 +807,20 @@ void PipelineHandlerIPU3::IPU3CameraData::imguInputBufferReady(Buffer *buffer)\n  */\n void PipelineHandlerIPU3::IPU3CameraData::imguOutputBufferReady(Buffer *buffer)\n {\n-\tRequest *request = queuedRequests_.front();\n+\tRequest *request = buffer->request();\n+\n+\tif (!pipe_->completeBuffer(camera_, request, buffer))\n+\t\t/* Request not completed yet, return here. */\n+\t\treturn;\n \n-\tpipe_->completeBuffer(camera_, request, buffer);\n-\tpipe_->completeRequest(camera_, request);\n+\t/* Complete the pending requests in queuing order. */\n+\twhile (1) {\n+\t\trequest = queuedRequests_.front();\n+\t\tif (request->hasPendingBuffers())\n+\t\t\tbreak;\n+\n+\t\tpipe_->completeRequest(camera_, request);\n+\t}\n }\n \n /**\n",
    "prefixes": [
        "libcamera-devel",
        "v8",
        "7/8"
    ]
}