{"id":18677,"url":"https://patchwork.libcamera.org/api/patches/18677/?format=json","web_url":"https://patchwork.libcamera.org/patch/18677/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230601095630.25443-4-naush@raspberrypi.com>","date":"2023-06-01T09:56:30","name":"[libcamera-devel,v1,3/3] ipa: rpi: Set lens position to hyperfocal on startup","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"620451e15bb5fee3ed432c88f5a8d779572fed10","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18677/mbox/","series":[{"id":3898,"url":"https://patchwork.libcamera.org/api/series/3898/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3898","date":"2023-06-01T09:56:27","name":"Default lens behaviour","version":1,"mbox":"https://patchwork.libcamera.org/series/3898/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18677/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18677/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A850AC32AA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  1 Jun 2023 09:56:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3A684627DE;\n\tThu,  1 Jun 2023 11:56:36 +0200 (CEST)","from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2214762754\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  1 Jun 2023 11:56:34 +0200 (CEST)","by mail-wr1-x42f.google.com with SMTP id\n\tffacd0b85a97d-30ae5f2ac94so636538f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 01 Jun 2023 02:56:34 -0700 (PDT)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\th12-20020a5d6e0c000000b002ca864b807csm9889531wrz.0.2023.06.01.02.56.32\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 01 Jun 2023 02:56:33 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1685613396;\n\tbh=TICam9Xow+7nKhdnrxp8fr9f4L4r0ZdGSO5qtTt2U78=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=LMpyK+5tq369FIvtz7jwPS1DHVuaBs7Xo4zoL1OBK3ju1gpruK4LYejDtQrbyek1x\n\ty20NzgRS0Tcir93NvourGYz1Pl6us4OBTjphHzFz2vYzlPzTB7xpQQK9DIhfkbOAad\n\tjoNIrs1hWWVmUynGWw8YP97jHdX61siykyoOgHtN1f03PsYm4fdxDEWNm8ZYhM+uEa\n\tdrE3q2gp2DjL0T+PIxhwJxIYTDtSNz4NQ7insl5Qa9TOu+FJLCDGokE3JAKr76K2fx\n\t9BQDxJuOVhiu53zh1B5Bj9yx9OGYwkyLzJirey4qfQ6O12tpuMGbDJmJghL3e0Wv9k\n\to22fO2UT6+DNg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1685613393; x=1688205393;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=8ywRezXbvi/BA/1IZZMKl3g8qVoYLTXJyaq0/tA+OrQ=;\n\tb=qcMqZPXIgoPMAuH+DmDavoNI6l6LHdmQkJr/YjRM1oBjmq+rKfW/ybFuEQWq9ZvQjA\n\tcu5LosUr2Lvjev9/RsQETS61vo6dK3MBlWIaJ6Be6Cu/FjlG8pfZBXuz2AN6evMGqJn/\n\tFaT1eVbkpqaRwHAMxsSjxDNkLNFppsJmrLPs1mU0ghhX+u29svNB78aBIMC9sIhcGya8\n\tIxjSFeeMRoE9i/gyqe9LrHLXEdsHwNfzuLo5O1fneJ9Jz4cfAlrDmKWKInloroJUTu+L\n\tsazbNwGGmjx4cg9tYAQPBVMjonm85IlUSupYtPiPddV9ehPjWH1fqvvKU7OOZ9BnyXs3\n\tPr7Q=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"qcMqZPXI\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1685613393; x=1688205393;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=8ywRezXbvi/BA/1IZZMKl3g8qVoYLTXJyaq0/tA+OrQ=;\n\tb=I8A1owoifdMHGRrWOFwC6xYSz2I/3twgAlLkveophEM/RULxufg+eIM0rC105NbEE+\n\tMR0w5Qo75wD/bIaWVVqhqX1Hhu+sLQsP1L5prIesMghzYliceLBi/ZhX0sJF8RSUvzd3\n\tocHzctR/LbDgJmQcst09gSoQIsv8713uSlPwjuCVKL3rFttx0MdFnp9kVY1YDXbs/ZSu\n\tdIPDMtAv/pDhSQookrnrYLAV5Kh96QmY67SRUyYvmj5tFJtoOhSC46LhCo48cr0jmavZ\n\tCNj9WCfCU5IUFVOVwFD/8ki/F7WLY4GxpqC6h0hIVrmoEWDJD45sSP05exaKvgivNeg5\n\tZhiA==","X-Gm-Message-State":"AC+VfDyt9PvfLwFsHli/M+jR/P2wiwRL1Dg+nrk+cobfuvHglXQ4oXDi\n\tBsb3fiyUZEnleOZgMOIFOfgCVJ1yVnx2L+PWydgDAg==","X-Google-Smtp-Source":"ACHHUZ4N7ZzVRFIP7oC5913LksPTOLP2Or05BjXoBi+gjxf+T2QR5uh+BdpJfk89p9pDWp405KzHYw==","X-Received":"by 2002:adf:e785:0:b0:30a:e87b:515b with SMTP id\n\tn5-20020adfe785000000b0030ae87b515bmr1750497wrm.20.1685613393646; \n\tThu, 01 Jun 2023 02:56:33 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Thu,  1 Jun 2023 10:56:30 +0100","Message-Id":"<20230601095630.25443-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20230601095630.25443-1-naush@raspberrypi.com>","References":"<20230601095630.25443-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 3/3] ipa: rpi: Set lens position to\n\thyperfocal on startup","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"nick.hollinghurst@raspberrypi.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"On the first ipa->configure() call, set the lens position (if a lens is\npresent) to the default position. Typically this would be the hyperfocal\nposition based on the tuning data.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/rpi/common/ipa_base.cpp | 13 +++++++++++++\n 1 file changed, 13 insertions(+)","diff":"diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\nindex 599ad146a863..4413689b7bef 100644\n--- a/src/ipa/rpi/common/ipa_base.cpp\n+++ b/src/ipa/rpi/common/ipa_base.cpp\n@@ -199,6 +199,19 @@ int32_t IpaBase::configure(const IPACameraSensorInfo &sensorInfo, const ConfigPa\n \t\tagcStatus.shutterTime = defaultExposureTime;\n \t\tagcStatus.analogueGain = defaultAnalogueGain;\n \t\tapplyAGC(&agcStatus, ctrls);\n+\n+\t\t/* Set the lens to the default (typically hyperfocal) position on first start. */\n+\t\tRPiController::AfAlgorithm *af =\n+\t\t\tdynamic_cast<RPiController::AfAlgorithm *>(controller_.getAlgorithm(\"af\"));\n+\t\tif (lensPresent_ && af) {\n+\t\t\tfloat defaultPos = ipaAfControls.at(&controls::LensPosition).def().get<float>();\n+\t\t\tControlList lensCtrl(lensCtrls_);\n+\t\t\tint32_t hwpos;\n+\n+\t\t\taf->setLensPosition(defaultPos, &hwpos);\n+\t\t\tlensCtrl.set(V4L2_CID_FOCUS_ABSOLUTE, hwpos);\n+\t\t\tresult->lensControls = std::move(lensCtrl);\n+\t\t}\n \t}\n \n \tresult->sensorControls = std::move(ctrls);\n","prefixes":["libcamera-devel","v1","3/3"]}