{"id":18176,"url":"https://patchwork.libcamera.org/api/1.1/patches/18176/?format=json","web_url":"https://patchwork.libcamera.org/patch/18176/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20230123154934.27803-2-naush@raspberrypi.com>","date":"2023-01-23T15:49:21","name":"[libcamera-devel,v2,01/14] pipeline: ipa: raspberrypi: Check if lens actuator is available","commit_ref":"a0701930a8be9900d428a8cbae0414b455b56e97","pull_url":null,"state":"accepted","archived":false,"hash":"bf20dc479249d4d95430136673fa6651e27ba0e0","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18176/mbox/","series":[{"id":3719,"url":"https://patchwork.libcamera.org/api/1.1/series/3719/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3719","date":"2023-01-23T15:49:20","name":"Raspberry Pi: Camera Module 3 support","version":2,"mbox":"https://patchwork.libcamera.org/series/3719/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18176/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18176/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 B8F32BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Jan 2023 15:49:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6F652603C7;\n\tMon, 23 Jan 2023 16:49:51 +0100 (CET)","from mail-wm1-x336.google.com (mail-wm1-x336.google.com\n\t[IPv6:2a00:1450:4864:20::336])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 48302625D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Jan 2023 16:49:48 +0100 (CET)","by mail-wm1-x336.google.com with SMTP id g10so9380372wmo.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Jan 2023 07:49:48 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tn16-20020a05600c181000b003d1de805de5sm10339689wmp.16.2023.01.23.07.49.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 23 Jan 2023 07:49:47 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674488991;\n\tbh=JkcTM5Umb+cECJQuUWQyERqriHYrMgewZU5j8qC3h/I=;\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=L8VuOSrI5Ih57X0bAJV3Weznt4nbmBqPBmZ/uGr660XYkJ005ANI777AY/X+OWtEb\n\txrBm3ME57vdwEQVVYP/1p9s2wkJqMGBB0P9qEPQJBUPSREWBuwTkrnG52RKUsHstVL\n\t7AyJbfkOBj6eotRFFHChJ8av7PdvHEEqAZrT6gKf29Dz9ZTpCdcAu65JFJzBk7RJYb\n\tb04qLSSvTSF4vGQeJwn3Cn6pdfjsrCRPWbArOylmEz97+CGniQWxxRA5CaGC58pNie\n\tBdfn+ZnIAktkS7IwVeUpRttbBreM3NLz0w35PIR1dOIyTayeOnIyqodnkhp7oH6o4J\n\t/GJ/a7txrO7Dw==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\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=9jfLANeusc6CqNEiWhjZhKjeKnRVCnEagrhwvI6M960=;\n\tb=oSaM+z8ZkzVVptpliruh2wd4kUh+TLeVmzdaJXS9pUlNMQ+OYnM+MgkIcASnQVrTls\n\tHvqIX2Zdw6lm4f7Cdg7b202lKqjtFQ/D1sbcazrA0TDpJxT54OGsnXOxgTXX1yhLKN0j\n\t6L+BqXINmYaJlT5ueahuQOUWOgKH7jwdUnYeoffSXOjmJhLVePiN9M2tE7CbzOQlCASu\n\ttoCMknfrqAY12I2nC1D/eJDw0OTb5i1DcNMxk33K48GrdM5i38yeljoo3cNODs99ZdLR\n\tZE/l0Gqw/dpkRTfx6KXTEDPsH7mgQep0Zu9EucvTIkQ2MNZ3lZTG25IVakGxTyee6pdW\n\ttV3Q=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"oSaM+z8Z\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=9jfLANeusc6CqNEiWhjZhKjeKnRVCnEagrhwvI6M960=;\n\tb=EYSiPEXFely5ovDEK/uosjs0tKiu11AKskO0bKyEMpIVkeizuIDpM1tKkkL8jFw/Ke\n\trk4rDr8mZh6AYHJlXYFv8g3j+ZufNr/xJh6SqCyIsA8fRyY/Dypb2Idn3SFWDJiVd2/m\n\t+4B415btoco0YXsWZZyyuBS4NdnVCNpWa74c8l6PwQ6OWg5ybWERrqWaiBxR3GjP18kQ\n\tizwr+azzdUAN1DgWjbghKp4nHAQ7nvQeb4quE3GgDoD8zHrMwmgjnzZ3pl8TDcZGVTvh\n\tWHzt0g3wQ/f1ZyIA37l7yxUZ2VjMS8zJuDOMZIE5x5LJkTh00Gb0msD6fOGh7vR6faTs\n\tAh/g==","X-Gm-Message-State":"AFqh2kpaUu5GH68ua7ivNAm2zZAaR2vjNaS6a+fMlbGo4pVrO+mS4bZG\n\tIBaF/pJvZlMlNb4+TSdDNoNLr/KSv/jwjt8Q94Q=","X-Google-Smtp-Source":"AMrXdXvBd0YHbNL+sccg056MS9UJFJTC3CTEUc3Fg6AOSYY66DXVaFKNwnDYrA61yWqBOdPdu5EjMg==","X-Received":"by 2002:a05:600c:16d3:b0:3d3:513c:240b with SMTP id\n\tl19-20020a05600c16d300b003d3513c240bmr24098326wmn.7.1674488987743; \n\tMon, 23 Jan 2023 07:49:47 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 23 Jan 2023 15:49:21 +0000","Message-Id":"<20230123154934.27803-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20230123154934.27803-1-naush@raspberrypi.com>","References":"<20230123154934.27803-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 01/14] pipeline: ipa: raspberrypi:\n\tCheck if lens actuator is available","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 <nick.hollinghurst@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Check if a lens actuator is available by the presense of the lens driver entity\nin the pipeline handler. Pass this result to the IPA on init.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>\n---\n include/libcamera/ipa/raspberrypi.mojom            | 2 +-\n src/ipa/raspberrypi/raspberrypi.cpp                | 7 +++++--\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 3 ++-\n 3 files changed, 8 insertions(+), 4 deletions(-)","diff":"diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex 189f978a5081..e7dabcbe5313 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -50,7 +50,7 @@ struct StartConfig {\n };\n \n interface IPARPiInterface {\n-\tinit(libcamera.IPASettings settings)\n+\tinit(libcamera.IPASettings settings, bool lensPresent)\n \t\t=> (int32 ret, IPAInitResult result);\n \tstart(libcamera.ControlList controls) => (StartConfig startConfig);\n \tstop();\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex bead436def3c..ec18497155ba 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -115,7 +115,7 @@ public:\n \t\t\tmunmap(lsTable_, MaxLsGridSize);\n \t}\n \n-\tint init(const IPASettings &settings, IPAInitResult *result) override;\n+\tint init(const IPASettings &settings, bool lensPresent, IPAInitResult *result) override;\n \tvoid start(const ControlList &controls, StartConfig *startConfig) override;\n \tvoid stop() override {}\n \n@@ -158,6 +158,7 @@ private:\n \n \tControlInfoMap sensorCtrls_;\n \tControlInfoMap ispCtrls_;\n+\tbool lensPresent_;\n \tControlList libcameraMetadata_;\n \n \t/* Camera sensor params. */\n@@ -204,7 +205,7 @@ private:\n \tuint32_t maxSensorGainCode_;\n };\n \n-int IPARPi::init(const IPASettings &settings, IPAInitResult *result)\n+int IPARPi::init(const IPASettings &settings, bool lensPresent, IPAInitResult *result)\n {\n \t/*\n \t * Load the \"helper\" for this sensor. This tells us all the device specific stuff\n@@ -241,6 +242,8 @@ int IPARPi::init(const IPASettings &settings, IPAInitResult *result)\n \t\treturn ret;\n \t}\n \n+\tlensPresent_ = lensPresent;\n+\n \tcontroller_.initialise();\n \n \t/* Return the controls handled by the IPA */\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex f6303e60e1e6..62417669bdc5 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -32,6 +32,7 @@\n \n #include \"libcamera/internal/bayer_format.h\"\n #include \"libcamera/internal/camera.h\"\n+#include \"libcamera/internal/camera_lens.h\"\n #include \"libcamera/internal/camera_sensor.h\"\n #include \"libcamera/internal/device_enumerator.h\"\n #include \"libcamera/internal/framebuffer.h\"\n@@ -1606,7 +1607,7 @@ int RPiCameraData::loadIPA(ipa::RPi::IPAInitResult *result)\n \n \tIPASettings settings(configurationFile, sensor_->model());\n \n-\treturn ipa_->init(settings, result);\n+\treturn ipa_->init(settings, !!sensor_->focusLens(), result);\n }\n \n int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPAConfigResult *result)\n","prefixes":["libcamera-devel","v2","01/14"]}