From patchwork Fri Mar 31 08:19:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Semkowicz X-Patchwork-Id: 18516 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 1A67FC32A2 for ; Fri, 31 Mar 2023 08:20:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B650B627B4; Fri, 31 Mar 2023 10:20:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1680250800; bh=ddO7lhcTqPn3VTiQbDIp4Kz85JQMSb4v8yRyNascC0w=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=RZ/h4Ej1AUO7BKMfcdK7fNEGdOTK7gluACtM/HCI2QtUa/lsCdn1BD7dkNljs0qqm JqeN2jtoIAcb9HSn+AXi+du8lTRAieAOXQWv2NN5AQpE0LzOrNelrUhgck2IOP+TcW 4mSOEoZGpf2w7S5IGfBf+XAcB5o6TTyAaNqM6aoPWI3Y2ixWpINbce5Y5osd2Uo8Y8 h2WwLM+ehAdwfdg8aBkSLP+eAYY51Psst3Dpz06N0VW/Ng0VZCyyHknS3TT2VE93JE 1HjlxXGPjqYP1pdMzvZW7NvRPGP5bgj5dhf1cD5qSipi2dp+CFDvIrihBmefxv2l15 GFt+EDBEMCBqw== Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D7C4962767 for ; Fri, 31 Mar 2023 10:19:51 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=thaumatec-com.20210112.gappssmtp.com header.i=@thaumatec-com.20210112.gappssmtp.com header.b="6Bn+nXjL"; dkim-atps=neutral Received: by mail-lf1-x12c.google.com with SMTP id bi9so27854895lfb.12 for ; Fri, 31 Mar 2023 01:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thaumatec-com.20210112.gappssmtp.com; s=20210112; t=1680250791; x=1682842791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+vsWWrTWtLRSMEpTx2i8HEygt1ysKs5UmI4Wea6ETIw=; b=6Bn+nXjLWAjkd3aJSiMG8AO7xb57/xyzy65JVYi+mGHrmqZIGTkcdhsqwG0V7fhLyb E8xLVX2vmM1aM9Z50UVnnLdU4osgt4hR0xScKO7gt43EuDF6PnVIEfqZurWWL7wJ06ok HWU2FQu6QnTy86h87WNPq+3OfQuUC4ayKfuwI1kcWtVs9RMSLQi0eA+vlM5rqFt48iBZ Se4T0SBiwftzkOKCqd7nrN5gKWlNOB5kd43t5lDevEDSRjfc0/fcFM/JTtnFguMmt24A sLiOB6oRQtkOB7rgtLVYW4AJpcuk203l1bbTw9SaTbjagQd6waCw3ld61b9LQwpLTziS s7bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680250791; x=1682842791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+vsWWrTWtLRSMEpTx2i8HEygt1ysKs5UmI4Wea6ETIw=; b=MdYI13BcNjCVRZeoVKhrfBmRJDGZ5zrmiL22UnPWtzdasUdv+BGUlt0D70S+lQrrxf mve8vPsEeVqWrx4uw/hSWmXfP2oNYaqZhRWEIjit/w7FQkqVIUvnarX5kBGbCX7p0LTi LbSl9FpH2/l577NygFWjVs/3qEY46fJGMiLfQoty9UDftwD7Egvy7QUkVSVMikzdEf0r hduD/MeuCcOkHBCuYQJiC6GroklmJWyqIgjpsYprNHGoowhk4oZE2US1HVgO34zERKLh 7dlUJbUgkpIxvxwBYgznjjzVWYDcVG2xOLDi+swyFlHXUTH0Wj05xJmKyo6/2elZLkzX 7UVg== X-Gm-Message-State: AAQBX9esQo0DHxMhI0FfiP1b6T+tbsEY2u56DqD60zvSf/lTD8VM9O5X G/8lMSP7OnNmY1fQRIX1+JUSpYdaGy+4iGLP5FHT/A== X-Google-Smtp-Source: AKy350b/a2EP7/0m0rW+nFgsiFQJSCb8H2hu/nQeai9m1NRY66+bpER/mczdOfWroh/fIbtXe5KxIg== X-Received: by 2002:ac2:5551:0:b0:4dd:cef0:c27c with SMTP id l17-20020ac25551000000b004ddcef0c27cmr7147849lfk.33.1680250791173; Fri, 31 Mar 2023 01:19:51 -0700 (PDT) Received: from localhost.localdomain ([91.90.166.178]) by smtp.gmail.com with ESMTPSA id t1-20020ac24c01000000b004e84a8c3d86sm281459lfq.42.2023.03.31.01.19.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 01:19:50 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 31 Mar 2023 10:19:28 +0200 Message-Id: <20230331081930.19289-9-dse@thaumatec.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230331081930.19289-1-dse@thaumatec.com> References: <20230331081930.19289-1-dse@thaumatec.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 08/10] ipa: rkisp1: Add AF controls to the RkISP1 IPA 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: Daniel Semkowicz via libcamera-devel From: Daniel Semkowicz Reply-To: Daniel Semkowicz Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add controls supported by the AF algorithm to the list of controls supported by the RkISP1 IPA. This exposes the AF controls to the user and allows controlling the AF algorithm using the top level API. Signed-off-by: Daniel Semkowicz Reviewed-by: Jacopo Mondi --- src/ipa/rkisp1/rkisp1.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 292768cf..9c8b4a82 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -456,6 +456,28 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo, frameDurations[1], frameDurations[2]); + if (lensControls_) { + const ControlInfo &focusAbsolute = + lensControls_->at(V4L2_CID_FOCUS_ABSOLUTE); + + using namespace controls; + + ctrlMap[&AfMetering] = ControlInfo(AfMeteringValues); + ctrlMap[&AfMode] = ControlInfo(AfModeValues); + ctrlMap[&AfPause] = ControlInfo( + Span{ + { static_cast(AfPauseImmediate), + static_cast(AfPauseResume) } }); + ctrlMap[&AfTrigger] = ControlInfo(AfTriggerValues); + ctrlMap[&AfWindows] = ControlInfo( + Rectangle(), Rectangle(sensorInfo.outputSize), + Rectangle()); + ctrlMap[&LensPosition] = ControlInfo( + static_cast(focusAbsolute.min().get()), + static_cast(focusAbsolute.max().get()), + static_cast(focusAbsolute.def().get())); + } + *ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls); }