{"id":17049,"url":"https://patchwork.libcamera.org/api/patches/17049/?format=json","web_url":"https://patchwork.libcamera.org/patch/17049/","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":"<20220809144704.61682-3-dse@thaumatec.com>","date":"2022-08-09T14:47:03","name":"[libcamera-devel,v2,2/3] rkisp1: Add camera lens to PH and expose it to the IPA","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"e5482431e7136c8427deb1e2d19460548b3bf6cb","submitter":{"id":126,"url":"https://patchwork.libcamera.org/api/people/126/?format=json","name":"Daniel Semkowicz","email":"dse@thaumatec.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17049/mbox/","series":[{"id":3398,"url":"https://patchwork.libcamera.org/api/series/3398/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3398","date":"2022-08-09T14:47:01","name":"libcamera: rkisp1: Add lens control","version":2,"mbox":"https://patchwork.libcamera.org/series/3398/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17049/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17049/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 7895EC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Aug 2022 14:47:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2560863330;\n\tTue,  9 Aug 2022 16:47:14 +0200 (CEST)","from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com\n\t[IPv6:2a00:1450:4864:20::62e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2131D63326\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Aug 2022 16:47:11 +0200 (CEST)","by mail-ej1-x62e.google.com with SMTP id kb8so22655819ejc.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 09 Aug 2022 07:47:11 -0700 (PDT)","from localhost.localdomain (ip092042140082.rev.nessus.at.\n\t[92.42.140.82]) by smtp.gmail.com with ESMTPSA id\n\tcn15-20020a0564020caf00b0043ba0cf5dbasm6058486edb.2.2022.08.09.07.47.09\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 09 Aug 2022 07:47:10 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660056434;\n\tbh=mOCCKhMkLACzG+Qm14Ztu6VV6uEYpBKJBBmkQEn/lqw=;\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:\n\tFrom;\n\tb=XLNJois0kUbqjgyG4N7tyZgzliEAbl0CaLILwhYPz/acuYIcEoLbhN1tSeXaF1f6h\n\tDxxmwuuV5+a7f3xPFpIVhFpVSEIm8WxF+r3bsZ6YzJAF7htqT8VC3RnuyLyyyRUjk8\n\tjXR6lHB2ejWQxOMpFm2XptEZrPeUgJtS2nZcABZzvt3oF9mZ5KhpoZGD1z1bdAN4OQ\n\tdZXt33f6Wxe35/7vVL1Bdz/tL1n17B3Ff6/d2BtSvuW/PXKYZCau7ZiTTUgGXwg0tY\n\tdv5kxcXLZBVIJHAHuAVvk0CopA2TzUmuT4WZhXYilNvGJ3s3l39yAVIJbfsoggtWmj\n\tn6bSd6nHbeqng==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=thaumatec-com.20210112.gappssmtp.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc;\n\tbh=LqXoxDZDBQ41e/9ovPZw7Mb2q+SlI9QHIG7vwlMPzTo=;\n\tb=2uKvOnLSw6hSDi3S+G/4UqVPM8OWI9aJIp8Lz2/++6Z468EFYV71s8KVUAsaWmlcrD\n\t5A4LpmEed2BlfVDcn0OWjmUg8+GazPjPzRlUu1dfcNOLGnrUI+TVHYZLtFo9o18A/kqY\n\tQqYUnnfbFHzBwnfZOPNU1ssO0MjAStzkbuUQgzxmrdX/jUxImPpBDo+73KbcKn9yLivY\n\tIOoGRc8OA6pG+/xUA9Nj89u3gbg+RkpbUAOxfU0xjkX4mxMP+nWoh+pjbV8LqT/sF6rc\n\tCeUW5RokPOzmLsukf0SPG5Dm473pKeFWlSWYTSvkFHEPfDXP+z/RbYrt8Cwt/dxlUxzl\n\tBdaQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=thaumatec-com.20210112.gappssmtp.com\n\theader.i=@thaumatec-com.20210112.gappssmtp.com header.b=\"2uKvOnLS\"; \n\tdkim-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\tbh=LqXoxDZDBQ41e/9ovPZw7Mb2q+SlI9QHIG7vwlMPzTo=;\n\tb=Jy7YpimlrxYVZvp8UCr+xzrCaHQuC+Mr9pYEFhuUFQE5TFSqM+Pf1vDmcizOIDMV1a\n\tuNuue531R3qqZCxJfbtd1NnOoRK2W8vtvrdTB31XrQ3rvX2Y5XJfkE8sqdcKkZnqgEQf\n\twXY2o9GXW8MHJ1huea7i484Sie7NB4tkLHKpcFXZfPQt6ZvcmHtWpoM9xXrfS9d9Ykoe\n\t+u5teV3J7XdVh1+X257DLr00zoXQgqUdXFF5hmJtY6uRg+FP1HJTMiDuOzdEfWw2tPYX\n\tCBsi5YtKq9ffacivP4Mzsf8AEeJ2yTAih/cUX/SCCnrBgrHYSkj34RpmI+QIk2S7JpE9\n\tdKCw==","X-Gm-Message-State":"ACgBeo3r5S0DOigrxkWgalkfh+UxbM5F4XsrkHeZtP8DSBQFUpgHHxUJ\n\ttKXrI7oi8pNBb6aAZquN3tEMLKXy5GITow==","X-Google-Smtp-Source":"AA6agR4tbls6q384gtkBdUKfd1lUi305IEE/82MpYU2lrHPi+NvgVXSq8t31Aq0ssToY6kaQBarQ9A==","X-Received":"by 2002:a17:906:29d:b0:6f0:18d8:7be0 with SMTP id\n\t29-20020a170906029d00b006f018d87be0mr16983672ejf.561.1660056430632; \n\tTue, 09 Aug 2022 07:47:10 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  9 Aug 2022 16:47:03 +0200","Message-Id":"<20220809144704.61682-3-dse@thaumatec.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20220809144704.61682-1-dse@thaumatec.com>","References":"<20220809144704.61682-1-dse@thaumatec.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 2/3] rkisp1: Add camera lens to PH and\n\texpose it to the IPA","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":"Daniel Semkowicz via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Daniel Semkowicz <dse@thaumatec.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Check in pipeline handler if camera lens exists, add expose its controls\nto the IPA.\n\nSigned-off-by: Daniel Semkowicz <dse@thaumatec.com>\n---\n src/ipa/rkisp1/rkisp1.cpp                | 7 +++++++\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +++++\n 2 files changed, 12 insertions(+)","diff":"diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex ee484845..9e4c48a2 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -7,6 +7,7 @@\n \n #include <algorithm>\n #include <math.h>\n+#include <optional>\n #include <queue>\n #include <stdint.h>\n #include <string.h>\n@@ -70,6 +71,7 @@ private:\n \tstd::map<unsigned int, MappedFrameBuffer> mappedBuffers_;\n \n \tControlInfoMap sensorCtrls_;\n+\tstd::optional<ControlInfoMap> lensCtrls_;\n \n \t/* Camera sensor controls. */\n \tbool autoExposure_;\n@@ -201,6 +203,11 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,\n \n \tsensorCtrls_ = entityControls.at(0);\n \n+\tauto lensControls = entityControls.find(1);\n+\tif (lensControls != entityControls.end()) {\n+\t\tlensCtrls_ = lensControls->second;\n+\t}\n+\n \tconst auto itExp = sensorCtrls_.find(V4L2_CID_EXPOSURE);\n \tif (itExp == sensorCtrls_.end()) {\n \t\tLOG(IPARkISP1, Error) << \"Can't find exposure control\";\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 93287332..5f10c26b 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -28,6 +28,7 @@\n #include <libcamera/stream.h>\n \n #include \"libcamera/internal/camera.h\"\n+#include \"libcamera/internal/camera_lens.h\"\n #include \"libcamera/internal/camera_sensor.h\"\n #include \"libcamera/internal/delayed_controls.h\"\n #include \"libcamera/internal/device_enumerator.h\"\n@@ -694,6 +695,10 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \tstd::map<uint32_t, ControlInfoMap> entityControls;\n \tentityControls.emplace(0, data->sensor_->controls());\n \n+\tCameraLens *lens = data->sensor_->focusLens();\n+\tif (lens)\n+\t\tentityControls.emplace(1, lens->controls());\n+\n \tret = data->ipa_->configure(sensorInfo, streamConfig, entityControls);\n \tif (ret) {\n \t\tLOG(RkISP1, Error) << \"failed configuring IPA (\" << ret << \")\";\n","prefixes":["libcamera-devel","v2","2/3"]}