From patchwork Fri Dec 3 22:42:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15037 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 399D8C3250 for ; Fri, 3 Dec 2021 22:42:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D3B876086A; Fri, 3 Dec 2021 23:42:44 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Z/doEwo/"; dkim-atps=neutral Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8463360866 for ; Fri, 3 Dec 2021 23:42:42 +0100 (CET) Received: by mail-wr1-x434.google.com with SMTP id o13so8618705wrs.12 for ; Fri, 03 Dec 2021 14:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8BMguWwxIullLZL6opZ6tb3+ZmbY4ZCvkD3EpDSeXO8=; b=Z/doEwo/bl9xYnpCTSTEZcgkROPPqcH07AfsOmzAcgJBDJQxvFq8g/HUdCIIa8ihyC 0gxoQTuhNcF0TBmf/F6U47lMQv9pBk3fWQPt+4p+xjJtW600tFPE+YpNHI1ylApmKYau OMatZrfQU/GV0Z0Pj1802XW7w9bL1KlYrCHHPODCFWwfDS15RqmEFpI5OdnWPqmAlv3x 6o2Byg7yYObJLTIGsB1wIcTJABhbJh2dU0o2Fnhs8m7jfyQGgnxKrhtiAUM4cPAqFQN/ aE3ML1RcDMMEJiXFLo3oAjQaYZGRl3x4HNXzEDefZjn6Hi7WxHPrG8zoFsZ2SeswlTHM iDww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8BMguWwxIullLZL6opZ6tb3+ZmbY4ZCvkD3EpDSeXO8=; b=JtLmlwNNovX12nPOIEdaaj5PvcQfBrVHeIPYfnB25G9eCCuXvWXml1VqronGyVFBtT ISFU7GwHUb9fg9V8VQi8PMC+MDSm05XNrI7GChLLWhTth0Km4/5MKbp/TvWz60irqZD/ dYtZUo4Ko5WVPu7wiR75WYH6c+QlmhBT201y1X3NioonMQhLlJ580G4RbstMf1TLj5Ts 1FimWKzYoBvml6SHUFMH9gXiAoTSej72NDFrMnJz+pChqR0bpRoRGrzFvF1ccEupMypt 6BK9ECvMLk8PIn1WZuxWUSLnuvDDjoUvsWTbGrJWtaMQ24WFy7dysDsm7pMVfGjMEIy+ UPiw== X-Gm-Message-State: AOAM531t21cxG0COMoA/eKS8WhMX36ftUNXr1znAwhSDr5VCgk8tB4h6 AF6BdQK10yH4ypz0vsKcw75Fuz563YU= X-Google-Smtp-Source: ABdhPJymWeBDgFT0MXZvq8FD53tCHvLK6Dfl3lI677TU7FU2ze0rJTgyctqFCjMiQLQa7cm0/0B0qg== X-Received: by 2002:a5d:59ab:: with SMTP id p11mr24757159wrr.340.1638571362247; Fri, 03 Dec 2021 14:42:42 -0800 (PST) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id o25sm3939919wms.17.2021.12.03.14.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Dec 2021 14:42:41 -0800 (PST) From: Daniel Scally To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Dec 2021 22:42:30 +0000 Message-Id: <20211203224230.38700-8-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211203224230.38700-1-djrscally@gmail.com> References: <20211203224230.38700-1-djrscally@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 7/7] ipa: ipu3: Send lens controls to pipeline handler 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" Pick up the focus value from the AF algorithm and send lens controls along in the frame context. Signed-off-by: Daniel Scally --- Changes in v2: - Created a ControlList to hold the lensCtrls (Laurent) src/ipa/ipu3/ipu3.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 3828650d..5c57797d 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -174,6 +174,7 @@ private: uint32_t gain_; uint32_t minGain_; uint32_t maxGain_; + uint32_t focus_; utils::Duration lineDuration_; @@ -674,6 +675,12 @@ void IPAIPU3::setControls(unsigned int frame) ctrls.set(V4L2_CID_ANALOGUE_GAIN, static_cast(gain_)); op.sensorControls = ctrls; + focus_ = context_.frameContext.af.focus; + + ControlList lensCtrls(lensCtrls_); + lensCtrls.set(V4L2_CID_FOCUS_ABSOLUTE, static_cast(focus_)); + op.lensControls = lensCtrls; + queueFrameAction.emit(frame, op); }