{"id":8542,"url":"https://patchwork.libcamera.org/api/1.1/patches/8542/?format=json","web_url":"https://patchwork.libcamera.org/patch/8542/","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":"<20200701123036.51922-16-jacopo@jmondi.org>","date":"2020-07-01T12:30:36","name":"[libcamera-devel,15/15] libcamera: ipu3: Pass cio2 fourcc to ImgUDevice::configure()","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"523bb55f567e4531bf7085d1302b3bcb174724e2","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":{"id":15,"url":"https://patchwork.libcamera.org/api/1.1/users/15/?format=json","username":"jmondi","first_name":"Jacopo","last_name":"Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/patch/8542/mbox/","series":[{"id":1066,"url":"https://patchwork.libcamera.org/api/1.1/series/1066/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1066","date":"2020-07-01T12:30:21","name":"libcamera: ipu3: Rework streams configuration","version":1,"mbox":"https://patchwork.libcamera.org/series/1066/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/8542/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/8542/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D864DC2E6C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Jul 2020 12:27:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ABE4060D50;\n\tWed,  1 Jul 2020 14:27:29 +0200 (CEST)","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 AB5C160C5C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Jul 2020 14:27:27 +0200 (CEST)","from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 4BDDB1C0007;\n\tWed,  1 Jul 2020 12:27:27 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  1 Jul 2020 14:30:36 +0200","Message-Id":"<20200701123036.51922-16-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200701123036.51922-1-jacopo@jmondi.org>","References":"<20200701123036.51922-1-jacopo@jmondi.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 15/15] libcamera: ipu3: Pass cio2 fourcc\n\tto ImgUDevice::configure()","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Only the CIO2 4cc code is required for ImgUDevice::configure(), as the\ninput frame sizes are now reported through the ImgUDevice::Pipe\nstructure.\n\nAdd the CIO2 pixel format to ImguDevice::Pipe instead of passing the\nwhole CIO2 V4L2DeviceFormat to ImgUDevice::configure().\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/pipeline/ipu3/imgu.cpp | 19 ++++++++++++++-----\n src/libcamera/pipeline/ipu3/imgu.h   |  3 ++-\n src/libcamera/pipeline/ipu3/ipu3.cpp |  3 ++-\n 3 files changed, 18 insertions(+), 7 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp\nindex f580c1d2ff6c..59e63644d22f 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.cpp\n+++ b/src/libcamera/pipeline/ipu3/imgu.cpp\n@@ -26,11 +26,16 @@ LOG_DECLARE_CATEGORY(IPU3)\n  * The ImgU unit processes images through several components, which have\n  * to be properly configured inspecting the input image size and the desired\n  * output sizes. This structure collects the ImgU input configuration and the\n- * requested main output and viewfinder configurations.\n+ * requested main output and viewfinder configurations, along with the\n+ * pixel format to be applied to the ImgU input, which is the same as the\n+ * one used by the CIO2 unit.\n  *\n  * \\var Pipe::input\n  * \\brief The input image size\n  *\n+ * \\var Pipe::cio2Fourcc\n+ * \\brief The CIO2 pixel format to be applied to ImgU input\n+ *\n  * \\var Pipe::output\n  * \\brief The requested main output size\n  *\n@@ -96,17 +101,21 @@ int ImgUDevice::init(MediaDevice *media, unsigned int index)\n /**\n  * \\brief Configure the ImgU unit input\n  * \\param[in] pipe The ImgU pipe configuration\n- * \\param[in] inputFormat The format to be applied to ImgU input\n  * \\return 0 on success or a negative error code otherwise\n  */\n-int ImgUDevice::configure(struct Pipe *pipe, V4L2DeviceFormat *inputFormat)\n+int ImgUDevice::configure(struct Pipe *pipe)\n {\n \t/* Configure the ImgU input video device with the requested sizes. */\n-\tint ret = input_->setFormat(inputFormat);\n+\tV4L2DeviceFormat inputFormat = {\n+\t\t.fourcc = pipe->cio2Fourcc,\n+\t\t.size = pipe->input,\n+\t\t.planesCount = 1,\n+\t};\n+\tint ret = input_->setFormat(&inputFormat);\n \tif (ret)\n \t\treturn ret;\n \n-\tLOG(IPU3, Debug) << \"ImgU input format = \" << inputFormat->toString();\n+\tLOG(IPU3, Debug) << \"ImgU input format = \" << inputFormat.toString();\n \n \t/*\n \t * \\todo The IPU3 driver implementation shall be changed to use the\ndiff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h\nindex 45c5cc1ce8e6..b0ed228756c7 100644\n--- a/src/libcamera/pipeline/ipu3/imgu.h\n+++ b/src/libcamera/pipeline/ipu3/imgu.h\n@@ -25,13 +25,14 @@ class ImgUDevice\n public:\n \tstruct Pipe {\n \t\tSize input;\n+\t\tV4L2PixelFormat cio2Fourcc;\n \t\tSize output;\n \t\tSize viewfinder;\n \t};\n \n \tint init(MediaDevice *media, unsigned int index);\n \n-\tint configure(struct Pipe *pipe, V4L2DeviceFormat *inputFormat);\n+\tint configure(struct Pipe *pipe);\n \n \tint configureOutput(const StreamConfiguration &cfg,\n \t\t\t    V4L2DeviceFormat *outputFormat)\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 317e78155ebb..79ec492341b2 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -410,6 +410,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \tImgUDevice::Pipe imguPipe{};\n \timguPipe.input.width = cio2Format.size.width;\n \timguPipe.input.height = cio2Format.size.height;\n+\timguPipe.cio2Fourcc = cio2Format.fourcc;\n \n \tfor (unsigned int i = 0; i < config->size(); ++i) {\n \t\tStreamConfiguration &cfg = (*config)[i];\n@@ -459,7 +460,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n \t * Configure the ImgU with the collected pipe configuration and the\n \t * CIO2 unit format.\n \t */\n-\tret = imgu->configure(&imguPipe, &cio2Format);\n+\tret = imgu->configure(&imguPipe);\n \tif (ret)\n \t\treturn ret;\n \n","prefixes":["libcamera-devel","15/15"]}