From patchwork Tue Aug 27 01:40:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 21032 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 DAA0AC323E for ; Tue, 27 Aug 2024 01:40:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7388E63422; Tue, 27 Aug 2024 03:40:50 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ghHWuiXs"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1AD8B61E4F for ; Tue, 27 Aug 2024 03:40:48 +0200 (CEST) Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 32F27B0B for ; Tue, 27 Aug 2024 03:39:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1724722781; bh=nEOs8yZYnK9reCESbBeyFakY6pJZXUBdM3KCg6ToPes=; h=From:To:Subject:Date:From; b=ghHWuiXs28ZtUg0Zr+VbPXIvhnTI5fZoS2D1m5T3KVj9twMOaODrzoomFfAFkl3od /L9Lj+qO4lWyliEIq3Iz33y8L0Kq9Skn2WRh2s+vp+m6hfF9ANiBbvrqQdzxB52Ksu nnsJkUl69HMfSpXIcTYyrlRl7DyWQX/lmr26HxCc= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v4 0/9] rkisp1: Support BLS on i.MX8MP Date: Tue, 27 Aug 2024 04:40:34 +0300 Message-ID: <20240827014044.24673-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.44.2 MIME-Version: 1.0 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" Hello, This patch series adds support for black level subtraction to the rkisp1 on i.MX8MP. While the rkisp1 IPA already supports black level subtraction, the i.MX8MP lacks the BLS block in the ISP and instead implements black level substraction in a new block named companding. Support for this block has been submitted for the kernel driver in [1] and [2], which have been merged in the stage tree master branch. The first part of this series adds support in the rkisp1 pipeline handler and IPA module for the new ISP extensible parameters format introduced in [1]. The first patch starts by updating the kernel headers to the new API. The next two patches then prepare the rkisp1 IPA module interface to pass the parameters buffer format from the pipeline handler to the IPA module (2/9), and the size of the filled buffer from the IPA module to the pipeline handler (3/9). With that in place, patch 4/9 adds classes that abstract the ISP parameters buffer in order to support the legacy fixed format and the new extensible format transparently for the IPA module's algorithms, and patch 5/9 makes use of those classes through the IPA module. Patch 6/9 finishes the first part by switching to the extensible format by default when available. The second part of the series then implements support for BLS on the i.MX8MP. Patch 7/9 updates the rkisp1 parameters helper classes with support for the companding block. Patch 8/9 adds a flag to the IPA context to signal support for the companding block, and patch 9/9 makes use of it in the black level correction algorithm to select between the BLS and companding blocks depending on the platform. Compared to previous versions, the main changes are the update to the API that has been merged upstream, and tested support for backward compatibility with older kernels. Please see individual change logs for details. [1] https://lore.kernel.org/r/20240703161048.247124-1-jacopo.mondi@ideasonboard.com [2] https://lore.kernel.org/r/20240704154932.6686-1-laurent.pinchart@ideasonboard.com Jacopo Mondi (3): include: linux: Update headers for rkisp1 extensible parameters ipa: rkisp1: Pass parameters buffer size to pipeline handler pipeline: rkisp1: Use the extensible parameters format Laurent Pinchart (4): ipa: rkisp1: Pass parameters buffer format to IPA module ipa: rkisp1: Add ISP parameters abstraction class ipa: rkisp1: Use the new ISP parameters abstraction ipa: rkisp1: params: Add companding blocks Paul Elder (2): ipa: rkisp1: Add compand feature flag to ipa context ipa: rkisp1: blc: Add support for BLS in compand include/libcamera/ipa/rkisp1.mojom | 3 +- include/linux/README | 2 +- include/linux/dma-heap.h | 2 +- include/linux/drm_fourcc.h | 18 + include/linux/rkisp1-config.h | 578 +++++++++++++++++++++++ include/linux/v4l2-controls.h | 2 + include/linux/videodev2.h | 5 +- src/ipa/rkisp1/algorithms/agc.cpp | 48 +- src/ipa/rkisp1/algorithms/agc.h | 2 +- src/ipa/rkisp1/algorithms/awb.cpp | 62 +-- src/ipa/rkisp1/algorithms/awb.h | 2 +- src/ipa/rkisp1/algorithms/blc.cpp | 60 ++- src/ipa/rkisp1/algorithms/blc.h | 8 +- src/ipa/rkisp1/algorithms/ccm.cpp | 15 +- src/ipa/rkisp1/algorithms/ccm.h | 4 +- src/ipa/rkisp1/algorithms/cproc.cpp | 14 +- src/ipa/rkisp1/algorithms/cproc.h | 2 +- src/ipa/rkisp1/algorithms/dpcc.cpp | 10 +- src/ipa/rkisp1/algorithms/dpcc.h | 2 +- src/ipa/rkisp1/algorithms/dpf.cpp | 27 +- src/ipa/rkisp1/algorithms/dpf.h | 2 +- src/ipa/rkisp1/algorithms/filter.cpp | 52 +- src/ipa/rkisp1/algorithms/filter.h | 2 +- src/ipa/rkisp1/algorithms/goc.cpp | 17 +- src/ipa/rkisp1/algorithms/goc.h | 2 +- src/ipa/rkisp1/algorithms/gsl.cpp | 20 +- src/ipa/rkisp1/algorithms/gsl.h | 2 +- src/ipa/rkisp1/algorithms/lsc.cpp | 29 +- src/ipa/rkisp1/algorithms/lsc.h | 4 +- src/ipa/rkisp1/ipa_context.cpp | 5 + src/ipa/rkisp1/ipa_context.h | 2 + src/ipa/rkisp1/meson.build | 1 + src/ipa/rkisp1/module.h | 3 +- src/ipa/rkisp1/params.cpp | 222 +++++++++ src/ipa/rkisp1/params.h | 163 +++++++ src/ipa/rkisp1/rkisp1.cpp | 29 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 +- 37 files changed, 1221 insertions(+), 210 deletions(-) create mode 100644 src/ipa/rkisp1/params.cpp create mode 100644 src/ipa/rkisp1/params.h base-commit: 874b63d5cb3f772d361ce891721e7580b09dd378