{"id":26227,"url":"https://patchwork.libcamera.org/api/covers/26227/?format=json","web_url":"https://patchwork.libcamera.org/cover/26227/","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":"<20260223160930.27913-1-johannes.goede@oss.qualcomm.com>","date":"2026-02-23T16:09:26","name":"[v2,0/4] software_isp: debayer_cpu: Add multi-threading support","submitter":{"id":242,"url":"https://patchwork.libcamera.org/api/people/242/?format=json","name":"Hans de Goede","email":"johannes.goede@oss.qualcomm.com"},"mbox":"https://patchwork.libcamera.org/cover/26227/mbox/","series":[{"id":5809,"url":"https://patchwork.libcamera.org/api/series/5809/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5809","date":"2026-02-23T16:09:27","name":"software_isp: debayer_cpu: Add multi-threading support","version":2,"mbox":"https://patchwork.libcamera.org/series/5809/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/26227/comments/","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 26FC7C3293\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Feb 2026 16:09:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C87F86229C;\n\tMon, 23 Feb 2026 17:09:40 +0100 (CET)","from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com\n\t[205.220.180.131])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CB17B6227B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Feb 2026 17:09:37 +0100 (CET)","from pps.filterd (m0279873.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n\t61NC2hTX3151787 for <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Feb 2026 16:09:36 GMT","from mail-qk1-f197.google.com (mail-qk1-f197.google.com\n\t[209.85.222.197])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cgpj88s0h-1\n\t(version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Feb 2026 16:09:36 +0000 (GMT)","by mail-qk1-f197.google.com with SMTP id\n\taf79cd13be357-8c70ed6c849so4089359685a.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Feb 2026 08:09:35 -0800 (PST)","from t14s.vakwerkhuis.com ([78.108.130.194])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-b9084c60b91sm338284066b.14.2026.02.23.08.09.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 23 Feb 2026 08:09:31 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=qualcomm.com header.i=@qualcomm.com\n\theader.b=\"iMxI4pqV\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n\theader.b=\"GjFibsUG\"; dkim-atps=neutral","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcc:content-transfer-encoding:date:from:message-id:mime-version\n\t:subject:to; s=qcppdkim1; bh=N2MSRpoOFrNaktX3IM4FIZq0s0VofCuA/EC\n\tIWkIjGQE=; b=iMxI4pqVVpbajLkNDrivzi+L8ADJl+Ba7+96fR2R96pPRTUZC9K\n\tc8Foeaa/v6tzzDR4zfQXfNwhi20ZC/FyU8w6CpWPHDKtZVe3ITtwmhUYFyaaeVtm\n\tlXTT7WwNtCAelCE/Z74wPJ3iI3uay5tR0NGm9e1YHBLBmSbuXFKnQmkbQMua+eT5\n\tHSma78DHxo1h0RwqrACmY3pEJEQhtOpvgZHKbNl7mIzgau1Ytb73xrELsjCIUFH7\n\t5Wf75Nz60DZqcUUgMDwOtJfoljQGhGCINunIUbJAP2t+K5JTV18RG7rZM+edgXn7\n\ttr8y5pTWAACp+FWA1uB7pSVpNnGbVVn9KnA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=oss.qualcomm.com; s=google; t=1771862973; x=1772467773;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=N2MSRpoOFrNaktX3IM4FIZq0s0VofCuA/ECIWkIjGQE=;\n\tb=GjFibsUGtpDgqig2GGNvajSQpPHufxMCvzwVSEtFE+vp3IV9rjY42ZIDvKXRAQSTRS\n\tyP0G46g3R/BBWrpMm6GrpE/Qe9+hRfqcob0ko8m1S+ao90p6yGgwyWDlnqbna5iKGABN\n\t73keuIYzhR9XJTi5oKZueIDl6XcpXUmKb83oVS2e5klr+1Hd9MKHiK8kWJIEHAhpCVN8\n\tVrBxCn6ksyIONLP57TLUlvFlN+SeGqCf7dSvPSUMLqk2el6IysIx8nSuSVZvHOrpJ4+P\n\tYplbgzIwH/6ATcTYM82AzbLC+C0awfo3T3oWVBHSSBEWhM4gtSspXXkizvFp71LNBf7R\n\t+Q6Q=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1771862973; x=1772467773;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=N2MSRpoOFrNaktX3IM4FIZq0s0VofCuA/ECIWkIjGQE=;\n\tb=wQNhF/GnOOzV8O4rXMPtIcInx759yekjn3a54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id\n\taf79cd13be357-8cb8c9fa492mr1153196185a.21.1771862973208; \n\tMon, 23 Feb 2026 08:09:33 -0800 (PST)","by 2002:a05:620a:1a9e:b0:8b2:f9ac:a88b with SMTP id\n\taf79cd13be357-8cb8c9fa492mr1153192085a.21.1771862972817; \n\tMon, 23 Feb 2026 08:09:32 -0800 (PST)"],"From":"Hans de Goede <johannes.goede@oss.qualcomm.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>","Subject":"[PATCH v2 0/4] software_isp: debayer_cpu: Add multi-threading\n\tsupport","Date":"Mon, 23 Feb 2026 17:09:26 +0100","Message-ID":"<20260223160930.27913-1-johannes.goede@oss.qualcomm.com>","X-Mailer":"git-send-email 2.52.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwMjIzMDEzOSBTYWx0ZWRfX559IXomNYynb\n\tRkGmg5xZUzUQqYgg2G8MpfMZmMpqqL3Ul1NqSYx3tuWE2jB7bINtlWnpyMyoEFQaKVwL4xXKZf5\n\tkwvUv4n0thWjBguNnPF4TF9k6+qJREM3hLB5cTurfvqaftNtmz9QuKfZxi6D3beTQh0o/WH6JgV\n\tl3KKXtCP4FpEhvHVzNkHwDGU2Rm2TFUg2KsAdaG4RcwF/jSLrD68Z+V93IYv3W7usmRlI7ToHtr\n\ty2XoOhM5s5sn/9GMTr20dtShPC6heOZO+z7tqyG4uUOM3XexIcilCqsFEBDKLegqoDBUnb8CoJd\n\tqFApOdX4HqfujOCTqqHQVvRqufGq7GC3B78USLtYj35+MiHl3FNIp0ox5Gwoi4RkjO6nOd6bEXs\n\tADOwuuzqVczHNumKVHS70QbNA7wQ375Q0MO0HWuSiJPbrlKJQvhqheIYv4TWqAHIOSvfzKVcsBb\n\tdKWXkC1/X9lZRRg+I8w==","X-Proofpoint-GUID":"fU2e3Cft94zs1veykfw7MqEINDBCvhpd","X-Authority-Analysis":"v=2.4 cv=Z5Lh3XRA c=1 sm=1 tr=0 ts=699c7bc0 cx=c_pps\n\ta=50t2pK5VMbmlHzFWWp8p/g==:117 a=rrvG0T/C2D967D07Ol03YQ==:17\n\ta=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n\ta=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22\n\ta=ODPhIC0hU3zfFo4IB3gA:9 a=IoWCM6iH3mJn3m4BftBB:22","X-Proofpoint-ORIG-GUID":"fU2e3Cft94zs1veykfw7MqEINDBCvhpd","X-Proofpoint-Virus-Version":"vendor=baseguard\n\tengine=ICAP:2.0.293, Aquarius:18.0.1121, Hydra:6.1.51,\n\tFMLib:17.12.100.49\n\tdefinitions=2026-02-23_03,2026-02-23_03,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tclxscore=1015 suspectscore=0 bulkscore=0 adultscore=0 impostorscore=0\n\tpriorityscore=1501 phishscore=0 spamscore=0 malwarescore=0\n\tlowpriorityscore=0\n\tclassifier=typeunknown authscore=0 authtc= authcc= route=outbound\n\tadjust=0\n\treason=mlx scancount=1 engine=8.22.0-2602130000\n\tdefinitions=main-2602230139","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":"Hi All,\n\nThe QCM2290 SoC used on the Arduino Uno-Q seems to have a weak GPU, so weak\nthat it is barely faster then a single CPU core (CPU without CCM).\n\nThis has made me code-up the long envisioned multi-threading support\nfor the CPU softISP :)\n\nChanges in v2:\n- Quite a bit of refactoring based on v1 feedback, dropped patch 3/5 and 4/5\n  from v2 since these now no longer make sense\n- Move the allocation of the vector of SwIspStats objects to inside\n  the SwStatsCpu class, controlled by a configure() arguments instead\n  of making the caller allocate the objects\n- Replace the DebayerCpuThreadData struct from v1 with a DebayerCpuThread\n  class, derived from Object to allow calling invokeMethod for thread re-use\n  in followup patches\n- As part of this also move a bunch of methods which primarily deal with\n  per thread data: setupInputMemcpy(), shiftLinePointers(), memcpyNextLine(),\n  process*() to the new DebayerCpuThread class\n- Re-use threads instead of starting new threads every frame\n- Add a new patch adding some extra DebayerCpu input format logging\n\nBenchmark results for the Uno-Q + IMX219 running at 3280x2464 -> 3272x2464\nwithout CCM:\n\n1 thread :  147ms / frame, ~6.5  fps\n2 threads:   80ms / frame, ~12.5 fps\n3 threads:   65ms / frame, ~15   fps\nGPU:        130ms / frame, ~7,5  fps\nGPU 0-copy: 110ms / frame, ~9.5  fps (requires pipeline + camss hacks)\nGPU lite:    85ms / frame, ~12   fps (CCM, contrast and gamma disabled)\n\nRegards,\n\nHans\n\n\nHans de Goede (4):\n  software_isp: swstats_cpu: Prepare for multi-threading support\n  software_isp: debayer_cpu: Add DebayerCpuThread class\n  software_isp: debayer_cpu: Add multi-threading support\n  software_isp: debayer_cpu: Log input config from configure()\n\n .../internal/software_isp/swstats_cpu.h       |  25 +-\n src/libcamera/software_isp/debayer_cpu.cpp    | 265 +++++++++++++-----\n src/libcamera/software_isp/debayer_cpu.h      |  26 +-\n src/libcamera/software_isp/swstats_cpu.cpp    |  54 ++--\n 4 files changed, 265 insertions(+), 105 deletions(-)"}