From patchwork Mon Aug 12 11:49:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Milan Zamazal X-Patchwork-Id: 20874 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 787FBC323E for ; Mon, 12 Aug 2024 11:50:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 53F8C633B5; Mon, 12 Aug 2024 13:50:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="eZtvnM+A"; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 23CCA63369 for ; Mon, 12 Aug 2024 13:50:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723463418; 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=kUcY1hoB0OinqkFGYvthoBa8AFGVPy0zkTDEaj7Vxzo=; b=eZtvnM+AKfNvlnIeu0lMjv8kFX0UpWuUCanK7TT9Yt/iFIVA93xO+azaw1RoG0zhkVbzLb 8NHDqZ+lsoTcQJ8gb3CMrWJWr1tG3BHmaDGiR4zr3jRSM8Td4jB9m0HOdVBfpq0/rhLzaY idkEv1jjcXGMQFZphmzn1MGIkf/sUZ4= Received: from mx-prod-mc-01.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-346-uuAUsb_jOd6jjQaqaBzN8Q-1; Mon, 12 Aug 2024 07:50:16 -0400 X-MC-Unique: uuAUsb_jOd6jjQaqaBzN8Q-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B8C4C195420E for ; Mon, 12 Aug 2024 11:50:15 +0000 (UTC) Received: from nuthatch.redhat.com (unknown [10.45.225.57]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7C1CD19772C4; Mon, 12 Aug 2024 11:50:14 +0000 (UTC) From: Milan Zamazal To: libcamera-devel@lists.libcamera.org Cc: Milan Zamazal Subject: [PATCH 00/16] Software ISP: Share params and stats buffers Date: Mon, 12 Aug 2024 13:49:49 +0200 Message-ID: <20240812115009.946036-1-mzamazal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 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. The buffers are currently shared only partially and they are copied sometimes. This is unlikely to be a performance problem, at least with the current CPU implementation, as the buffers are not large, especially when compared to the image data being processed. But it would be more elegant and consistent if the buffers were used in a way similar to the hardware pipelines, i.e. by having a ring of shared reusable buffers and passing the buffer ids everywhere. We also have the following software ISP TODOs: - 2. Reconsider stats sharing - 5. Store ISP parameters in per-frame buffers Implementation of this change is perhaps more complicated than initially expected. The first part of the patches deals with parameters buffers, the next part with statistics buffers. The whole patch series is quite long but the patches are split in the way to make them as simple as possible. This patch series is a continuation of the “Software ISP refactoring” patch series, which is currently in review. Milan Zamazal (16): libcamera: software_isp: Remove initializer_list include 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: Avoid copying particular color tables libcamera: software_isp: Remove per-frame params buffers TODO item libcamera: software_isp: Drop a comment about DelayedControls 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 ++- include/libcamera/ipa/soft.mojom | 11 +- src/ipa/simple/soft_simple.cpp | 80 ++++----- src/libcamera/pipeline/simple/simple.cpp | 14 +- src/libcamera/software_isp/TODO | 45 ----- src/libcamera/software_isp/debayer.cpp | 10 +- src/libcamera/software_isp/debayer.h | 5 +- src/libcamera/software_isp/debayer_cpu.cpp | 97 ++++++----- src/libcamera/software_isp/debayer_cpu.h | 23 ++- src/libcamera/software_isp/software_isp.cpp | 158 ++++++++++++++---- src/libcamera/software_isp/swstats_cpu.cpp | 55 +++--- src/libcamera/software_isp/swstats_cpu.h | 21 ++- 12 files changed, 307 insertions(+), 233 deletions(-)