From patchwork Wed Jan 28 07:49:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 25992 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 5A7E4C3200 for ; Wed, 28 Jan 2026 07:50:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2827A61FDC; Wed, 28 Jan 2026 08:50:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Cj7T+8A6"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4CFEC61FDE for ; Wed, 28 Jan 2026 08:50:23 +0100 (CET) Received: from neptunite.hamster-moth.ts.net (unknown [IPv6:2404:7a81:160:2100:508d:7983:72a6:2eeb]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8D86B1FBC; Wed, 28 Jan 2026 08:49:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1769586586; bh=0X1wm34UvMlbBJCmQrnSbT9MkaXn+ac955ulQ2EqHEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cj7T+8A6hRwy3Tf9I3k8kXqTcF7t1gNRBbZV+gny29tEDijWSlykfvVWeuFSjXbJM VWOsJCDfafiOy87eekLF6SY5vKIcg6jIw0FrLIXJkTPasTpLGeFtMAXfIgmSgWHJ0J xmmXfPSK4OzzhTatKJeKG9e3FG5bLd9pTYDqGfzY= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder Subject: [PATCH v5 8/8] camera, ipa: all: Remove AeEnable handling Date: Wed, 28 Jan 2026 16:49:56 +0900 Message-ID: <20260128074956.760538-9-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20260128074956.760538-1-paul.elder@ideasonboard.com> References: <20260128074956.760538-1-paul.elder@ideasonboard.com> 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" Remove AeEnable handling from the Camera and all IPAs, as it is now handled by the inject_controls layer. Signed-off-by: Paul Elder --- The mali-c55 IPA needs to support AnalogueGainMode and ExposureTimeMode, but that is out of scope for this series. No change in v4 No change in v3 No change in v2 --- src/ipa/mali-c55/algorithms/agc.cpp | 1 + src/ipa/rkisp1/algorithms/agc.cpp | 2 - src/ipa/rpi/common/ipa_base.cpp | 2 - src/libcamera/camera.cpp | 42 +------------------- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 --- 5 files changed, 3 insertions(+), 49 deletions(-) diff --git a/src/ipa/mali-c55/algorithms/agc.cpp b/src/ipa/mali-c55/algorithms/agc.cpp index 014fd12452ac..2acc45cc0b04 100644 --- a/src/ipa/mali-c55/algorithms/agc.cpp +++ b/src/ipa/mali-c55/algorithms/agc.cpp @@ -137,6 +137,7 @@ int Agc::init(IPAContext &context, const YamlObject &tuningData) if (ret) return ret; + /* \todo Support AnalogueGainMode and ExposureTimeMode */ context.ctrlMap[&controls::AeEnable] = ControlInfo(false, true); context.ctrlMap[&controls::DigitalGain] = ControlInfo( static_cast(kMinDigitalGain), diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 1ecaff680978..55cadb1793a5 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -155,8 +155,6 @@ int Agc::init(IPAContext &context, const YamlObject &tuningData) ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto), ControlValue(controls::AnalogueGainModeManual) } }, ControlValue(controls::AnalogueGainModeAuto)); - /* \todo Move this to the Camera class */ - context.ctrlMap[&controls::AeEnable] = ControlInfo(false, true, true); context.ctrlMap[&controls::ExposureValue] = ControlInfo(-8.0f, 8.0f, 0.0f); context.ctrlMap.merge(controls()); diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp index 322694985e72..eceb9d14d74d 100644 --- a/src/ipa/rpi/common/ipa_base.cpp +++ b/src/ipa/rpi/common/ipa_base.cpp @@ -56,8 +56,6 @@ constexpr Duration controllerMinFrameDuration = 1.0s / 30.0; /* List of controls handled by the Raspberry Pi IPA */ const ControlInfoMap::Map ipaControls{ - /* \todo Move this to the Camera class */ - { &controls::AeEnable, ControlInfo(false, true, true) }, { &controls::ExposureTimeMode, ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto), ControlValue(controls::ExposureTimeModeManual) } }, diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 1b3984e683b1..819693f6123d 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -1337,33 +1337,6 @@ std::unique_ptr Camera::createRequest(uint64_t cookie) return request; } -/** - * \brief Patch a control list that contains the AeEnable control - * \param[inout] controls The control list to be patched - * - * The control list is patched in place, turning the AeEnable control into - * the equivalent ExposureTimeMode/AnalogueGainMode controls. - */ -void Camera::patchControlList(ControlList &controls) -{ - const auto &aeEnable = controls.get(controls::AeEnable); - if (aeEnable) { - if (_d()->controlInfo_.count(controls::AnalogueGainMode.id()) && - !controls.contains(controls::AnalogueGainMode.id())) { - controls.set(controls::AnalogueGainMode, - *aeEnable ? controls::AnalogueGainModeAuto - : controls::AnalogueGainModeManual); - } - - if (_d()->controlInfo_.count(controls::ExposureTimeMode.id()) && - !controls.contains(controls::ExposureTimeMode.id())) { - controls.set(controls::ExposureTimeMode, - *aeEnable ? controls::ExposureTimeModeAuto - : controls::ExposureTimeModeManual); - } - } -} - /** * \brief Queue a request to the camera * \param[in] request The request to queue to the camera @@ -1432,9 +1405,6 @@ int Camera::queueRequest(Request *request) } } - /* Pre-process AeEnable. */ - patchControlList(request->controls()); - d->layers_->queueRequest(request); d->pipe_->invokeMethod(&PipelineHandler::queueRequest, @@ -1475,16 +1445,8 @@ int Camera::start(const ControlList *controls) ControlList *newControls = d->layers_->start(controls); - if (controls) { - ControlList copy(*newControls); - patchControlList(copy); - ret = d->pipe_->invokeMethod(&PipelineHandler::start, - ConnectionTypeBlocking, this, ©); - } else { - ret = d->pipe_->invokeMethod(&PipelineHandler::start, - ConnectionTypeBlocking, this, nullptr); - } - + ret = d->pipe_->invokeMethod(&PipelineHandler::start, + ConnectionTypeBlocking, this, newControls); if (ret) return ret; diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index 3bd51733d400..bad20d2c7712 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -610,11 +610,6 @@ int UVCCameraData::init(std::shared_ptr media) addControl(cid, info, &ctrls); } - if (autoExposureMode_ && manualExposureMode_) { - /* \todo Move this to the Camera class */ - ctrls[&controls::AeEnable] = ControlInfo(false, true, true); - } - controlInfo_ = ControlInfoMap(std::move(ctrls), controls::controls); /*