From patchwork Mon Jan 13 21:59:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 22547 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 3E54ABD1F1 for ; Mon, 13 Jan 2025 22:02:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 79C1E6851D; Mon, 13 Jan 2025 23:02:07 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Ay3Km2x2"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 096CE684E7 for ; Mon, 13 Jan 2025 23:02:06 +0100 (CET) Received: from pyrite.hamster-moth.ts.net (unknown [173.16.167.215]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9862E9FF; Mon, 13 Jan 2025 23:01:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736805669; bh=FpPx1z//irK/zTeV0nIZ2pbdkiFXMuKaqDQZUpwIClQ=; h=From:To:Cc:Subject:Date:From; b=Ay3Km2x2NaEqVYAKrSL0oB8KNkQ+xhPW4ADAT0fAIuu9VwPoTQX5pD2Smb9yburBo 4Ij3TmZceHMo0++Es6R4+xTiI2VsUc4aLnT3jw+onK2SbABb8/QAXVEe+5C5OsltFs SoDXj6CWWZAW1qHmJFhpHMKosBIe6EmdM1+hP1kc= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder , laurent.pinchart@ideasonboard.com, stefan.klug@ideasonboard.com, david.plowman@raspberrypi.com, naush@raspberrypi.com Subject: [PATCH v8 00/12] AEGC controls Date: Mon, 13 Jan 2025 15:59:34 -0600 Message-Id: <20250113215946.1033762-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.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" This patch series introduces a new set of AEGC controls that allow: - flicker avoidance when switching from auto to manual - shutter priority / gain priority To achieve this, we remove the existing AeEnable control and add two separate controls that control enabling/disabling auto-exposure and auto-gain. The definition of AeState is also made more concrete. The first two patches add the new controls, as well as documentation and design rationale. The rest of the patches naturally update the existing users of AeEnable, before finally removing the control altogether. v4 mainly improves documentation and implements the proper behavior when transitioning between auto and manual modes for the rkisp1. v5 is mostly minor wording changes, plus a fix to the rkisp1 aegc implementation to support mixed manual-auto ae modes (aka "shutter priority" / "gain priority"). v6 notably re-introduces the AeEnable control, as it was deemed necessary (see the relevant patches for details). Instead of re-writing the previous patches, it is tacked on in the last 4 patches of the series (with a trivial modification to the 8th patch). v7 is mainly minor wording changes. v8 adds auto to the default control values, as well as some todos for Raspberry Pi. On that note, Naush and David, could you please review (or ack) patches 5 and 12? Thanks, Paul Jacopo Mondi (4): libcamera: uvcvideo: Register ExposureTimeMode control test: ipa_data_serialization: Use DebugMetadataEnable ipa: raspberry: Port to the new AEGC controls controls: Remove AeLocked Paul Elder (8): controls: Introduce AEGC-related controls Documentation: design: ae: Document the design for AE controls ipa: rkisp1: Port to the new AEGC controls gstreamer: Generate the new AEGC controls controls: Redefine AeEnable libcamera: camera: Pre-process AeEnable control ipa: rkisp1: agc: Report new AeEnable control as available ipa: raspberry: Report new AeEnable control as available Documentation/design/ae.rst | 331 ++++++++++++++++++ Documentation/index.rst | 4 +- Documentation/meson.build | 1 + src/ipa/rkisp1/algorithms/agc.cpp | 133 +++++-- src/ipa/rkisp1/ipa_context.cpp | 24 +- src/ipa/rkisp1/ipa_context.h | 8 +- src/ipa/rpi/common/ipa_base.cpp | 86 ++++- src/ipa/rpi/controller/agc_algorithm.h | 8 +- src/ipa/rpi/controller/rpi/agc.cpp | 52 ++- src/ipa/rpi/controller/rpi/agc.h | 8 +- src/ipa/rpi/controller/rpi/agc_channel.cpp | 24 +- src/ipa/rpi/controller/rpi/agc_channel.h | 8 +- src/libcamera/camera.cpp | 20 ++ src/libcamera/control_ids_core.yaml | 279 +++++++++++++-- src/libcamera/control_ids_draft.yaml | 30 -- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 53 ++- .../ipa_data_serializer_test.cpp | 2 +- utils/codegen/gen-gst-controls.py | 5 +- 18 files changed, 953 insertions(+), 123 deletions(-) create mode 100644 Documentation/design/ae.rst