From patchwork Mon Jun 8 15:03:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 26844 Return-Path: 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 3E87CC328C for ; Mon, 8 Jun 2026 15:04:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1D9EA61EED; Mon, 8 Jun 2026 17:04:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="DWcRCmK7"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0929D61E74 for ; Mon, 8 Jun 2026 17:04:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780931042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+1CL/v2CtsLG3Hh9jZ0aZOVjategBF0T3yKTvQt1gDs=; b=DWcRCmK7ySy38r45z7lhpWJ3JlJCrgCpS4Zxs+xpOqjlNrC0LNgfR9cpli336HzW2SUVdA YyxqjytgKyfVFVrTBhHTD7KCN7+V34CA59PPNqV5zhHQRMHyBdHOitavrD5552oQOJJRaq DeAorkWIdv+I3pSfLVTW/l3CDB2ZUl0= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-WgBGzP6vNUW589yoOyTCNg-1; Mon, 08 Jun 2026 11:03:57 -0400 X-MC-Unique: WgBGzP6vNUW589yoOyTCNg-1 X-Mimecast-MFC-AGG-ID: WgBGzP6vNUW589yoOyTCNg_1780931036 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D71401955F1F; Mon, 8 Jun 2026 15:03:55 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.48.51]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9077E1800361; Mon, 8 Jun 2026 15:03:53 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , Kieran Bingham , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= , johannes.goede@oss.qualcomm.com Subject: [RFC PATCH v4 00/17] Software ISP: Share params and stats buffers Date: Mon, 8 Jun 2026 17:03:29 +0200 Message-ID: <20260608150349.134371-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8RblqZ4fk-ZdZnaNsItYl45txov-mlnYfRRWPHJtfv8_1780931036 X-Mimecast-Originator: redhat.com X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This patch series implements parameters and statistics buffer sharing in software ISP. It implements the following software ISP TODOs: - 2. Reconsider stats sharing - 5. Store ISP parameters in per-frame buffers The series consists of three parts: 1. introductory cleanups and fixes 2. parameters buffers changes 3. statistics buffers changes It’s a way to make params correspond to the respective frames, which is currently not the case with software ISP. This series is RFC because it’ll conflict with the GPU ISP and libipa changes in progress (but the first 4 preparatory patches can be separated and handled independently). Changes in v4: - Update to remedy the messed up posting of v3 patches. - An old method name in a commit message updated. - Acks from Kieran added. Changes in v3: - Rebased on current master. - setIspParams renamed to paramsComputed. - availableParams_ changed from queue to vector. - Input buffers queued per each output. - Busy loops removed. - releaseIspParams renamed to paramsBufferReady. - File descriptor numbers are no longer used as buffer identifiers. - Miscellaneous typo fixes and other cosmetic changes. - Fixes of buffer handling on errors. - Missing unmapping of params buffers added. - Missing PROT_READ flag added to mmap. - Unnecessary SwIspStatsRef wrapper removed. Changes in v2: - Rebase on master and make it working with GPU ISP. Milan Zamazal (17): libcamera: software_isp: Fix misplacement in SoftwareIsp docstring libcamera: ipa: simple: Rename setIspParams to paramsComputed libcamera: software_isp: Queue the input buffer per each output libcamera: software_isp: Handle queueBuffers failure libcamera: software_isp: Introduce arguments for parameters buffers libcamera: software_isp: Separate allocation of the parameters buffer libcamera: software_isp: Track unused parameters buffers libcamera: software_isp: Allocation of multiple params buffers libcamera: software_isp: Allocate multiple parameters buffers libcamera: software_isp: Use multiple parameters buffers in IPA libcamera: software_isp: Share parameters buffers with debayering libcamera: software_isp: Remove per-frame params buffers TODO item libcamera: software_isp: Introduce arguments for statistics buffers libcamera: software_isp: Allocate statistics buffers libcamera: software_isp: Track statistics buffers libcamera: software_isp: Share statistics buffers with IPA libcamera: software_isp: Remove stats-sharing TODO item .../internal/software_isp/software_isp.h | 21 ++- .../internal/software_isp/swstats_cpu.h | 16 +- include/libcamera/ipa/soft.mojom | 11 +- src/ipa/simple/soft_simple.cpp | 91 ++++++------ src/libcamera/pipeline/simple/simple.cpp | 41 ++++-- src/libcamera/software_isp/TODO.md | 45 ------ src/libcamera/software_isp/debayer.cpp | 46 ++++-- src/libcamera/software_isp/debayer.h | 14 +- src/libcamera/software_isp/debayer_cpu.cpp | 76 +++++----- src/libcamera/software_isp/debayer_cpu.h | 16 +- src/libcamera/software_isp/debayer_egl.cpp | 18 ++- src/libcamera/software_isp/debayer_egl.h | 12 +- src/libcamera/software_isp/software_isp.cpp | 137 ++++++++++++++---- src/libcamera/software_isp/swstats_cpu.cpp | 57 +++----- 14 files changed, 350 insertions(+), 251 deletions(-)