Patch Detail
Show a patch.
GET /api/patches/20398/?format=api
{ "id": 20398, "url": "https://patchwork.libcamera.org/api/patches/20398/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20398/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20240626072100.55497-9-mzamazal@redhat.com>", "date": "2024-06-26T07:20:49", "name": "[08/19] libcamera: software_isp: Track and pass frame ids", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "998e5a596a4d81e5993dc5281154c260395e2f4d", "submitter": { "id": 177, "url": "https://patchwork.libcamera.org/api/people/177/?format=api", "name": "Milan Zamazal", "email": "mzamazal@redhat.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20398/mbox/", "series": [ { "id": 4419, "url": "https://patchwork.libcamera.org/api/series/4419/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4419", "date": "2024-06-26T07:20:41", "name": "Software ISP refactoring", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4419/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20398/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20398/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 947C2BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Jun 2024 07:21:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 46B42654BB;\n\tWed, 26 Jun 2024 09:21:35 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 08484654B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Jun 2024 09:21:33 +0200 (CEST)", "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n\t(ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63])\n\tby relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n\tcipher=TLS_AES_256_GCM_SHA384) id us-mta-460-yrgs4RuPNCGmOpM2YrKNXg-1;\n\tWed, 26 Jun 2024 03:21:31 -0400", "from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n\t(mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (2048 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTPS\n\tid 8D83A19560B5 for <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Jun 2024 07:21:30 +0000 (UTC)", "from nuthatch.brq.redhat.com (unknown [10.43.17.159])\n\tby mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix)\n\twith ESMTP id 971393000221; Wed, 26 Jun 2024 07:21:29 +0000 (UTC)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"MrRngyBn\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1719386492;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=DhjRDTFUZDS7ob74gjd7Bw08NowGjNvfxws4RLmwThM=;\n\tb=MrRngyBnD+33P3pp+BQiy9t6JPqpr0SeZ96LukC3vfC7JV08l20Zn6PSoPKxQlrE00XcQb\n\tgV9EFMI1BQz6OJfoFAIo5WZ3sxnB3ChZuMIWcvnpT74VyI5IhZmMJdYJtBcIIcAFx6bm9D\n\th/RxAMXNcTMgfSQFG0T6JQWLiJdAtoc=", "X-MC-Unique": "yrgs4RuPNCGmOpM2YrKNXg-1", "From": "Milan Zamazal <mzamazal@redhat.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Milan Zamazal <mzamazal@redhat.com>", "Subject": "[PATCH 08/19] libcamera: software_isp: Track and pass frame ids", "Date": "Wed, 26 Jun 2024 09:20:49 +0200", "Message-ID": "<20240626072100.55497-9-mzamazal@redhat.com>", "In-Reply-To": "<20240626072100.55497-1-mzamazal@redhat.com>", "References": "<20240626072100.55497-1-mzamazal@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.4", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "A previous preparation patch implemented passing frame ids to stats\nprocessing but without actual meaningful frame id value passed there.\nThis patch extends that by actually providing the frame id and passing\nit through to the stats processor.\n\nThe frame id is taken from the request sequence number, the same as in\nhardware pipelines.\nDear reviewers: I'm confused even after looking at commit\n6084217cd3b52ba5677e3ca2de0e21008fdaa735. What's the relationship\nbetween requests, buffers and frames? It's not 1:1:1 or is it? Could\nyou please provide some explanation that could be put here?\n\nSigned-off-by: Milan Zamazal <mzamazal@redhat.com>\n---\n include/libcamera/internal/software_isp/software_isp.h | 4 ++--\n src/libcamera/pipeline/simple/simple.cpp | 2 +-\n src/libcamera/software_isp/debayer.h | 2 +-\n src/libcamera/software_isp/debayer_cpu.cpp | 9 ++++-----\n src/libcamera/software_isp/debayer_cpu.h | 2 +-\n src/libcamera/software_isp/software_isp.cpp | 10 ++++++----\n 6 files changed, 15 insertions(+), 14 deletions(-)", "diff": "diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\nindex 6a03b17f..7365b49a 100644\n--- a/include/libcamera/internal/software_isp/software_isp.h\n+++ b/include/libcamera/internal/software_isp/software_isp.h\n@@ -72,10 +72,10 @@ public:\n \tint start();\n \tvoid stop();\n \n-\tint queueBuffers(FrameBuffer *input,\n+\tint queueBuffers(uint32_t frame, FrameBuffer *input,\n \t\t\t const std::map<unsigned int, FrameBuffer *> &outputs);\n \n-\tvoid process(FrameBuffer *input, FrameBuffer *output);\n+\tvoid process(uint32_t frame, FrameBuffer *input, FrameBuffer *output);\n \n \tSignal<FrameBuffer *> inputBufferReady;\n \tSignal<FrameBuffer *> outputBufferReady;\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex b1bf0d16..5cca94c3 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -864,7 +864,7 @@ void SimpleCameraData::bufferReady(FrameBuffer *buffer)\n \t\tif (converter_)\n \t\t\tconverter_->queueBuffers(buffer, conversionQueue_.front());\n \t\telse\n-\t\t\tswIsp_->queueBuffers(buffer, conversionQueue_.front());\n+\t\t\tswIsp_->queueBuffers(request->sequence(), buffer, conversionQueue_.front());\n \n \t\tconversionQueue_.pop();\n \t\treturn;\ndiff --git a/src/libcamera/software_isp/debayer.h b/src/libcamera/software_isp/debayer.h\nindex c151fe5d..d7ca060d 100644\n--- a/src/libcamera/software_isp/debayer.h\n+++ b/src/libcamera/software_isp/debayer.h\n@@ -40,7 +40,7 @@ public:\n \tvirtual std::tuple<unsigned int, unsigned int>\n \tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size) = 0;\n \n-\tvirtual void process(FrameBuffer *input, FrameBuffer *output, DebayerParams params) = 0;\n+\tvirtual void process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params) = 0;\n \n \tvirtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0;\n \ndiff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp\nindex 1575cedb..c75b8967 100644\n--- a/src/libcamera/software_isp/debayer_cpu.cpp\n+++ b/src/libcamera/software_isp/debayer_cpu.cpp\n@@ -731,7 +731,7 @@ static inline int64_t timeDiff(timespec &after, timespec &before)\n \t (int64_t)after.tv_nsec - (int64_t)before.tv_nsec;\n }\n \n-void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams params)\n+void DebayerCpu::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params)\n {\n \ttimespec frameStartTime;\n \n@@ -785,12 +785,11 @@ void DebayerCpu::process(FrameBuffer *input, FrameBuffer *output, DebayerParams\n \t}\n \n \t/*\n-\t * Frame and buffer ids are currently not used, so pass zeros as parameters.\n+\t * Buffer ids are currently not used, so pass zeros as its parameter.\n \t *\n-\t * \\todo Pass real values once frame is passed here and stats buffer passing\n-\t * is changed.\n+\t * \\todo Pass real bufferId once stats buffer passing is changed.\n \t */\n-\tstats_->finishFrame(0, 0);\n+\tstats_->finishFrame(frame, 0);\n \toutputBufferReady.emit(output);\n \tinputBufferReady.emit(input);\n }\ndiff --git a/src/libcamera/software_isp/debayer_cpu.h b/src/libcamera/software_isp/debayer_cpu.h\nindex 1dac6435..6a9cb4c7 100644\n--- a/src/libcamera/software_isp/debayer_cpu.h\n+++ b/src/libcamera/software_isp/debayer_cpu.h\n@@ -36,7 +36,7 @@ public:\n \tstd::vector<PixelFormat> formats(PixelFormat input);\n \tstd::tuple<unsigned int, unsigned int>\n \tstrideAndFrameSize(const PixelFormat &outputFormat, const Size &size);\n-\tvoid process(FrameBuffer *input, FrameBuffer *output, DebayerParams params);\n+\tvoid process(uint32_t frame, FrameBuffer *input, FrameBuffer *output, DebayerParams params);\n \tSizeRange sizes(PixelFormat inputFormat, const Size &inputSize);\n \n \t/**\ndiff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex 3fc4a64b..aa60fb5f 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -279,12 +279,13 @@ int SoftwareIsp::exportBuffers(unsigned int output, unsigned int count,\n \n /**\n * \\brief Queue buffers to Software ISP\n+ * \\param[in] frame The frame number\n * \\param[in] input The input framebuffer\n * \\param[in] outputs The container holding the output stream indexes and\n * their respective frame buffer outputs\n * \\return 0 on success, a negative errno on failure\n */\n-int SoftwareIsp::queueBuffers(FrameBuffer *input,\n+int SoftwareIsp::queueBuffers(uint32_t frame, FrameBuffer *input,\n \t\t\t const std::map<unsigned int, FrameBuffer *> &outputs)\n {\n \tunsigned int mask = 0;\n@@ -308,7 +309,7 @@ int SoftwareIsp::queueBuffers(FrameBuffer *input,\n \t\tmask |= 1 << index;\n \t}\n \n-\tprocess(input, outputs.at(0));\n+\tprocess(frame, input, outputs.at(0));\n \n \treturn 0;\n }\n@@ -340,13 +341,14 @@ void SoftwareIsp::stop()\n \n /**\n * \\brief Passes the input framebuffer to the ISP worker to process\n+ * \\param[in] frame The frame number\n * \\param[in] input The input framebuffer\n * \\param[out] output The framebuffer to write the processed frame to\n */\n-void SoftwareIsp::process(FrameBuffer *input, FrameBuffer *output)\n+void SoftwareIsp::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output)\n {\n \tdebayer_->invokeMethod(&DebayerCpu::process,\n-\t\t\t ConnectionTypeQueued, input, output, debayerParams_);\n+\t\t\t ConnectionTypeQueued, frame, input, output, debayerParams_);\n }\n \n void SoftwareIsp::saveIspParams()\n", "prefixes": [ "08/19" ] }