From patchwork Tue Dec 7 22:45:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 15075 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 C9CF2C324B for ; Tue, 7 Dec 2021 22:45:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 589346089C; Tue, 7 Dec 2021 23:45:40 +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="Zr+UBnCr"; dkim-atps=neutral Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E0096087E for ; Tue, 7 Dec 2021 23:45:35 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id o19-20020a1c7513000000b0033a93202467so568724wmc.2 for ; Tue, 07 Dec 2021 14:45:35 -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=fZJMVtaiYXJNmuxHjKmiZ52CB6MxgG93UTGQsfH/49c=; b=Zr+UBnCrxA1h0oPa6SstZYxGn5KEoUWDAT+KhAAb9BKwm6cNMVENxPjzDaUg6BFMNR gWPn3rqTW+S7cxt4ZiWWzfpyqKY3tuTHD7kxR2pwZh+T1qrJ99XRH3C15ZMCeyMxqJHZ FFIl0xfKgJiFSx0q2FsCBRf7JugIa58qvfNq6mSyx/ox+QFvi3HdcKBQOjsgtSUxrA6S a08iwt+O/hITdIn6g0Vtd4mt2GGoCL3oU7ZCMrg+H8cEjm5BxWqOPT83DzlpRMz5GReC y/ha+vThQzRhIwUHfs3wTZ/crVJZB3uTdFGPGFApmRXu2mFUcIYKVQrb03LFUIZvVxBL +PBg== 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=fZJMVtaiYXJNmuxHjKmiZ52CB6MxgG93UTGQsfH/49c=; b=lJog/em1Pz8lPm2ZncK1OSV2t+k+TAtTAv4KHlUMRjeyZxPM49JA7ebD2rww/Y1LUR QR3L4dLQ4fUDWGwxYAskg5vNKdpjW9Ebdm3+Gcgd2FBN1xuCFdB9S1GTHuevEp8KmFTb jCxZGjlgwSJrThHfh4+vSJ/H1d00e1iSg4w7eKXwoSR7R/sq8MGj3kDJhbLfyznjG7TR NfzUQ42PyWS90aZaVRPVccrfZ9aqZkFONf/MPOOpiKKlhcuXm0zAWnrJ9ThREcuuoFDu 4U4GnOXx8fwdGMC0bvYS7shw43wGq/2AHD+A+e02EdNdnv0NjR0VkAfFgTeq8Sk9sllh MEKg== X-Gm-Message-State: AOAM532wpf32NsFRBi7gN4mN9yfTIOm9kJce1LIwNHkheQytti5XvncH uknYiEm31Yd16UvZRxPNb136S6rQYmg= X-Google-Smtp-Source: ABdhPJxRxeyatjVzCPM5biWtxntc9xvjAyawsHaA1dL4LR4jueAT+l10gBTbxJG8gjv5yaDDP81Jew== X-Received: by 2002:a05:600c:2156:: with SMTP id v22mr11052243wml.159.1638917135329; Tue, 07 Dec 2021 14:45:35 -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 y12sm980332wrn.73.2021.12.07.14.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Dec 2021 14:45:34 -0800 (PST) From: Daniel Scally To: libcamera-devel@lists.libcamera.org Date: Tue, 7 Dec 2021 22:45:12 +0000 Message-Id: <20211207224512.753979-10-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211207224512.753979-1-djrscally@gmail.com> References: <20211207224512.753979-1-djrscally@gmail.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 9/9] 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 Reviewed-by: Laurent Pinchart --- Changes in v3: - Replaced the new focus_ member with a local variable. 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 fe2bc3af..9303b33a 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -663,6 +663,7 @@ void IPAIPU3::parseStatistics(unsigned int frame, */ void IPAIPU3::setControls(unsigned int frame) { + uint32_t focus; IPU3Action op; op.op = ActionSetSensorControls; @@ -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); }