From patchwork Fri Oct 6 13:19:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19102 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 88566BD808 for ; Fri, 6 Oct 2023 13:19:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D3B0B62964; Fri, 6 Oct 2023 15:19:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1696598398; bh=VLRzHOlz2Ny46BIb5FdGt+jSvwVsQtapTFi8+l2A7EI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=DVKkOUkaRLbypWSNmjtFtDXpN8Yolhgq/hzH+lZq+TVTqplGX4khSbmScz7MxUkSI 2LHj5vQ+NbxQXEo37/UMTqtrcNQX8llQ2xW+xIEeUkm0QqCyjbbYVleDPnXjAD/qiE 1dcKJss/Tw80/yisHZ55hGpH55rLEaM1ZhmZZEh/r/9bMJE18Y6pwfLtU8vNyp/agU ijGC9L+ZSPzFyNz1v0+a8rOaE7FRBnCmLo5qIcH2o7R2De7J9xb+mQSzq4yV2zFQ7P FmYAZ3RKa2tmuMWAWMGrCKcOnQpOlyoamvNmVDX9K/G196YALTHcEfmlZ1CIvsu3bC 8jm/azbR910ww== Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6431461DDD for ; Fri, 6 Oct 2023 15:19:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="NwPss1PI"; dkim-atps=neutral Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50444e756deso2844605e87.0 for ; Fri, 06 Oct 2023 06:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1696598396; x=1697203196; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1D3IeVpd08j2pEvDXTnftGKQQYQVfL9G1jiiGdqAzG4=; b=NwPss1PITDKSRe0WaGLB3sUEHCgphNZj0K6q7Zr27wB9KaOnfF5ZU95OXESITDvavb 1xifD3BM/lSQJ9TG71ZYKefIIV3+9+uF79jOYnresOA9l08mkwcMJMoq7VxxTr+odB7N 5/gzu9YndckH7zjzZa/l+Dk9e/PDVZlpnO9o3WZi5RkGh9GGeFP4jyX7jBDHoLLgBRPU IfGH+hBoQpVJOlWUfBbaXzD/YCYSaMks2qb/VfER/du3MTYXyZm/H7O0RcL+tvZMmzjy P3899K7qjQNXyjvJpeEtkukUZWTiKJbWxnJqTaiE6nGzyDPQN1eYUDbEdxEyQ+gdwFdY QHVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696598396; x=1697203196; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1D3IeVpd08j2pEvDXTnftGKQQYQVfL9G1jiiGdqAzG4=; b=RNfnEWVBqlW6KsPbOFrel0nn8isAWaTA7E47lWKO6/2mqtekdAMBOmCY/S3V4JjCsz oCCmNeVqzTL3urftO/UiQAkQAi24GHQTrpDnC65BEcLgisVa2BwlPMfjMT52SxY6YLpL fyHFPxIaTez6KyGSmQBZYckE7VwQJrIah0v01yJ7IlRyVay14Y8mkP6BI2FI3PYHpD1r 4N819vLZJAAiv9LaeUaidPdjQFSJTEP8MoH8zYoMBwPgPTermF0hekDtiqjfu7fV7zyw 4HVJw1crts7f6qj5YcgO31+Prgxwih3LOIRD4GFruJv+rBHgcE2Qw88vkZ7Ji4r7HKw2 RaYQ== X-Gm-Message-State: AOJu0YwDWuk0nbtAe9ujOCb2RAFkT6O9obeFkzbo2E21CUaGBWRehI49 J8+JrdwJTEp7tnavNWKM5hTsc3eNyZLnGGqDlGgM2Q== X-Google-Smtp-Source: AGHT+IHhiv+FbQDdcsMBrdTwjuxMspx6XSeSsVTbuLMACtmijXjyRQTV2Bk+QawHcqFmNOTPRr6srA== X-Received: by 2002:a05:6512:3f18:b0:503:35bb:1e74 with SMTP id y24-20020a0565123f1800b0050335bb1e74mr7056712lfa.61.1696598395800; Fri, 06 Oct 2023 06:19:55 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id m8-20020a056000180800b00321773bb933sm1639478wrh.77.2023.10.06.06.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 06:19:54 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Oct 2023 14:19:40 +0100 Message-Id: <20231006132000.23504-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 00/20] Raspberry Pi: Preliminary PiSP support 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, This (rather large) series introduces infrastructure needed for adding Raspberry Pi 5 support into libcamera. As some of you may be aware, Raspberry Pi 5 has new in-house designed ISP (named PiSP) and Camera Front End (CFE) hardware pipelines to handle camera and imaging tasks. The patches in this series add some necessary functionality and algorithms needed for the new PISP pipeline handler and IPA to function correctly. The actual pipeline handler and IPA code is not included in this series. We are waiting for the associated kernel drivers to be upstreamed before sending them to this mailing list. However, the code is available to inspect (particularly to understand the context of some of these changes) at https://github.com/raspberrypi/libcamera. Finally, even though my name is listed as the author on most of the commits, the following people also share authorship for this work: David Plowman Nick Hollinghurst William Vinnicombe Thanks, Naush David Plowman (4): ipa: rpi: agc: Add an AGC stable region ipa: rpi: contrast: Allow adaptive contrast enhancement to be disabled ipa: rpi: denoise: Support different denoise configurations ipa: rpi: agc: Avoid overwriting caller's statistics pointer Naushir Patuck (16): pipeline: rpi: Add RequiresMmap flag to RPi::Stream pipeline: rpi: Add Recurrent and Needs32bitConv flags to RPi::Stream pipeline: rpi: Add SharedMemObject class ipa: rpi: Add IpaBase::platformStart() member function mojom: pipeline: ipa: rpi: Add fields for PiSP objects ipa: rpi: Add try_lock() to RPiController::Metadata ipa: rpi: Add statsInline to the Controller hardware description ipa: rpi: Add PiSP definitions to the Controller hardware description ipa: rpi: Prepare ALSC for PiSP support ipa: rpi: Prepare AWB for PiSP support ipa: rpi: Add new algorithms for PiSP pipeline: rpi: Add SW downscale status to RPi::Stream build: ipa: Fix bug in building multiple IPA interfaces with the same mojom file pipeline: rpi: Move flip handling validation code pipeline: rpi: Make color space members in RPiCameraConfiguration public ipa: rpi: agc: When AGC channels are changed, start with the 1st channel include/libcamera/ipa/meson.build | 19 +- include/libcamera/ipa/raspberrypi.mojom | 6 +- src/ipa/rpi/common/ipa_base.cpp | 23 +- src/ipa/rpi/common/ipa_base.h | 1 + src/ipa/rpi/controller/agc_status.h | 3 + src/ipa/rpi/controller/cac_status.h | 16 ++ src/ipa/rpi/controller/contrast_algorithm.h | 2 + src/ipa/rpi/controller/controller.cpp | 18 +- src/ipa/rpi/controller/controller.h | 2 + src/ipa/rpi/controller/denoise_algorithm.h | 4 + src/ipa/rpi/controller/denoise_status.h | 19 ++ src/ipa/rpi/controller/hdr_algorithm.h | 25 ++ src/ipa/rpi/controller/hdr_status.h | 19 ++ src/ipa/rpi/controller/meson.build | 5 + src/ipa/rpi/controller/metadata.h | 1 + src/ipa/rpi/controller/rpi/agc.cpp | 6 +- src/ipa/rpi/controller/rpi/agc_channel.cpp | 7 + src/ipa/rpi/controller/rpi/agc_channel.h | 1 + src/ipa/rpi/controller/rpi/alsc.cpp | 16 +- src/ipa/rpi/controller/rpi/awb.cpp | 29 +- src/ipa/rpi/controller/rpi/cac.cpp | 81 ++++++ src/ipa/rpi/controller/rpi/cac.h | 38 +++ src/ipa/rpi/controller/rpi/contrast.cpp | 13 +- src/ipa/rpi/controller/rpi/contrast.h | 3 + src/ipa/rpi/controller/rpi/denoise.cpp | 198 +++++++++++++ src/ipa/rpi/controller/rpi/denoise.h | 59 ++++ src/ipa/rpi/controller/rpi/hdr.cpp | 270 ++++++++++++++++++ src/ipa/rpi/controller/rpi/hdr.h | 72 +++++ src/ipa/rpi/controller/rpi/saturation.cpp | 57 ++++ src/ipa/rpi/controller/rpi/saturation.h | 32 +++ src/ipa/rpi/controller/rpi/sdn.cpp | 2 + src/ipa/rpi/controller/rpi/tonemap.cpp | 61 ++++ src/ipa/rpi/controller/rpi/tonemap.h | 35 +++ src/ipa/rpi/controller/saturation_status.h | 13 + src/ipa/rpi/controller/stitch_status.h | 17 ++ src/ipa/rpi/controller/tonemap_status.h | 17 ++ src/ipa/rpi/vc4/vc4.cpp | 7 + .../pipeline/rpi/common/pipeline_base.cpp | 16 +- .../pipeline/rpi/common/pipeline_base.h | 6 +- .../pipeline/rpi/common/rpi_stream.cpp | 64 ++++- .../pipeline/rpi/common/rpi_stream.h | 54 +++- .../pipeline/rpi/common/shared_mem_object.h | 118 ++++++++ src/libcamera/pipeline/rpi/vc4/vc4.cpp | 23 +- 43 files changed, 1413 insertions(+), 65 deletions(-) create mode 100644 src/ipa/rpi/controller/cac_status.h create mode 100644 src/ipa/rpi/controller/hdr_algorithm.h create mode 100644 src/ipa/rpi/controller/hdr_status.h create mode 100644 src/ipa/rpi/controller/rpi/cac.cpp create mode 100644 src/ipa/rpi/controller/rpi/cac.h create mode 100644 src/ipa/rpi/controller/rpi/denoise.cpp create mode 100644 src/ipa/rpi/controller/rpi/denoise.h create mode 100644 src/ipa/rpi/controller/rpi/hdr.cpp create mode 100644 src/ipa/rpi/controller/rpi/hdr.h create mode 100644 src/ipa/rpi/controller/rpi/saturation.cpp create mode 100644 src/ipa/rpi/controller/rpi/saturation.h create mode 100644 src/ipa/rpi/controller/rpi/tonemap.cpp create mode 100644 src/ipa/rpi/controller/rpi/tonemap.h create mode 100644 src/ipa/rpi/controller/saturation_status.h create mode 100644 src/ipa/rpi/controller/stitch_status.h create mode 100644 src/ipa/rpi/controller/tonemap_status.h create mode 100644 src/libcamera/pipeline/rpi/common/shared_mem_object.h