Show a patch.

GET /api/patches/15702/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 15702,
    "url": "https://patchwork.libcamera.org/api/patches/15702/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15702/",
    "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.219.1650852019.20186.libcamera-devel@lists.libcamera.org>",
    "date": "2022-04-25T02:00:11",
    "name": "[libcamera-devel,v3] libcamera: Test sensor's ability to discover ancillary devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "39fbe3beea6c7d4673c200a91ed447577647a64e",
    "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/15702/mbox/",
    "series": [
        {
            "id": 3066,
            "url": "https://patchwork.libcamera.org/api/series/3066/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3066",
            "date": "2022-04-25T02:00:11",
            "name": "[libcamera-devel,v3] libcamera: Test sensor's ability to discover ancillary devices",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3066/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15702/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15702/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 2EB9BC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Apr 2022 02:00:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8160865644;\n\tMon, 25 Apr 2022 04:00:20 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1650852020;\n\tbh=QTCLp3mbuO0AqiijOHApKHBdsutZ//f9rEpf+4PM3zs=;\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=bJLdHM3YZdFhEG9BDUr7PYDi951pZa39Ui4454+Vtizqenb0YmT4kPiuBRL1YiZOx\n\tnWpHSKC/hTo4GdzX39lkNC9p1/dKPsLk+o4swoh5AoewpZ+3qe2phV7XbzkHfvFHQP\n\tschKP7coHBxs/HtHUZHoHzQmsUXyQ6ASv2/dHthG228Jaqink/M8JnPm8K3XiFr5eQ\n\tM700InoJrnY51EOIcOozIfOXv2zXWkGesl/ZdmOUxz5QJ6sYGEf2K7wJp1cUl/qIIu\n\tGS9jwXi2lbjTiHQre+dszBDzjVjvoOYqZtNFG2XadHKohj9Xp0zcSAUro4Tyi0hBZ2\n\tRK7PelCE9m0zg==",
        "Date": "Mon, 25 Apr 2022 11:00:11 +0900",
        "In-Reply-To": "<YmXXfYBi6/yiyXhS@pendragon.ideasonboard.com>",
        "References": "<YmXXfYBi6/yiyXhS@pendragon.ideasonboard.com>",
        "To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Message-ID": "<mailman.219.1650852019.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 v3] 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 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          | 12 ++++++++++++\n 2 files changed, 18 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..4473ca19 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,11 @@ 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+\t\t}\n+\n \t\treturn TestPass;\n \t}\n \n@@ -104,6 +110,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 +127,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",
        "v3"
    ]
}