{"id":22557,"url":"https://patchwork.libcamera.org/api/patches/22557/?format=json","web_url":"https://patchwork.libcamera.org/patch/22557/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250113215946.1033762-11-paul.elder@ideasonboard.com>","date":"2025-01-13T21:59:44","name":"[v8,10/12] libcamera: camera: Pre-process AeEnable control","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"c7e351101d0896952935f7651ea91cebf5f196f7","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22557/mbox/","series":[{"id":4949,"url":"https://patchwork.libcamera.org/api/series/4949/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4949","date":"2025-01-13T21:59:34","name":"AEGC controls","version":8,"mbox":"https://patchwork.libcamera.org/series/4949/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22557/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22557/checks/","tags":{},"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 2551DC3303\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Jan 2025 22:02:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DA1446855A;\n\tMon, 13 Jan 2025 23:02:25 +0100 (CET)","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 9849668549\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jan 2025 23:02:22 +0100 (CET)","from pyrite.hamster-moth.ts.net (unknown [173.16.167.215])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 333494382;\n\tMon, 13 Jan 2025 23:01:25 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"VOm+9YJO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1736805685;\n\tbh=NU4w64PEQnfOokV3ZKDNjRXuRgFxpXYHQz/jOUntsyA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=VOm+9YJOalfgjHQDEls1n+34jihv2291TI8obK3FtddnuFOG5ovZ0tC6rkjcSnBqv\n\tGFW56hBBI09Aww2KENzLN3FYUhFwO66h/4kVBWqh8LEKIe7c9ogDVi5B4xpEhDz/m4\n\tsMiQpBcCe9vLWlMli4GkYIwYRBeZQeAU8A0Bs9Q0=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Paul Elder <paul.elder@ideasonboard.com>,\n\tlaurent.pinchart@ideasonboard.com, stefan.klug@ideasonboard.com","Subject":"[PATCH v8 10/12] libcamera: camera: Pre-process AeEnable control","Date":"Mon, 13 Jan 2025 15:59:44 -0600","Message-Id":"<20250113215946.1033762-11-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.39.2","In-Reply-To":"<20250113215946.1033762-1-paul.elder@ideasonboard.com>","References":"<20250113215946.1033762-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"Handle the AeEnable under the hood in the Camera class, such that\nAeEnable activates ExposureTimeMode and AnalogueGain together. This\nallows applications the convenience of setting auto/manual mode of all\nof the AE-related controls, as well as protecting applications against a\nnasty behavior change if an aperture control is added in the future.\nThis also moves common handling code out of the IPA.\n\nWhile we also want to inject AeEnable in Camera::controls() so that IPAs\ndon't have to report it, it is technically difficult at the moment as\nControlInfoMaps are not easily modifiable.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\n---\nNo change in v8\n\nChanges in v7:\n- check that the camera supports the ae sub-controls before setting them\n  when handling AeEnable\n\nNew in v6\n---\n src/libcamera/camera.cpp | 20 ++++++++++++++++++++\n 1 file changed, 20 insertions(+)","diff":"diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 69a7ee535..56c585199 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -19,6 +19,7 @@\n #include <libcamera/base/thread.h>\n \n #include <libcamera/color_space.h>\n+#include <libcamera/control_ids.h>\n #include <libcamera/framebuffer_allocator.h>\n #include <libcamera/request.h>\n #include <libcamera/stream.h>\n@@ -1325,6 +1326,25 @@ int Camera::queueRequest(Request *request)\n \t\t}\n \t}\n \n+\t/* Pre-process AeEnable. */\n+\tControlList &controls = request->controls();\n+\tconst auto &aeEnable = controls.get(controls::AeEnable);\n+\tif (aeEnable) {\n+\t\tif (_d()->controlInfo_.count(controls::AnalogueGainMode.id()) &&\n+\t\t    !controls.contains(controls::AnalogueGainMode.id())) {\n+\t\t\tcontrols.set(controls::AnalogueGainMode,\n+\t\t\t\t     *aeEnable ? controls::AnalogueGainModeAuto\n+\t\t\t\t\t       : controls::AnalogueGainModeManual);\n+\t\t}\n+\n+\t\tif (_d()->controlInfo_.count(controls::ExposureTimeMode.id()) &&\n+\t\t    !controls.contains(controls::ExposureTimeMode.id())) {\n+\t\t\tcontrols.set(controls::ExposureTimeMode,\n+\t\t\t\t     *aeEnable ? controls::ExposureTimeModeAuto\n+\t\t\t\t\t       : controls::ExposureTimeModeManual);\n+\t\t}\n+\t}\n+\n \td->pipe_->invokeMethod(&PipelineHandler::queueRequest,\n \t\t\t       ConnectionTypeQueued, request);\n \n","prefixes":["v8","10/12"]}