From patchwork Thu Dec 2 14:03:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 14993 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 506CFBF415 for ; Thu, 2 Dec 2021 14:03:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0A66E60876; Thu, 2 Dec 2021 15:03:37 +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="Z+4vNwE1"; 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 45FEC605B8 for ; Thu, 2 Dec 2021 15:03:36 +0100 (CET) Received: by mail-pj1-x1036.google.com with SMTP id p18-20020a17090ad31200b001a78bb52876so2522021pju.3 for ; Thu, 02 Dec 2021 06:03:36 -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=aQHpsPdta6ziFqfTvCAUcpIaejkMZEdSho4mOQlpNqA=; b=Z+4vNwE1tpzPQUW1+Ww+3+i7DQd7DeKkovbG2GhuTrXOcUlzPE/azIb7/JFnnWPBMN DlzwnZ18zC36ZVSH7meZc4QFOp37EK98DOjkBGzIZ4tJbeUnWBQhBdPEOtS30zxuGooc k3cfDBkH5wOXtLVNzT+J0mxwEXQYeb5DEpvPo= 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=aQHpsPdta6ziFqfTvCAUcpIaejkMZEdSho4mOQlpNqA=; b=dOTaZ4dLISGLMKrFqYQifBL73aXmFk3bBnFwn7gqcp/dv/SNjQxb5tracukaMT5XUm tl5+2ijzuJUtK2RvoQmo23mwm4Ee/hr2z9lnTDduR/A4Ucr9sNmMKIA+yrWjJrw8fZkU Ecy7kUUleBMnHNJNykzZ2W+BWzkqu4z8VRYrPjuAXCwf9i2SyTTld7xNrmhqk4+qnI3r 2/4R8pO1wBRda3V8DAUepx2GTspcZTZTRN8Vb7CP3ETalsewV8IW9xCIIpy3Jd78u5yZ z8/yy00Mj4KL1Cm4rvxHOLvQFKJNJiaw16oVxS0aCdXbZ+d7o0f+2kvXXKgyqyMOqqQl s7iA== X-Gm-Message-State: AOAM530NncpDmT0iYMhbxzYbFAkzmWg3/6/hjOwAcCa1nPdCR7NBgJ4b WLMbG+gz5Uww3N/Gfq632TOU4wU3LZFxuQ== X-Google-Smtp-Source: ABdhPJy8441E0e4AYx5EzaJgHai/3U4p+AZCXne2aNvRdBmJFMGyErCDDJJhqHIlbVw6WcE07XQHag== X-Received: by 2002:a17:90b:3908:: with SMTP id ob8mr6233468pjb.57.1638453814647; Thu, 02 Dec 2021 06:03:34 -0800 (PST) Received: from localhost ([2401:fa00:1:10:9029:d68:4045:e723]) by smtp.gmail.com with UTF8SMTPSA id b8sm3407187pfr.213.2021.12.02.06.03.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Dec 2021 06:03:34 -0800 (PST) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Dec 2021 22:03:17 +0800 Message-Id: <20211202140317.3118364-6-hanlinchen@chromium.org> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog In-Reply-To: <20211202140317.3118364-1-hanlinchen@chromium.org> References: <20211202140317.3118364-1-hanlinchen@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 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..d26c8a2e 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 *lens = cio2_.sensor()->lens(); + if (lens && !focusValue.isNone()) + lens->setFocusPostion(focusValue.get()); break; } case ipa::ipu3::ActionParamFilled: {