| Message ID | 20260303111741.17417-1-johannes.goede@oss.qualcomm.com |
|---|---|
| Headers | show
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 [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A45E6C0DA4 for <parsemail@patchwork.libcamera.org>; Tue, 3 Mar 2026 11:17:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 851EC62388; Tue, 3 Mar 2026 12:17:50 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="oUDYaxID"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UV4XtFBi"; dkim-atps=neutral Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9E5BB62010 for <libcamera-devel@lists.libcamera.org>; Tue, 3 Mar 2026 12:17:48 +0100 (CET) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6239moaJ2773382 for <libcamera-devel@lists.libcamera.org>; Tue, 3 Mar 2026 11:17:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=CGP20cioB98g8uxV7+sWAplxRuvnr6a1Zrj ybqQix4A=; b=oUDYaxIDApEd02nEzy/8P3pCm7KgdF0H+V6+kcU0ln5Aie340r4 H/ORyraXX+qIgvEUgGGlkTG1M/zx4c3kcuuZOUvYlXku8BLAMmZ0uqPcApzYvup4 CVaj6Rrvi0C17kgUMrH6UIaIOwaCvkHaJ7zEuovjsDVeWo8l3/H8U+2m0iZZZcsn 2Il8v7zeIwHOd2RPxvSZEqWVZUOcx7Dc+X68JcIqWamucL47z8Iwv6Jc7Q6qLrXo JVTD1nB8eSp0PPL3+/e0fS/gmB1zEOuK/nxIhdjqmaq8O95K+EMhcTAoT4uNlVeQ Nx+IfnpRTCBpilEz9JaABNInuIBDv8oeT8A== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cnsjm16ag-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for <libcamera-devel@lists.libcamera.org>; Tue, 03 Mar 2026 11:17:46 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-8c71655aa11so5615989685a.3 for <libcamera-devel@lists.libcamera.org>; Tue, 03 Mar 2026 03:17:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772536665; x=1773141465; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CGP20cioB98g8uxV7+sWAplxRuvnr6a1ZrjybqQix4A=; b=UV4XtFBi8C1nu5MpjOgBIyKJk0+gpo7JBCGN2k5arBXhl83tXyxNV+Sxfd0tZS7m8L fjKNNeXdULyQDuFTQO8+R4c5gW5hjjyAg+bnwexl3w1j2GnBdfs8oVBGur7JUlZvQYRU 3+SVpWh+EAV7sjfhgLdMw19XOrA2r0Z/Nz894Jm7sj0tG7jtNWsIsz+cFkVPUH9kJAEJ SL1lauI5M5cuVIHju6ToNgsi/ISGMygoDXHAoHVlSFbJR/3pZ3K7i7vkXCQsr0Ps+C2H fi00yEay6LCdKAdfr4gcTOICuW6E6Jcp0fy8zBbXaj/0XXSD84EfuK77jSK1MfrY1WsQ W1+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772536665; x=1773141465; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CGP20cioB98g8uxV7+sWAplxRuvnr6a1ZrjybqQix4A=; b=ZhOoUZAhZ5l2TqgZF/ZC6jdn/prsAc38jwRlOTWUZcD3OQCBM4yIGmXumc0+qsaGKn ejfJPWIEFe4qTSewfK1oNq1Ra1Fx+XZbrTafI7QLjLBEEK3IpRlQ9ijoYiz8+SlC7qLp nXD0p1VsAKVOW8T22jrxtzsPQRRv1jEP0RhDaTli6OvSnmtfLuAcCKmYEv0kkws/EjfQ tPdbEc2W85uVPcfht47jLjOXBmpDE+cijp3QfeBCyYCXbFxBCBNx64HaPixcelO3rlEj oldHU5OktIohmCJcmhJMHnFwo2bCxWQtXMpa61ewC+br9uahurxO8I8jkbXE6C6xD5RO Lhgw== X-Gm-Message-State: AOJu0Yw4PuGntkBjTbdDV/Ozn0Ntj+JyS46K1wm0/Cirjal2mmdtiAbX y+yqmr22kJjzckodMIYYcsY8lz2dX1lUvfNMPZStq2bOP+43Wa9jvd/tn41Bk7PNjqV9eCxaFxW 7HAFbdywdUS9OLgd77HHMNAvVftMCff+Ncka08GX5upWNPGyiMHr8qShAr/9b3QzubwISKN3jSu WaCdLNEzlJ X-Gm-Gg: ATEYQzwc+4uqcCauovJNL/aOuJlw2KA28WfOEs2kZ6RkjvLIkGvwjJlehwOc0oWL1i3 eFzmu6zdEgVFfIAIAyMYYWZ0tkdgQRfj4hPX+MV596YryA4Z/whbOhebX7/yWwrrk03AyTMDSKo gY9q0vsSNZxBMxA2ELdWqBqSh0nuUmbR/FS+V1QFQBp6orIztBddX9PSuGany1uOQXOee63fVYx lryONBnxZsvz9NqRJjfpC2lSoZmn9S8MrCbL2qKzUwjg6mqWfX7QxIsTttRSNxKUZN3vordzNat 6vWHQPtV41kGAGzLgfCi7SR3qNTsBYP2rNPIzEElcSVQCnDQbz+DchOnZphU+N6CM2iKeNRuycg jerda0b7hbs09kQ+7OUlSplxoJpCoJEZWPgU6KjynqDGsk5ADcEHEosnfKJLnfZDK/xLTJsmkkI Dn3GFvvrW5lHmzesqbpzkoxanLRM8d3hRRsw== X-Received: by 2002:a05:620a:4509:b0:8c6:e11c:5ebc with SMTP id af79cd13be357-8cbc8ddd208mr2067003685a.18.1772536664862; Tue, 03 Mar 2026 03:17:44 -0800 (PST) X-Received: by 2002:a05:620a:4509:b0:8c6:e11c:5ebc with SMTP id af79cd13be357-8cbc8ddd208mr2067001185a.18.1772536664425; Tue, 03 Mar 2026 03:17:44 -0800 (PST) Received: from t14s (2001-1c00-0c32-7800-beb3-9058-f5fe-3f2e.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:beb3:9058:f5fe:3f2e]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-66003479178sm2958144a12.9.2026.03.03.03.17.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 03:17:43 -0800 (PST) From: Hans de Goede <johannes.goede@oss.qualcomm.com> To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal <mzamazal@redhat.com>, Hans de Goede <johannes.goede@oss.qualcomm.com> Subject: [PATCH v4 0/4] software_isp: debayer_cpu: Add multi-threading support Date: Tue, 3 Mar 2026 12:17:37 +0100 Message-ID: <20260303111741.17417-1-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: 3hy0xG-yTAXH3M5F00GodNYr13VX2IQ3 X-Authority-Analysis: v=2.4 cv=GIUF0+NK c=1 sm=1 tr=0 ts=69a6c35a cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=xqWC_Br6kY4A:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=W2Wr-CLUWLQvppzWVxsA:9 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-ORIG-GUID: 3hy0xG-yTAXH3M5F00GodNYr13VX2IQ3 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzAzMDA4NiBTYWx0ZWRfX97WmokReEhW3 tNnyTt+BZ1TPpRymlj6/SXsByqdOdW+XylP4E9+YmuJcXk4t2BNlESst34xH253mLCTthCaBG57 lp1zhcw4x3grY3WYgwmhMgK4ZVgKhQZ/wm7us8pren4UUYY5jS5bmv7r1HLzMzvOxUmTkQBu8CY z1clpKnEOmB3/6cHrxm9/Eyd8pFVjmbwsaMYmXLnce7OLLyGDfPHUQo+8KjnFNVPjblL9vpKryz YnRndNzczRkGds5M7SfOk9mse4sRvEf636nvGUstI6YPdMz7k/ffvWhNXDA6g0nAGGARnRQ8Yoe AO70kS+g9hhxSeUSFKdxfSK+XXoQ2bHZfgiyZu/01WoxGnEPyiTibbr9ZdCQMlsB8rh751G8sLS HWNg9qy6uJv77aJuDYJ9XLSiVGdLpMlJDuD1dKF2lSGVdz0vn/e6PfdZnpr8eC7aLO9w5LTpIbd VHLz7SrQyM2VCd4WW1g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293, Aquarius:18.0.1121, Hydra:6.1.51, FMLib:17.12.100.49 definitions=2026-03-02_05,2026-03-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603030086 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>, <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>, <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> |
| Series |
|
| Related |
show
|
Hi All, The QCM2290 SoC used on the Arduino Uno-Q seems to have a weak GPU, so weak that it is barely faster then a single CPU core (CPU without CCM). This has made me code-up the long envisioned multi-threading support for the CPU softISP. Changes in v4: - Use const in for (const auto &s : stats_) {} in SwStatsCpu::finishFrame() - Move kMaxLineBuffers constant to DebayerCpuThread class - Document "software_isp", "threads" option in runtime_configuration.rst - Add an use constants for min/max/default number of threads Changes in v3: - Use std::unique_ptr for the DebayerCpuThread pointers - Document new DebayerCpuThread class - Make DebayerCpuThread inherit from both Thread and Object - Use for (auto &thread : threads_) - Use for (auto &s : stats_) {} - Move input format logging from DebayerCpu::configure() to SoftwareIsp::configure() Changes in v2: - Quite a bit of refactoring based on v1 feedback, dropped patch 3/5 and 4/5 from v2 since these now no longer make sense - Move the allocation of the vector of SwIspStats objects to inside the SwStatsCpu class, controlled by a configure() arguments instead of making the caller allocate the objects - Replace the DebayerCpuThreadData struct from v1 with a DebayerCpuThread class, derived from Object to allow calling invokeMethod for thread re-use in followup patches - As part of this also move a bunch of methods which primarily deal with per thread data: setupInputMemcpy(), shiftLinePointers(), memcpyNextLine(), process*() to the new DebayerCpuThread class - Re-use threads instead of starting new threads every frame - Add a new patch adding some extra DebayerCpu input format logging Benchmark results for the Uno-Q + IMX219 running at 3280x2464 -> 3272x2464 without CCM: 1 thread : 147ms / frame, ~6.5 fps 2 threads: 80ms / frame, ~12.5 fps 3 threads: 65ms / frame, ~15 fps GPU: 130ms / frame, ~7,5 fps GPU 0-copy: 110ms / frame, ~9.5 fps (requires pipeline + camss hacks) GPU lite: 85ms / frame, ~12 fps (CCM, contrast and gamma disabled) Regards, Hans Hans de Goede (4): software_isp: swstats_cpu: Prepare for multi-threading support software_isp: debayer_cpu: Add DebayerCpuThread class software_isp: debayer_cpu: Add multi-threading support software_isp: Log input config from configure() Documentation/runtime_configuration.rst | 1 + .../internal/software_isp/swstats_cpu.h | 25 +- src/libcamera/software_isp/debayer_cpu.cpp | 286 ++++++++++++++---- src/libcamera/software_isp/debayer_cpu.h | 33 +- src/libcamera/software_isp/software_isp.cpp | 12 +- src/libcamera/software_isp/swstats_cpu.cpp | 54 ++-- 6 files changed, 302 insertions(+), 109 deletions(-)