{"id":687,"url":"https://patchwork.libcamera.org/api/patches/687/?format=json","web_url":"https://patchwork.libcamera.org/patch/687/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20190228200410.3022-10-jacopo@jmondi.org>","date":"2019-02-28T20:04:09","name":"[libcamera-devel,09/10] libcamera: ipu3: Connect CIO2 output to ImgU input","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"e7ba4ec520a29a996a98b8aba568e94c904df514","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/687/mbox/","series":[{"id":199,"url":"https://patchwork.libcamera.org/api/series/199/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=199","date":"2019-02-28T20:04:00","name":"libcamera: ipu3: ImgU support","version":1,"mbox":"https://patchwork.libcamera.org/series/199/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/687/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/687/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22AF6610C0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 28 Feb 2019 21:03:52 +0100 (CET)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay4-d.mail.gandi.net (Postfix) with ESMTPSA id A9E0AE0004;\n\tThu, 28 Feb 2019 20:03:51 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 28 Feb 2019 21:04:09 +0100","Message-Id":"<20190228200410.3022-10-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.20.1","In-Reply-To":"<20190228200410.3022-1-jacopo@jmondi.org>","References":"<20190228200410.3022-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 09/10] libcamera: ipu3: Connect CIO2\n\toutput to ImgU input","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, 28 Feb 2019 20:03:52 -0000"},"content":"Connect the CIO2 output buffer available signal to a slot that simply\nqueue the received buffer to ImgU for processing.\n\nFIXME: as long as the bufferReady signal cannot transport at least the\ncameraData from where to retrieve a pointer to the ImguDevice, store it\nas a class member.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 23 +++++++++++++++++++++++\n 1 file changed, 23 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex b9bc992879f5..3138eb0bf8b6 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -149,6 +149,8 @@ private:\n \tint startDevice(V4L2Device *dev);\n \tint stopDevice(V4L2Device *dev);\n \n+\tvoid cio2BufferDone(Buffer *buffer);\n+\n \tImguDevice imgu0_;\n \tImguDevice imgu1_;\n \n@@ -156,6 +158,7 @@ private:\n \tstd::shared_ptr<MediaDevice> imguMediaDev_;\n \n \tunsigned int tmpBufferCount;\n+\tIPU3CameraData *tmpCameraData;\n };\n \n PipelineHandlerIPU3::PipelineHandlerIPU3(CameraManager *manager)\n@@ -430,6 +433,19 @@ int PipelineHandlerIPU3::start(const Camera *camera)\n \tif (ret)\n \t\treturn ret;\n \n+\t/*\n+\t * FIXME\n+\t * This is a big hack! tmpCameraData is used in the cio2BufferDone\n+\t * slot, as there is currently no way to access cameraData from there.\n+\t */\n+\ttmpCameraData = data;\n+\n+\t/*\n+\t * Connect CIO2 output and ImgU input buffer events, when a buffer\n+\t * is available from CIO2, queue it to the ImgU.\n+\t */\n+\tdata->cio2.output->bufferReady.connect(this,\n+\t\t\t\t\t&PipelineHandlerIPU3::cio2BufferDone);\n \tret = startDevice(data->cio2.output);\n \tif (ret)\n \t\treturn ret;\n@@ -975,6 +991,13 @@ int PipelineHandlerIPU3::stopDevice(V4L2Device *dev)\n \treturn 0;\n }\n \n+void PipelineHandlerIPU3::cio2BufferDone(Buffer *buffer)\n+{\n+\tImguDevice *imgu = tmpCameraData->imgu;\n+\n+\timgu->input->queueBuffer(buffer);\n+}\n+\n REGISTER_PIPELINE_HANDLER(PipelineHandlerIPU3);\n \n } /* namespace libcamera */\n","prefixes":["libcamera-devel","09/10"]}