Patch Detail
Show a patch.
GET /api/patches/26806/?format=api
{ "id": 26806, "url": "https://patchwork.libcamera.org/api/patches/26806/?format=api", "web_url": "https://patchwork.libcamera.org/patch/26806/", "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": "<20260527081534.20245-5-robert.mader@collabora.com>", "date": "2026-05-27T08:15:33", "name": "[v5,4/5] libcamera: swstats_cpu: Take MappedFrameBuffer in processFrame()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d25e39f9810549a0cd06aa1e83e1530cfc34cf0b", "submitter": { "id": 140, "url": "https://patchwork.libcamera.org/api/people/140/?format=api", "name": "Robert Mader", "email": "robert.mader@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/26806/mbox/", "series": [ { "id": 5965, "url": "https://patchwork.libcamera.org/api/series/5965/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5965", "date": "2026-05-27T08:15:29", "name": "software_isp: Implement DMABuf import for input buffers", "version": 5, "mbox": "https://patchwork.libcamera.org/series/5965/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/26806/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/26806/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 F1105C32A9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 May 2026 08:16:16 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5361663020;\n\tWed, 27 May 2026 10:16:16 +0200 (CEST)", "from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n\t[136.143.188.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D595A62FEA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 May 2026 10:16:12 +0200 (CEST)", "by mx.zohomail.com with SMTPS id 1779869766003903.0619894579684;\n\tWed, 27 May 2026 01:16:06 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"lYaUs2lS\"; \n\tdkim-atps=neutral", "ARC-Seal": "i=1; a=rsa-sha256; t=1779869768; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=BdpieltnWQjPQBl3yQgpvlm9RjeN8a8JVNMD+pwBx/GwCfRdM/rDpC6ZJ+21moCdW5QPu+3i+v2Jwn19nuWGhniQEvKOOKFQaD6ZiCMFqOf15DgJRkOKTWF8x+deWx3vKdC7x9chwS5My8UIPM9u96RIksVB+nbaWwSUuN8YtpA=", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1779869768;\n\th=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To;\n\tbh=HQFVe0WHEecuvCj3juzh2dxW1YQisx+9AOio+6PxKlQ=; \n\tb=lgrf0o6Hh3YwhJQsKOw/uZJ8wwhefEYGIaU+Q4yADiwD0GZT3B7/30HspAM10J/l5ULsDEjQIGSCRvPp1Z/HdbKtQ0/kJcIo4gcbhKBaqWcorbeBmbbJNT807BbHGb69GPQmwRDbg3lCscyi5z44slKAF5rph//dMtqhuPnOvv0=", "ARC-Authentication-Results": "i=1; mx.zohomail.com;\n\tdkim=pass header.i=collabora.com;\n\tspf=pass smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>", "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1779869768;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-ID:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Message-Id:Reply-To;\n\tbh=HQFVe0WHEecuvCj3juzh2dxW1YQisx+9AOio+6PxKlQ=;\n\tb=lYaUs2lSzfFUBAXNZHqO4nGHKYxjoIZJ+HlqzQlg/xrgB5jsuSnfXbE6cd/cxYgP\n\tAHHPU/kXllmvtrr7p7ZYbFIesiZ3pP5ID+woria7Q4bORmy+ZWUUTpb/+OB9N6KFO0O\n\txk1wvmWXYagnVCYwAqx52soSF53SBmXOzyqjJrwk=", "From": "Robert Mader <robert.mader@collabora.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Robert Mader <robert.mader@collabora.com>", "Subject": "[PATCH v5 4/5] libcamera: swstats_cpu: Take MappedFrameBuffer in\n\tprocessFrame()", "Date": "Wed, 27 May 2026 10:15:33 +0200", "Message-ID": "<20260527081534.20245-5-robert.mader@collabora.com>", "X-Mailer": "git-send-email 2.54.0", "In-Reply-To": "<20260527081534.20245-1-robert.mader@collabora.com>", "References": "<20260527081534.20245-1-robert.mader@collabora.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "As the only current user - DebayerEGL::process() - already has the buffer\nmapped. Currently this shouldn't impact performance as the kernel should\nalready avoid remapping the dmabuf - i.e. we implicitly benefit from the\nfact that the mentioned function holds its mapping during the runtime of\nprocessFrame(). In a following commit DebayerEGL::process() will change\nin a way that would make keeping the mapping counter-intuitive. Thus\nthis change ensures we'll not accidentally start mapping the buffer\ntwice per frame.\n\nSigned-off-by: Robert Mader <robert.mader@collabora.com>\n---\n include/libcamera/internal/software_isp/swstats_cpu.h | 2 +-\n src/libcamera/software_isp/debayer_egl.cpp | 2 +-\n src/libcamera/software_isp/swstats_cpu.cpp | 11 ++---------\n 3 files changed, 4 insertions(+), 11 deletions(-)", "diff": "diff --git a/include/libcamera/internal/software_isp/swstats_cpu.h b/include/libcamera/internal/software_isp/swstats_cpu.h\nindex b5348c6fe..686e3d981 100644\n--- a/include/libcamera/internal/software_isp/swstats_cpu.h\n+++ b/include/libcamera/internal/software_isp/swstats_cpu.h\n@@ -56,7 +56,7 @@ public:\n \tvoid setWindow(const Rectangle &window);\n \tvoid startFrame(uint32_t frame);\n \tvoid finishFrame(uint32_t frame, uint32_t bufferId);\n-\tvoid processFrame(uint32_t frame, uint32_t bufferId, FrameBuffer *input);\n+\tvoid processFrame(uint32_t frame, uint32_t bufferId, MappedFrameBuffer &input);\n \n \tvoid processLine0(uint32_t frame, unsigned int y, const uint8_t *src[], unsigned int statsBufferIndex = 0)\n \t{\ndiff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp\nindex 696498a58..d08634640 100644\n--- a/src/libcamera/software_isp/debayer_egl.cpp\n+++ b/src/libcamera/software_isp/debayer_egl.cpp\n@@ -555,7 +555,7 @@ void DebayerEGL::process(uint32_t frame, FrameBuffer *input, FrameBuffer *output\n \tmetadata.planes()[0].bytesused = output->planes()[0].length;\n \n \t/* Calculate stats for the whole frame */\n-\tstats_->processFrame(frame, 0, input);\n+\tstats_->processFrame(frame, 0, in);\n \tdmaSyncers.clear();\n \n \tegl_.syncOutput();\ndiff --git a/src/libcamera/software_isp/swstats_cpu.cpp b/src/libcamera/software_isp/swstats_cpu.cpp\nindex 0815ec9a3..fb7a5301d 100644\n--- a/src/libcamera/software_isp/swstats_cpu.cpp\n+++ b/src/libcamera/software_isp/swstats_cpu.cpp\n@@ -543,7 +543,7 @@ void SwStatsCpu::processBayerFrame2(MappedFrameBuffer &in)\n *\n * This may only be called after a successful setWindow() call.\n */\n-void SwStatsCpu::processFrame(uint32_t frame, uint32_t bufferId, FrameBuffer *input)\n+void SwStatsCpu::processFrame(uint32_t frame, uint32_t bufferId, MappedFrameBuffer &input)\n {\n \tif (frame % kStatPerNumFrames) {\n \t\tfinishFrame(frame, bufferId);\n@@ -552,14 +552,7 @@ void SwStatsCpu::processFrame(uint32_t frame, uint32_t bufferId, FrameBuffer *in\n \n \tbench_.startFrame();\n \tstartFrame(frame);\n-\n-\tMappedFrameBuffer in(input, MappedFrameBuffer::MapFlag::Read);\n-\tif (!in.isValid()) {\n-\t\tLOG(SwStatsCpu, Error) << \"mmap-ing buffer(s) failed\";\n-\t\treturn;\n-\t}\n-\n-\t(this->*processFrame_)(in);\n+\t(this->*processFrame_)(input);\n \tfinishFrame(frame, bufferId);\n \tbench_.finishFrame();\n }\n", "prefixes": [ "v5", "4/5" ] }