{"id":18414,"url":"https://patchwork.libcamera.org/api/1.1/patches/18414/?format=json","web_url":"https://patchwork.libcamera.org/patch/18414/","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":"<20230318234014.29506-6-dan.scally@ideasonboard.com>","date":"2023-03-18T23:40:08","name":"[libcamera-devel,05/11] pipeline: ipu3: Add needsImgu flag to IPU3Frames","commit_ref":null,"pull_url":null,"state":"rejected","archived":false,"hash":"d24d99ec362bce6aa35ad98768fefe5dc58c9bb5","submitter":{"id":156,"url":"https://patchwork.libcamera.org/api/1.1/people/156/?format=json","name":"Dan Scally","email":"dan.scally@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18414/mbox/","series":[{"id":3807,"url":"https://patchwork.libcamera.org/api/1.1/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/18414/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18414/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 83261C329E\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 C5D89626FC;\n\tSun, 19 Mar 2023 00:40:38 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 68E69626EC\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 04F28B6C;\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=ou8m4oAvy23Fg+JQdD6YTRdMNnldKcSO4Jo/9JkQvJw=;\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=gMZkxFYLIXq7c3mE3mcHI/X7oWDTcQ2BfQyHPKNStGsMvUH8MYn+hvqRYJ/9GDg1K\n\t2G1DWEGJZ3cMJEcgQNh9ax5tUfDei6D2aloVhQw9BAxW71vvXA10jh7ARnzQ8HEY4B\n\txxt3Bj2UGmd33caDJQTqo2qZ1yb9ak1qM+5qtHhQLiYYQ1Au7OGwh/0gjj9Bw6JBP8\n\tf2a0d0BdpTVzq6+YjGsGq08WfG7++RIRct7P5wReCwK9VUWLdhrCZDvnpyv5U5V2s3\n\tlDCASLaAd5Szqy/V5TyQd9xcctKwOKVKkotv+ba4w4cT0v6aaqqrwuPXPxRvWOAsG2\n\tjreZah79KCEgg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1679182833;\n\tbh=ou8m4oAvy23Fg+JQdD6YTRdMNnldKcSO4Jo/9JkQvJw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=kRl3g7s8c8cORarYmGPiTIa68Ntd+VtUWgVu3CCDYuQp4Wvr41R/EIUzjXiA4Zogn\n\tjWzev7w8sizGTh1KlMWc4+Gh2TOazKROAUgV2mkKsY7U5ncoz2aWu2kD5vzlZDFAsH\n\t/xDY3AgF/oQMES/mn8vuzbQtMLK9o385VgrLTGTk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"kRl3g7s8\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Sat, 18 Mar 2023 23:40:08 +0000","Message-Id":"<20230318234014.29506-6-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 05/11] pipeline: ipu3: Add needsImgu flag\n\tto IPU3Frames","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 using the IPU3 pipeline do not transfer data to the\nImgu, so we need the ability to disable the related processing\nfrom this class. Add a boolean flag denoting whether or not to\nrun the Imgu related processing. For now, hard code this to true\nin IPU3CameraData::queuePendingRequests().\n\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\n src/libcamera/pipeline/ipu3/frames.cpp | 45 +++++++++++++++-----------\n src/libcamera/pipeline/ipu3/frames.h   |  3 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp   |  2 +-\n 3 files changed, 29 insertions(+), 21 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/ipu3/frames.cpp b/src/libcamera/pipeline/ipu3/frames.cpp\nindex a4c3477c..55b90e9d 100644\n--- a/src/libcamera/pipeline/ipu3/frames.cpp\n+++ b/src/libcamera/pipeline/ipu3/frames.cpp\n@@ -40,28 +40,32 @@ void IPU3Frames::clear()\n \tavailableStatBuffers_ = {};\n }\n \n-IPU3Frames::Info *IPU3Frames::create(Request *request)\n+IPU3Frames::Info *IPU3Frames::create(Request *request, bool needsImgu)\n {\n \tunsigned int id = request->sequence();\n+\tFrameBuffer *paramBuffer = nullptr;\n+\tFrameBuffer *statBuffer = nullptr;\n \n-\tif (availableParamBuffers_.empty()) {\n-\t\tLOG(IPU3, Debug) << \"Parameters buffer underrun\";\n-\t\treturn nullptr;\n-\t}\n+\tif (needsImgu) {\n+\t\tif (availableParamBuffers_.empty()) {\n+\t\t\tLOG(IPU3, Debug) << \"Parameters buffer underrun\";\n+\t\t\treturn nullptr;\n+\t\t}\n \n-\tif (availableStatBuffers_.empty()) {\n-\t\tLOG(IPU3, Debug) << \"Statistics buffer underrun\";\n-\t\treturn nullptr;\n-\t}\n+\t\tif (availableStatBuffers_.empty()) {\n+\t\t\tLOG(IPU3, Debug) << \"Statistics buffer underrun\";\n+\t\t\treturn nullptr;\n+\t\t}\n \n-\tFrameBuffer *paramBuffer = availableParamBuffers_.front();\n-\tFrameBuffer *statBuffer = availableStatBuffers_.front();\n+\t\tparamBuffer = availableParamBuffers_.front();\n+\t\tstatBuffer = availableStatBuffers_.front();\n \n-\tparamBuffer->_d()->setRequest(request);\n-\tstatBuffer->_d()->setRequest(request);\n+\t\tparamBuffer->_d()->setRequest(request);\n+\t\tstatBuffer->_d()->setRequest(request);\n \n-\tavailableParamBuffers_.pop();\n-\tavailableStatBuffers_.pop();\n+\t\tavailableParamBuffers_.pop();\n+\t\tavailableStatBuffers_.pop();\n+\t}\n \n \t/* \\todo Remove the dynamic allocation of Info */\n \tstd::unique_ptr<Info> info = std::make_unique<Info>();\n@@ -73,6 +77,7 @@ IPU3Frames::Info *IPU3Frames::create(Request *request)\n \tinfo->statBuffer = statBuffer;\n \tinfo->paramDequeued = false;\n \tinfo->metadataProcessed = false;\n+\tinfo->needsImgu = needsImgu;\n \n \tframeInfo_[id] = std::move(info);\n \n@@ -96,11 +101,13 @@ bool IPU3Frames::tryComplete(IPU3Frames::Info *info)\n \tif (request->hasPendingBuffers())\n \t\treturn false;\n \n-\tif (!info->metadataProcessed)\n-\t\treturn false;\n+\tif (info->needsImgu) {\n+\t\tif (!info->metadataProcessed)\n+\t\t\treturn false;\n \n-\tif (!info->paramDequeued)\n-\t\treturn false;\n+\t\tif (!info->paramDequeued)\n+\t\t\treturn false;\n+\t}\n \n \tremove(info);\n \ndiff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h\nindex 6e3cb915..d58fd998 100644\n--- a/src/libcamera/pipeline/ipu3/frames.h\n+++ b/src/libcamera/pipeline/ipu3/frames.h\n@@ -40,6 +40,7 @@ public:\n \n \t\tbool paramDequeued;\n \t\tbool metadataProcessed;\n+\t\tbool needsImgu;\n \t};\n \n \tIPU3Frames();\n@@ -48,7 +49,7 @@ public:\n \t\t  const std::vector<std::unique_ptr<FrameBuffer>> &statBuffers);\n \tvoid clear();\n \n-\tInfo *create(Request *request);\n+\tInfo *create(Request *request, bool needsImgu);\n \tvoid remove(Info *info);\n \tbool tryComplete(Info *info);\n \ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex d0d55651..3077c6bb 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -806,7 +806,7 @@ void IPU3CameraData::queuePendingRequests()\n \twhile (!pendingRequests_.empty()) {\n \t\tRequest *request = pendingRequests_.front();\n \n-\t\tIPU3Frames::Info *info = frameInfos_.create(request);\n+\t\tIPU3Frames::Info *info = frameInfos_.create(request, true);\n \t\tif (!info)\n \t\t\tbreak;\n \n","prefixes":["libcamera-devel","05/11"]}