Show a patch.

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

{
    "id": 22865,
    "url": "https://patchwork.libcamera.org/api/patches/22865/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/22865/",
    "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": "<20250225164116.414301-2-stanislaw.gruszka@linux.intel.com>",
    "date": "2025-02-25T16:41:12",
    "name": "[v5,1/5] libcamera: v4l2_device: add frame start event helpers",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "664cbaf0eb687cf6040cd373ea7517705134e0c7",
    "submitter": {
        "id": 211,
        "url": "https://patchwork.libcamera.org/api/people/211/?format=api",
        "name": "Stanislaw Gruszka",
        "email": "stanislaw.gruszka@linux.intel.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/22865/mbox/",
    "series": [
        {
            "id": 5021,
            "url": "https://patchwork.libcamera.org/api/series/5021/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5021",
            "date": "2025-02-25T16:41:11",
            "name": "libcamera: start frame events changes",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/5021/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/22865/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/22865/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 6DB38BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 Feb 2025 16:41:38 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 336546871F;\n\tTue, 25 Feb 2025 17:41:38 +0100 (CET)",
            "from mgamail.intel.com (mgamail.intel.com [192.198.163.10])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 57AC06871C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Feb 2025 17:41:36 +0100 (CET)",
            "from orviesa005.jf.intel.com ([10.64.159.145])\n\tby fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n\t25 Feb 2025 08:41:35 -0800",
            "from sgruszka-mobl.ger.corp.intel.com (HELO localhost)\n\t([10.245.115.185]) by orviesa005-auth.jf.intel.com with\n\tESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Feb 2025 08:41:32 -0800"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=intel.com header.i=@intel.com\n\theader.b=\"mgO0N9e5\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n\tt=1740501697; x=1772037697;\n\th=from:to:cc:subject:date:message-id:in-reply-to:\n\treferences:mime-version:content-transfer-encoding;\n\tbh=wASek0M/LPWvI1PuzDpxmNo4n7PrnAoMj42iArPH8hM=;\n\tb=mgO0N9e5KVAq66kz1mU4886ERgwYK+1NHzAd4OfIvUWPyIuXq5L+3dcu\n\tQ3AsfKErx7gAAV5z2dZgtM10RFrt4Sh1oEDsd3XA4oyd1Lr1eYLmTb0T7\n\tohAqhAmGPN43MdAxYlOQJHv6P6/KIGc0xtQid0/Gr/SUbqoRt+2/1RFTU\n\tQMkJUDtOxXWPnSyiR0id5TkGo82kNrfo601bwRe7JyhOeBnK0+LQlWvw6\n\tlYSq85WR/fit197UiCvy7Kjkks4V9J9MYCyL1u0UVNnnbMhyElJ1DWauL\n\thW3uGaLwwppcLoy5kbBiHSUl4CpJT1H8wLCGTzbl0tcDt2D0ATz9nC00B w==;",
        "X-CSE-ConnectionGUID": [
            "dC94/yHQQ7+8E7XvYD4hxw==",
            "uhwbX5HaQdCAXQsziibfbQ=="
        ],
        "X-CSE-MsgGUID": [
            "wtm+nmFtQNWQYrd3QeUXww==",
            "smGPowgFQgaOzjJjtSOucw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6700,10204,11314\"; a=\"52740838\"",
            "E=Sophos;i=\"6.12,310,1728975600\"; d=\"scan'208\";a=\"52740838\"",
            "E=Sophos;i=\"6.12,224,1728975600\"; d=\"scan'208\";a=\"121689780\""
        ],
        "X-ExtLoop1": "1",
        "From": "Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Milan Zamazal <mzamazal@redhat.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tNaushir Patuck <naush@raspberrypi.com>,\n\tSakari Ailus <sakari.ailus@linux.intel.com>,\n\tHans de Goede <hdegoede@redhat.com>",
        "Subject": "[PATCH v5 1/5] libcamera: v4l2_device: add frame start event helpers",
        "Date": "Tue, 25 Feb 2025 17:41:12 +0100",
        "Message-Id": "<20250225164116.414301-2-stanislaw.gruszka@linux.intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20250225164116.414301-1-stanislaw.gruszka@linux.intel.com>",
        "References": "<20250225164116.414301-1-stanislaw.gruszka@linux.intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add helper to check if frame start event are supported by subdevice.\nSince kernel does not have interface to query supported events\nuse subscribe interface.\n\nAdditionally add helper for checking if the event enabled.\nWill be needed later to proper code flow if enabling the event\nfail for some reason.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> # v3\nSigned-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>\n---\n include/libcamera/internal/v4l2_device.h |  1 +\n src/libcamera/v4l2_device.cpp            | 19 +++++++++++++++++++\n 2 files changed, 20 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h\nindex affe52c2..a647c96a 100644\n--- a/include/libcamera/internal/v4l2_device.h\n+++ b/include/libcamera/internal/v4l2_device.h\n@@ -45,6 +45,7 @@ public:\n \tconst std::string &deviceNode() const { return deviceNode_; }\n \tstd::string devicePath() const;\n \n+\tbool supportsFrameStartEvent();\n \tint setFrameStartEnabled(bool enable);\n \tSignal<uint32_t> frameStart;\n \ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 2f65a43a..23c7d1ef 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -449,6 +449,25 @@ std::string V4L2Device::devicePath() const\n \treturn path;\n }\n \n+/**\n+ * \\brief Check if frame start event is supported\n+ * \\return True if frame start event is supported, false otherwise\n+ */\n+\n+bool V4L2Device::supportsFrameStartEvent()\n+{\n+\tstruct v4l2_event_subscription event {\n+\t};\n+\tevent.type = V4L2_EVENT_FRAME_SYNC;\n+\n+\tint ret = ioctl(VIDIOC_SUBSCRIBE_EVENT, &event);\n+\tif (ret)\n+\t\treturn false;\n+\n+\tioctl(VIDIOC_UNSUBSCRIBE_EVENT, &event);\n+\treturn true;\n+}\n+\n /**\n  * \\brief Enable or disable frame start event notification\n  * \\param[in] enable True to enable frame start events, false to disable them\n",
    "prefixes": [
        "v5",
        "1/5"
    ]
}