From patchwork Fri Dec 3 09:44:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 15007 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 8344ABDB13 for ; Fri, 3 Dec 2021 09:44:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3C6EA6086C; Fri, 3 Dec 2021 10:44:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="mSmkGJUF"; dkim-atps=neutral Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 48FD060822 for ; Fri, 3 Dec 2021 10:44:44 +0100 (CET) Received: by mail-pj1-x1036.google.com with SMTP id p18-20020a17090ad31200b001a78bb52876so4708076pju.3 for ; Fri, 03 Dec 2021 01:44:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MQRk4fRbBtHKsH9Fd/COcASc6Fveou2FbQmOKlzyNYs=; b=mSmkGJUFAovzhVsnB8dzWPoBnhnSxCgrMzEpaXfYjyBDNRVjGEWywy4um0HdUw4lKj zTkjI1SLfarfYJdEQMgWag0RfNZheVUkXsphlHarsI2C95Bg0ukDseJ2ktIbJlhjvkAe a4fMvJUMIMXhXDpKZe64O76kDcV3H2JtHUMyM= 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=MQRk4fRbBtHKsH9Fd/COcASc6Fveou2FbQmOKlzyNYs=; b=hjkXs6SzPXhn25jZNSuvZlJCDmOeQu1XecDL4sI+kE8BhTQHaMK6GI1+Glh7ZSD/st m4Wz2ZxvnSifx37eZILLQOzP7pjas99TLqDpQi+h9k7y9RTAOb6X71wuYbUiUhkTIZNw H3nTLSctQSQ3bl5Ygg2046g4iXUxB0Rn39czOVCn16efEPpnHZyEd4W76yispmffNr3B CDMFLppOAZxlLE0iG4tZjS/8UtGLwWpxXDZhj/pCvrBf1VFtAlnSShSKyQtrjjX8/HL/ AS2ePPZdykJ0BTCzFZ7gVZQrzO21vvaYPf47Q0rfnnahAlrn+WTC2tiUKAStrpKn6YZ1 WqfA== X-Gm-Message-State: AOAM533lC/qDjKTk8ykZ+6uzq9usjx6HBA2xMGcGp2KfK5P6wsV+NGsc dE0IjV4CvymcxG8+JX/bMBb4cM8/46EQDQ== X-Google-Smtp-Source: ABdhPJxe13PBDr0AwGmQ5DhT+FL2ZUPrL1HNlVbmOJubgffuhS3+g6WpyGZa84jU6CCwvvJiTeP6Zg== X-Received: by 2002:a17:90b:17cd:: with SMTP id me13mr12864138pjb.79.1638524682307; Fri, 03 Dec 2021 01:44:42 -0800 (PST) Received: from localhost ([2401:fa00:1:10:110e:45d1:2f92:6647]) by smtp.gmail.com with UTF8SMTPSA id h26sm1859204pgm.68.2021.12.03.01.44.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Dec 2021 01:44:41 -0800 (PST) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Dec 2021 17:44:26 +0800 Message-Id: <20211203094426.101454-6-hanlinchen@chromium.org> X-Mailer: git-send-email 2.34.0.384.gca35af8252-goog In-Reply-To: <20211203094426.101454-1-hanlinchen@chromium.org> References: <20211203094426.101454-1-hanlinchen@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v8 5/5] ipu3: ipa: Allow IPA to apply controls to the lens device 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" Allow IPA to apply controls to the lens device. Signed-off-by: Han-Lin Chen Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/ipu3.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index c65afdb2..1215bdb8 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -24,6 +24,7 @@ #include #include "libcamera/internal/camera.h" +#include "libcamera/internal/camera_lens.h" #include "libcamera/internal/camera_sensor.h" #include "libcamera/internal/delayed_controls.h" #include "libcamera/internal/device_enumerator.h" @@ -1238,8 +1239,16 @@ void IPU3CameraData::queueFrameAction(unsigned int id, { switch (action.op) { case ipa::ipu3::ActionSetSensorControls: { - const ControlList &controls = action.sensorControls; - delayedCtrls_->push(controls); + const ControlList &sensorControls = action.sensorControls; + delayedCtrls_->push(sensorControls); + + const ControlList lensControls = action.lensControls; + const ControlValue &focusValue = + lensControls.get(V4L2_CID_FOCUS_ABSOLUTE); + + CameraLens *focusLens = cio2_.sensor()->focusLens(); + if (focusLens && !focusValue.isNone()) + focusLens->setFocusPostion(focusValue.get()); break; } case ipa::ipu3::ActionParamFilled: {