Patch Detail
Show a patch.
GET /api/1.1/patches/15690/?format=api
{ "id": 15690, "url": "https://patchwork.libcamera.org/api/1.1/patches/15690/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15690/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<mailman.195.1650520453.20186.libcamera-devel@lists.libcamera.org>", "date": "2022-04-21T05:54:05", "name": "[libcamera-devel] libcamera: Test sensor's ability to discover ancillary devices", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "17227f06f2b18264aa879fb262b569c0e6d98500", "submitter": { "id": 119, "url": "https://patchwork.libcamera.org/api/1.1/people/119/?format=api", "name": "Yunke Cao", "email": "yunkec@google.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/15690/mbox/", "series": [ { "id": 3061, "url": "https://patchwork.libcamera.org/api/1.1/series/3061/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3061", "date": "2022-04-21T05:54:05", "name": "[libcamera-devel] libcamera: Test sensor's ability to discover ancillary devices", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3061/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15690/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15690/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 D5E2EC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 21 Apr 2022 05:54:14 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0522065643;\n\tThu, 21 Apr 2022 07:54:14 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650520454;\n\tbh=M1mPH6hNY5cTwNjOZiyJI995gigfYhUS7QU52X4QKRE=;\n\th=Date:To:List-Id:List-Post:From:Cc:List-Subscribe:List-Unsubscribe:\n\tList-Archive:Reply-To:List-Help:Subject:From;\n\tb=UjI238acxaVS2+f/lWeIfSajlPPWl2uQVyiQpbgNFtIMDE++sglnN3Atc0fZ42s65\n\tt5eBNhBZjgtm5fXJPiZn6l+hDt0YI/u0b7PK06Kj8yy+6Nokb0u5/bdzN/2txcTJxJ\n\tkLLbh8/BEbbpUWZek6dW8AcTmBbwpqwZ60zitXzkNWnsvW2NfqNunl4uKzdz+oCmbf\n\tn19dAOOkA3eiw0hUajf/CE7Fl3XaKeM15zvRjvNnsabKVnY7Iv2O4jtUaaF/cAmau+\n\tmzrD49cotcrW0muxfhNFGNyi8BR+J1qgVk50Auf/oDq5Brej3HnqcMA5OxUrImDPJ7\n\tq53LRzWjXqUBQ==", "Date": "Thu, 21 Apr 2022 14:54:05 +0900", "To": "Han-lin Chen <hanlinchen@google.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Message-ID": "<mailman.195.1650520453.20186.libcamera-devel@lists.libcamera.org>", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "From": "Yunke Cao via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Precedence": "list", "Cc": "Tomasz Figa <tfiga@google.com>, libcamera-devel@lists.libcamera.org,\n\tYunke Cao <yunkec@google.com>", "X-Mailman-Version": "2.1.29", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "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/>", "Reply-To": "Yunke Cao <yunkec@google.com>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "Subject": "[libcamera-devel] [PATCH] libcamera: Test sensor's ability to\n\tdiscover ancillary devices", "Content-Type": "message/rfc822", "Content-Disposition": "inline", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Use vimc lens to test sensor's ability to discover ancillary lens.\n\nTested with the recent kernel patch for vimc lens:\nhttps://lore.kernel.org/linux-media/20220415023855.2568366-1-yunkec@google.com/\n\nSigned-off-by: Yunke Cao <yunkec@google.com>\n---\n src/libcamera/camera_sensor.cpp | 5 +++++\n src/libcamera/pipeline/vimc/vimc.cpp | 2 ++\n test/camera-sensor.cpp | 13 +++++++++++++\n 3 files changed, 20 insertions(+)", "diff": "diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex eaa2da6b..fe366267 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -152,6 +152,11 @@ int CameraSensor::init()\n \t */\n \tif (entity_->device()->driver() == \"vimc\") {\n \t\tinitVimcDefaultProperties();\n+\n+\t\tret = discoverAncillaryDevices();\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\n \t\treturn initProperties();\n \t}\n \ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex c3e33ecf..1d8b9f4d 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -449,6 +449,8 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \tdm.add(\"Sensor B\");\n \tdm.add(\"Debayer A\");\n \tdm.add(\"Debayer B\");\n+\tdm.add(\"Lens A\");\n+\tdm.add(\"Lens B\");\n \tdm.add(\"RGB/YUV Input\");\n \tdm.add(\"Scaler\");\n \ndiff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp\nindex 372ee4af..55a5b68d 100644\n--- a/test/camera-sensor.cpp\n+++ b/test/camera-sensor.cpp\n@@ -12,6 +12,7 @@\n \n #include <libcamera/base/utils.h>\n \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/media_device.h\"\n@@ -57,6 +58,12 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\tlens_ = sensor_->focusLens();\n+\t\tif (!lens_) {\n+\t\t\tcerr << \"Failed to get ancillary lens\" << endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n \t\treturn TestPass;\n \t}\n \n@@ -104,6 +111,11 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\tif (lens_->setFocusPosition(10)) {\n+\t\t\tcerr << \"Failed to set lens focus position\" << endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n \t\treturn TestPass;\n \t}\n \n@@ -116,6 +128,7 @@ private:\n \tstd::unique_ptr<DeviceEnumerator> enumerator_;\n \tstd::shared_ptr<MediaDevice> media_;\n \tCameraSensor *sensor_;\n+\tCameraLens *lens_;\n };\n \n TEST_REGISTER(CameraSensorTest)\n", "prefixes": [ "libcamera-devel" ] }