Patch Detail
Show a patch.
GET /api/patches/15703/?format=api
{ "id": 15703, "url": "https://patchwork.libcamera.org/api/patches/15703/?format=api", "web_url": "https://patchwork.libcamera.org/patch/15703/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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.222.1650878839.20186.libcamera-devel@lists.libcamera.org>", "date": "2022-04-25T09:27:10", "name": "[libcamera-devel,v4] libcamera: Test sensor's ability to discover ancillary devices", "commit_ref": "3d612720fb99057f10e21d2069aacdfbbf0f05d1", "pull_url": null, "state": "accepted", "archived": false, "hash": "67a03bb6e7cd2a29e100fae90965b6c83c399418", "submitter": { "id": 119, "url": "https://patchwork.libcamera.org/api/people/119/?format=api", "name": "Yunke Cao", "email": "yunkec@google.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/15703/mbox/", "series": [ { "id": 3067, "url": "https://patchwork.libcamera.org/api/series/3067/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3067", "date": "2022-04-25T09:27:10", "name": "[libcamera-devel,v4] libcamera: Test sensor's ability to discover ancillary devices", "version": 4, "mbox": "https://patchwork.libcamera.org/series/3067/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/15703/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/15703/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 904F4C0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Apr 2022 09:27:20 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F00BA65643;\n\tMon, 25 Apr 2022 11:27:19 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650878840;\n\tbh=kMflx7Gr6wUz4iSWW6bqn2Rm8Ei4j3qXeXLz+xLKlyM=;\n\th=Date:In-Reply-To:References:To:List-Id:List-Post:From:Cc:\n\tList-Subscribe:List-Unsubscribe:List-Archive:Reply-To:List-Help:\n\tSubject:From;\n\tb=Vz+GMHryu+s1TMaxk+VYOBVsPwYXqLNDTW3c1GzK5QaQLHUKoS/AgM7o3SnrjbRdS\n\tGnO0XjKuGoicDMRAk7Nn8aQlr5SSQxCoHWY2GylW1BnGY0cxHyDEmu4zhakjbFdrDB\n\tfhw+nIyxsLFFcB+9UeJC2KAiEhSW3mv+/rDCzaGcJx9ed69XLSl+5J43M0iSHFNOBl\n\t4b8SpTilK+pwQYtmy8mqbWhDoq0gYSs3Ggk+fXcTisDHH4ZBDfbu9uuOkGRbx9tBOt\n\tHdMbhwxZlllMvOapQ8HlxRbcMEeFY/V7hBrwQHnv89I8kNzyxR9N6Ch+1bTs8GziS9\n\tTjVmmCuHbxnsA==", "Date": "Mon, 25 Apr 2022 18:27:10 +0900", "In-Reply-To": "<368ddf73-1e8e-2009-2cd2-a85aae4a6a6e@ideasonboard.com>", "References": "<368ddf73-1e8e-2009-2cd2-a85aae4a6a6e@ideasonboard.com>", "To": "Kieran Bingham <kieran.bingham@ideasonboard.com>, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Message-ID": "<mailman.222.1650878839.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 v4] 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---\nChangelog since v3:\n - Remove unnecessary brace. Sorry! Kept forgetting this.\n\nChangelog since v2:\n - Flip the order of initProperties and discoverAncillaryDevices.\n - Fix log string.\n\nChangelog since v1:\n - Dont fail test when lens is not present.\n - Remove lens from dm.\n - Tested on both kernels with/without the vimc lens patch.\n\n src/libcamera/camera_sensor.cpp | 7 ++++++-\n test/camera-sensor.cpp | 11 +++++++++++\n 2 files changed, 17 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex eaa2da6b..c56b8a60 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -152,7 +152,12 @@ int CameraSensor::init()\n \t */\n \tif (entity_->device()->driver() == \"vimc\") {\n \t\tinitVimcDefaultProperties();\n-\t\treturn initProperties();\n+\n+\t\tret = initProperties();\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\n+\t\treturn discoverAncillaryDevices();\n \t}\n \n \t/* Get the color filter array pattern (only for RAW sensors). */\ndiff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp\nindex 372ee4af..dc99ab33 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,10 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\tlens_ = sensor_->focusLens();\n+\t\tif (lens_)\n+\t\t\tcout << \"Found lens controller\" << endl;\n+\n \t\treturn TestPass;\n \t}\n \n@@ -104,6 +109,11 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\tif (lens_ && 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 +126,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", "v4" ] }