{"id":866,"url":"https://patchwork.libcamera.org/api/1.1/patches/866/?format=json","web_url":"https://patchwork.libcamera.org/patch/866/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190402171309.6447-11-jacopo@jmondi.org>","date":"2019-04-02T17:13:06","name":"[libcamera-devel,v7,10/13] libcamera: ipu3: Connect CIO2 and ImgU bufferReady signals","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"3ba5fed75246fe255f7ea2e825915c918fcfa385","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/866/mbox/","series":[{"id":231,"url":"https://patchwork.libcamera.org/api/1.1/series/231/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=231","date":"2019-04-02T17:12:56","name":"libcamera: ipu3: Add ImgU support","version":7,"mbox":"https://patchwork.libcamera.org/series/231/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/866/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/866/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 571CC610B6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Apr 2019 19:12:38 +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 relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 77A6CFF80A;\n\tTue,  2 Apr 2019 17:12:37 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  2 Apr 2019 19:13:06 +0200","Message-Id":"<20190402171309.6447-11-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190402171309.6447-1-jacopo@jmondi.org>","References":"<20190402171309.6447-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v7 10/13] libcamera: ipu3: Connect CIO2\n\tand ImgU bufferReady signals","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":"Tue, 02 Apr 2019 17:12:38 -0000"},"content":"Connect the CIO2 output bufferRead signal to a slot that simply\nqueue the received buffer to ImgU for processing, and connect the ImgU\nmain output bufferReady signal to the cameraData slot that notifies\nto applications that a new image buffer is available.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 59 +++++++++++++++++++++++++---\n 1 file changed, 54 insertions(+), 5 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 9bceb8bfab35..f6d08af906da 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -173,7 +173,9 @@ private:\n \t\t{\n \t\t}\n \n-\t\tvoid bufferReady(Buffer *buffer);\n+\t\tvoid imguOutputBufferReady(Buffer *buffer);\n+\t\tvoid imguInputBufferReady(Buffer *buffer);\n+\t\tvoid cio2BufferReady(Buffer *buffer);\n \n \t\tCIO2Device cio2_;\n \t\tImgUDevice *imgu_;\n@@ -539,15 +541,28 @@ int PipelineHandlerIPU3::registerCameras()\n \t\t */\n \t\tdata->imgu_ = numCameras ? &imgu1_ : &imgu0_;\n \n+\t\t/*\n+\t\t * Connect video devices' 'bufferReady' signals to their\n+\t\t * slot to implement the image processing pipeline.\n+\t\t *\n+\t\t * Frames produced by the CIO2 unit are passed to the\n+\t\t * associated ImgU input where they get processed and\n+\t\t * returned through the ImgU main and secondary outputs.\n+\t\t */\n+\t\tdata->cio2_.output_->bufferReady.connect(data.get(),\n+\t\t\t\t\t&IPU3CameraData::cio2BufferReady);\n+\t\tdata->imgu_->input_->bufferReady.connect(data.get(),\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+\n+\t\t/* Create and register the Camera instance. */\n \t\tstd::string cameraName = cio2->sensor_->entityName() + \" \"\n \t\t\t\t       + std::to_string(id);\n \t\tstd::shared_ptr<Camera> camera = Camera::create(this,\n \t\t\t\t\t\t\t\tcameraName,\n \t\t\t\t\t\t\t\tstreams);\n \n-\t\tcio2->output_->bufferReady.connect(data.get(),\n-\t\t\t\t\t\t   &IPU3CameraData::bufferReady);\n-\n \t\tregisterCamera(std::move(camera), std::move(data));\n \n \t\tLOG(IPU3, Info)\n@@ -561,7 +576,29 @@ int PipelineHandlerIPU3::registerCameras()\n \treturn numCameras ? 0 : -ENODEV;\n }\n \n-void PipelineHandlerIPU3::IPU3CameraData::bufferReady(Buffer *buffer)\n+/* -----------------------------------------------------------------------------\n+ * Buffer Ready slots\n+ */\n+\n+/**\n+ * \\brief Handle buffers completion at the ImgU input\n+ * \\param buffer The completed buffer\n+ *\n+ * Buffers completed from the ImgU input are immediately queued back to the\n+ * CIO2 unit to continue frame capture.\n+ */\n+void PipelineHandlerIPU3::IPU3CameraData::imguInputBufferReady(Buffer *buffer)\n+{\n+\tcio2_.output_->queueBuffer(buffer);\n+}\n+\n+/**\n+ * \\brief Handle buffers completion at the ImgU output\n+ * \\param buffer The completed buffer\n+ *\n+ * Buffers completed from the ImgU output are directed to the application.\n+ */\n+void PipelineHandlerIPU3::IPU3CameraData::imguOutputBufferReady(Buffer *buffer)\n {\n \tRequest *request = queuedRequests_.front();\n \n@@ -569,6 +606,18 @@ void PipelineHandlerIPU3::IPU3CameraData::bufferReady(Buffer *buffer)\n \tpipe_->completeRequest(camera_, request);\n }\n \n+/**\n+ * \\brief Handle buffers completion at the CIO2 output\n+ * \\param buffer The completed buffer\n+ *\n+ * Buffers completed from the CIO2 are immediately queued to the ImgU unit\n+ * for further processing.\n+ */\n+void PipelineHandlerIPU3::IPU3CameraData::cio2BufferReady(Buffer *buffer)\n+{\n+\timgu_->input_->queueBuffer(buffer);\n+}\n+\n /* -----------------------------------------------------------------------------\n  * ImgU Device\n  */\n","prefixes":["libcamera-devel","v7","10/13"]}