From patchwork Thu Jun 4 09:50:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 26821 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 5224BC328C for ; Thu, 4 Jun 2026 09:51:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 641E5631CC; Thu, 4 Jun 2026 11:51:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="EewAAOrx"; 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 792E762DC4 for ; Thu, 4 Jun 2026 11:51:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1780566676; 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=0fYx01wSV9QIGlv7y/7G2OWR4MTP8wkYjyIbVosL1bY=; b=EewAAOrx4+FMxN03ej8blzWBzHMbWIkZS+w+s9+NEj4GUZadFItbIAdlOSDMkiWPZV79hU Z7Rno206IQefnsWYK/UDNXojCRu6fPcBMvn5i0VzlpSdgtYWghSoRVF3j2yXHkgNlv1OSQ DC2LP0HUga1AZ+AkE4zdcsh1c8+EGCw= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-21-vzFvogGaOW-0He8D5nIMSg-1; Thu, 04 Jun 2026 05:51:14 -0400 X-MC-Unique: vzFvogGaOW-0He8D5nIMSg-1 X-Mimecast-MFC-AGG-ID: vzFvogGaOW-0He8D5nIMSg_1780566673 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5FF821800473; Thu, 4 Jun 2026 09:51:13 +0000 (UTC) Received: from mzamazal-thinkpadp1gen7.tpbc.com (unknown [10.44.34.156]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B740630001A1; Thu, 4 Jun 2026 09:51:11 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal , =?utf-8?b?QmFybmFiw6FzIFDFkWN6?= =?utf-8?q?e?= , johannes.goede@oss.qualcomm.com Subject: [RFC PATCH v3 00/17] Software ISP: Share params and stats buffers Date: Thu, 4 Jun 2026 11:50:42 +0200 Message-ID: <20260604095105.68798-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-MFC-PROC-ID: poPAoOagSJxW1AP7Vg-CfSk6dWhoWvQaf9bZWqhjIso_1780566673 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 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(-)