[{"id":38558,"web_url":"https://patchwork.libcamera.org/comment/38558/","msgid":"<20260408221148.GN1965119@killaraus.ideasonboard.com>","date":"2026-04-08T22:11:48","subject":"Re: [PATCH 00/13] ipa: simple: Convert to libipa AWB implementation","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Apr 07, 2026 at 11:01:03PM +0100, Kieran Bingham wrote:\n> This series starts by clearing the unpacked fragment shader to keep the\n> same indentation in both shader types to ease future patches.\n> \n> Then there is a quite substantial patch which splits the AWB handling\n> for the SoftISP out of the combined matrix.\n> \n> This is important to be able to prevent saturation issues in bright\n> regions showing up as neon colours. The AWB is applied and then the\n> result is clamped to the sensor range (at that point with black level\n> subtracted).\n\nBut you don't fix the issue in this patch series, right ?\n\n> The gains are then fixed in the CPU ISP, with contributions from Milan.\n> \n> The GPU CCM matrix multiplication is simplified to use the native GPU\n> multiplication types, and adapts the ordering when the uniforms are\n> created.\n> \n> We then refactor the libipa lux algorithm to provide a common data\n> structure and move the RKISP1 implementation to use this new type.\n> \n> That allows the Simple IPA to re-use the lux algorithm without\n> duplicating the data structures.\n> \n> The same approach is then taken to convert the Awb structures to common\n> definitions and the simple IPA is refactored to be able to utilise the\n> libipa AWB implementation.\n> \n> The AWB implementations for configure, queueReqeust, and prepare are\n> then refactored into functions that can be directly called in the libipa\n> implementation to reduce duplicating identical code when adding a new\n> platform to use AWB.\n> \n> The last conversion patches might also further refactor common details\n> from the initialisation functions and process functions, and also the\n> stats helpers are completely duplicated, so they'll be in the next\n> version too.\n\nI was going to ask if this was planned :-)\n\nOne point that needs careful attention is if the common implementation\ncan support inline ISPs, offline ISPs, and offline ISP backends with\nstatistics computed by the frontend on the same frame.\n\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> ---\n> Kieran Bingham (11):\n>       libcamera: shaders: unpacked: Fix indentations\n>       softisp: Split AWB from Combined Matrix\n>       shaders: bayer: Use native matrix multiplication\n>       ipa: libipa: provide lux context structures\n>       ipa: simple: Add lux algorithm to the SoftIPA\n>       ipa: libipa: Awb: Provide common context storage\n>       libcamera: vector: Convertor Constructor\n>       ipa: simple: Convert awb to libipa implementation\n>       ipa: libipa: awb: Move configure to common\n>       ipa: libipa: awb: convert to common queueRequest\n>       ipa: libipa: awb: factor out common prepare\n> \n> Milan Zamazal (2):\n>       libcamera: software_isp: Fix black level handling in CPU ISP\n>       libcamera: software_isp: Apply gains in CPU ISP\n> \n>  include/libcamera/internal/vector.h        |   8 +\n>  src/ipa/libipa/awb.cpp                     | 155 ++++++++++++++++++++\n>  src/ipa/libipa/awb.h                       |  38 +++++\n>  src/ipa/libipa/lux.cpp                     |  16 ++\n>  src/ipa/libipa/lux.h                       |  12 ++\n>  src/ipa/rkisp1/algorithms/awb.cpp          |  73 +--------\n>  src/ipa/rkisp1/ipa_context.h               |  41 ++----\n>  src/ipa/simple/algorithms/awb.cpp          | 171 +++++++++++++++++-----\n>  src/ipa/simple/algorithms/awb.h            |  12 ++\n>  src/ipa/simple/algorithms/ccm.cpp          |   2 +-\n>  src/ipa/simple/algorithms/lux.cpp          |  93 ++++++++++++\n>  src/ipa/simple/algorithms/lux.h            |  39 +++++\n>  src/ipa/simple/algorithms/meson.build      |   1 +\n>  src/ipa/simple/ipa_context.h               |  20 +--\n>  src/libcamera/shaders/bayer_1x_packed.frag |  47 +-----\n>  src/libcamera/shaders/bayer_unpacked.frag  | 228 ++++++++++++-----------------\n>  src/libcamera/software_isp/debayer_cpu.cpp |  71 ++++-----\n>  src/libcamera/software_isp/debayer_egl.cpp |  17 +--\n>  src/libcamera/software_isp/debayer_egl.h   |   3 +\n>  src/libcamera/vector.cpp                   |   7 +\n>  20 files changed, 693 insertions(+), 361 deletions(-)\n> ---\n> base-commit: 7528d65aeee57c02ea5b085a3e3d364f23ed4ade\n> change-id: 20260321-kbingham-awb-split-d130eee76e36","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 C241EBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Apr 2026 22:11:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E118762E3B;\n\tThu,  9 Apr 2026 00:11:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E8E162846\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Apr 2026 00:11:50 +0200 (CEST)","from killaraus.ideasonboard.com\n\t(2001-14ba-703d-e500--2a1.rev.dnainternet.fi\n\t[IPv6:2001:14ba:703d:e500::2a1])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id AD5E0D9B;\n\tThu,  9 Apr 2026 00:10:21 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"PGx0yx6/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1775686221;\n\tbh=uVTQq9B17UDvPKKS60FLnkkA3KAr1sFbyg6r0UxB2A4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=PGx0yx6/6g65BoeMnHJ82ToQR/xsQJB7RoOqwqrOB8YQ1UPVbjcXEWaeOBXCINtUw\n\tuyuwh2nyJTek8n0ZnDG3pjXB6b2Y+AROfSLNdc6H0XhKPD0aXb7OHydKfMFEt78QTH\n\txDWX4oA3j1Y2wkm87bVrL0/XVi2nNMfBI2l2Fdoc=","Date":"Thu, 9 Apr 2026 01:11:48 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, Milan Zamazal <mzamazal@redhat.com>","Subject":"Re: [PATCH 00/13] ipa: simple: Convert to libipa AWB implementation","Message-ID":"<20260408221148.GN1965119@killaraus.ideasonboard.com>","References":"<20260407-kbingham-awb-split-v1-0-a39af3f4dc20@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20260407-kbingham-awb-split-v1-0-a39af3f4dc20@ideasonboard.com>","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>"}}]