Patch Detail
Show a patch.
GET /api/patches/1070/?format=api
{ "id": 1070, "url": "https://patchwork.libcamera.org/api/patches/1070/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1070/", "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": "<20190418164638.400-6-jacopo@jmondi.org>", "date": "2019-04-18T16:46:37", "name": "[libcamera-devel,v6,5/6] libcamera: ipu3: Connect viewfinder's BufferReady signal", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "5b5e35157abbe55b5794f7d2f759df9d948d8f2c", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1070/mbox/", "series": [ { "id": 259, "url": "https://patchwork.libcamera.org/api/series/259/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=259", "date": "2019-04-18T16:46:32", "name": "libcamera: ipu3: Multiple streams support", "version": 6, "mbox": "https://patchwork.libcamera.org/series/259/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1070/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1070/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD59B60DB4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Apr 2019 18:45:55 +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 relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 4FA4B1C0009;\n\tThu, 18 Apr 2019 16:45:55 +0000 (UTC)" ], "X-Originating-IP": "2.224.242.101", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 18 Apr 2019 18:46:37 +0200", "Message-Id": "<20190418164638.400-6-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190418164638.400-1-jacopo@jmondi.org>", "References": "<20190418164638.400-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v6 5/6] 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": "Thu, 18 Apr 2019 16:45:55 -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 ignore internal buffers that are not part of\nthe request, and to complete the request only when the last buffer\ncompletes.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 32 +++++++++++++++++++++++++---\n 1 file changed, 29 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 8353272642bd..647b4f4f365f 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -729,6 +729,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@@ -774,10 +776,34 @@ 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+\tif (!request)\n+\t\t/* Completed buffers not part of a request are ignored. */\n+\t\treturn;\n+\n+\tif (!pipe_->completeBuffer(camera_, request, buffer))\n+\t\t/* Request not completed yet, return here. */\n+\t\treturn;\n+\n+\t/*\n+\t * Complete requests in queuing order: if some other request is\n+\t * pending, post-pone completion.\n+\t */\n+\tRequest *front = queuedRequests_.front();\n+\tif (front != request)\n+\t\treturn;\n \n-\tpipe_->completeBuffer(camera_, request, buffer);\n-\tpipe_->completeRequest(camera_, request);\n+\t/*\n+\t * Complete the current request, and all the other pending ones,\n+\t * in queuing order.\n+\t */\n+\twhile (1) {\n+\t\tif (front->hasPendingBuffers())\n+\t\t\tbreak;\n+\n+\t\tpipe_->completeRequest(camera_, front);\n+\t\tfront = queuedRequests_.front();\n+\t}\n }\n \n /**\n", "prefixes": [ "libcamera-devel", "v6", "5/6" ] }