{"id":18413,"url":"https://patchwork.libcamera.org/api/patches/18413/?format=json","web_url":"https://patchwork.libcamera.org/patch/18413/","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":"<20230318234014.29506-5-dan.scally@ideasonboard.com>","date":"2023-03-18T23:40:07","name":"[libcamera-devel,04/11] pipeline: ipu3: Identify sensors that do not need the Imgu","commit_ref":null,"pull_url":null,"state":"rejected","archived":false,"hash":"9e79ccdd21feb04990b3080495125d8bbb94f905","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/people/156/?format=json","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18413/mbox/","series":[{"id":3807,"url":"https://patchwork.libcamera.org/api/series/3807/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3807","date":"2023-03-18T23:40:03","name":"Support OV7251 in IPU3 pipeline and qcam","version":1,"mbox":"https://patchwork.libcamera.org/series/3807/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18413/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18413/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 31F90C329D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 18 Mar 2023 23:40:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 440A662704;\n\tSun, 19 Mar 2023 00:40:38 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 153F8626E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 19 Mar 2023 00:40:33 +0100 (CET)","from mail.ideasonboard.com\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ADD7FDF7;\n\tSun, 19 Mar 2023 00:40:32 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1679182838;\n\tbh=mg3vg7yK637j32aLnAVSbE70YKXnTFJtwb5a4rprn7k=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Tn5LVuLP4D4pvNNg67wTWfy0IhhU2A5/d5FO2UP9qwJdnDNGV6MA0yg1T5G4a5k+d\n\tx9kAIjgXkrUYvEm1RE3GrYz+Yps5VVGbzZEwcXoQsOdddvCBlidLwGb0eH0W3He7Lk\n\tD08EzDswVs5reHHdRxXoXCUDsc37wjsVoZY4L/cOZMPZ4CUOpfIYxTPmZKT8mXV+Bk\n\tHUV6lAf0F9n+FLqiZ5trYV+9bgk0anHTOjvQsnDN3cmzHh3bSznfqqtElrFEfHSN+H\n\tkDg3ZgVM6VsQ5wYE3UopN8HzM01uMbnve/M6ZqTAbwH1VtSue0SZkDAuLNZS0nnrCO\n\tlEB204yYhDjrw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1679182832;\n\tbh=mg3vg7yK637j32aLnAVSbE70YKXnTFJtwb5a4rprn7k=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Pgq8SAg6pUzcOdrHUaW2uqMW+jXdMONgcvdOTlYnKX5gl3dtklv7g/r40y3ya2Q9s\n\tQGrCjKoz/Mj7WUVPtfTGDYogGQt0Oke7lOVGgHtZulLUSX2ahLzinSp3Xx7e/Vnd1t\n\tvoW4F+6Szfa1KhqOF3o0bW40U2CrCZjXH6wRTjBQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Pgq8SAg6\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 18 Mar 2023 23:40:07 +0000","Message-Id":"<20230318234014.29506-5-dan.scally@ideasonboard.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20230318234014.29506-1-dan.scally@ideasonboard.com>","References":"<20230318234014.29506-1-dan.scally@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 04/11] pipeline: ipu3: Identify sensors\n\tthat do not need the Imgu","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>","From":"Daniel Scally via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Daniel Scally <dan.scally@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Some sensors connected to the CIO2 device do not need to be connected\nto the Imgu - for example the OmniVision 7251 outputs Y10 data which\nneedn't be debayered and which is unsupported by the kernel's ipu3-imgu\ndriver.\n\nTo be able to handle those sensors we need to be able to skip the Imgu\nrelated parts of the processing in the IPU3 pipeline. As a preliminary\nstep, check whether the sensor needs the Imgu during CIO2Device::init()\nand provide a method to check that later.\n\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\n src/libcamera/pipeline/ipu3/cio2.cpp | 20 ++++++++++++++++++++\n src/libcamera/pipeline/ipu3/cio2.h   |  4 ++++\n 2 files changed, 24 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\nindex 7400cb0b..d100df57 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.cpp\n+++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n@@ -17,6 +17,7 @@\n #include <libcamera/stream.h>\n #include <libcamera/transform.h>\n \n+#include \"libcamera/internal/bayer_format.h\"\n #include \"libcamera/internal/camera_sensor.h\"\n #include \"libcamera/internal/framebuffer.h\"\n #include \"libcamera/internal/media_device.h\"\n@@ -160,6 +161,25 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index)\n \t\treturn -EINVAL;\n \t}\n \n+\t/*\n+\t * A camera sensor connected to the CIO2 device need not necessarily be\n+\t * connected to the Imgu. This is the case for some IR cameras for\n+\t * example, which output IPU3-packed Y10 data rather than packed data in\n+\t * bayer patterns. In the case of those sensors we need to be able to\n+\t * skip dealing with the Imgu during the pipeline, so we need to be able\n+\t * to identify them.\n+\t *\n+\t * Check whether this sensor needs to be connected to the Imgu.\n+\t */\n+\tneedsImgu_ = false;\n+\tfor (unsigned int mbusCode : sensorCodes) {\n+\t\tconst BayerFormat &bayerFormat = BayerFormat::fromMbusCode(mbusCode);\n+\t\tif (bayerFormat.isValid() && bayerFormat.order < BayerFormat::MONO) {\n+\t\t\tneedsImgu_ = true;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n \t/*\n \t * \\todo Define when to open and close video device nodes, as they\n \t * might impact on power consumption.\ndiff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h\nindex bbd87eb8..064673d9 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.h\n+++ b/src/libcamera/pipeline/ipu3/cio2.h\n@@ -63,6 +63,8 @@ public:\n \n \tSignal<> bufferAvailable;\n \n+\tbool needsImgu() { return needsImgu_; }\n+\n private:\n \tvoid freeBuffers();\n \n@@ -74,6 +76,8 @@ private:\n \n \tstd::vector<std::unique_ptr<FrameBuffer>> buffers_;\n \tstd::queue<FrameBuffer *> availableBuffers_;\n+\n+\tbool needsImgu_;\n };\n \n } /* namespace libcamera */\n","prefixes":["libcamera-devel","04/11"]}