Patch Detail
Show a patch.
GET /api/patches/27427/?format=api
{ "id": 27427, "url": "https://patchwork.libcamera.org/api/patches/27427/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27427/", "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": "<20260721145958.68489-2-johannes.goede@oss.qualcomm.com>", "date": "2026-07-21T14:59:51", "name": "[v2,1/7] libcamera: V4L2Subdevice: Add whence argument to [get|set]Selection()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "83bf616d0c43e6ae5460f1ce1505b815fffce62d", "submitter": { "id": 242, "url": "https://patchwork.libcamera.org/api/people/242/?format=api", "name": "Hans de Goede", "email": "johannes.goede@oss.qualcomm.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/27427/mbox/", "series": [ { "id": 6070, "url": "https://patchwork.libcamera.org/api/series/6070/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6070", "date": "2026-07-21T14:59:50", "name": "camss: Add CAMSS pipeline handler", "version": 2, "mbox": "https://patchwork.libcamera.org/series/6070/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27427/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27427/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 D6ADDBE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 21 Jul 2026 15:00:09 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2EEB967E6E;\n\tTue, 21 Jul 2026 17:00:07 +0200 (CEST)", "from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com\n\t[205.220.180.131])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CE6596601C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jul 2026 17:00:05 +0200 (CEST)", "from pps.filterd (m0279871.ppops.net [127.0.0.1])\n\tby mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n\t66LDg3W91958685 for <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jul 2026 15:00:04 GMT", "from mail-qt1-f200.google.com (mail-qt1-f200.google.com\n\t[209.85.160.200])\n\tby mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fj1bvu2q4-1\n\t(version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jul 2026 15:00:04 +0000 (GMT)", "by mail-qt1-f200.google.com with SMTP id\n\td75a77b69052e-51c12e43b98so222069171cf.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Jul 2026 08:00:04 -0700 (PDT)", "from shalem\n\t(2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl.\n\t[2001:1c00:c32:7800:5bfa:a036:83f0:f9ec])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-c1712a5f837sm615968066b.32.2026.07.21.08.00.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 21 Jul 2026 08:00:00 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=qualcomm.com header.i=@qualcomm.com\n\theader.b=\"nrIlssm9\"; dkim=pass (2048-bit key;\n\tunprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n\theader.b=\"DakKHFYh\"; dkim-atps=neutral", "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n\tcc:content-transfer-encoding:date:from:in-reply-to:message-id\n\t:mime-version:references:subject:to; s=qcppdkim1; bh=26USYEaNweJ\n\tZtnHULZ3L3rzdqfTLZs2n2K/0B+cc0ok=; b=nrIlssm9LbQLbfsMWSE6tR+FGIH\n\txTjZd4aUezo7pY/ZvgkPwEuQ0KqgGb2o9/o66YflaBI2NwArmFUVfyZRasfDQcu3\n\twJWZC6iIWPPr6RPJifaIjthWoUprdw2MQFuG8vLxGg9T/zHCdsdpA3uayM4mG3Qh\n\tqVTuR66FtjLHtSnjpSjBhN3hc9ACUy243ZOAR5qRYxuQ+2KjlzjUzPuorcyOiI0k\n\t67ZX0aciIu2sGzMJvcX+CFjgv2MzqybILEjoDf9GpdmpDuXVwie0sLgT6ypMFKWt\n\tOwM8TJq1WqGjFvaLyb6kFFzRJQNM5uhWaMsVXBYGLDR1aBgGKmjZAEflszQ==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=oss.qualcomm.com; s=google; t=1784646003; x=1785250803;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to:content-type;\n\tbh=26USYEaNweJZtnHULZ3L3rzdqfTLZs2n2K/0B+cc0ok=;\n\tb=DakKHFYhhsMj1vODeCkMvisP89ByZSKAqUqHxbwUzWmJ+cl/ShB6MwRNUAHZHG2Ft+\n\t3mn4AEJarWsteQzO6sAvZzlKBN1IsRcBG8h2fvGFCa0k3B1v2xLyRcYkFoR80mVO0mBa\n\tHBQaGQp14ZJ5Sf+OZ12RCLR8A0gvRnziJYnc1ZeHcsAHPisfjbNtdaIR+LkiOU8STAJm\n\td+zSFLKUTAhaqqg2LqoUj5q9MGMkvSA454uNZ5CBy6z8uoidzEZaO0LFcO/B/PaX8Yrr\n\tP9yHsUqtr9MIJ3+yLcTPZvU5404VNiCF2B0TqRZN5xrqBJoW8jmNbc15/dLcsP/tf83G\n\tezbQ==" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1784646003; x=1785250803;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to:content-type;\n\tbh=26USYEaNweJZtnHULZ3L3rzdqfTLZs2n2K/0B+cc0ok=;\n\tb=Xzm5wPmczmFd64qKZn07zzsloRz6LUNdP+a6sNjdWF+kMoUWcZqyosYYGElGYiw0Qp\n\tUNX0mJhqwnAKb0GxxMvdYk30/MiGY+HcR7CGQ4PE72FA7FMUGOpwJW/s2PTrwsF5t642\n\t1lI+TTwCY//59V8Q2p1WukNHAORQnqlA2Hg/CtgV4fNBkUBe3LLyEQkHH3maSaOC6ost\n\tjDbXAzE27WCg9ykhS+Hf7IWO4EmgnBweYxcdNQNOPPC8irCoTCJfbW+jRPjslJQHJXy7\n\tkpEg72uEW/Up6ziZdbEEYFC2mnk2S/XT2wumDaSyLfA7MmH0yoDtBv1bvmw2/9omGD1J\n\tZhJw==", "X-Gm-Message-State": "AOJu0Yw1wUOktwA458J4mv/HpuYntpb/uzVzMmo6C38ZvrQoedNZx8/l\n\tjBFV6BBjz5AHT7M8A1HciO+mxFv4OquIubjW9Hhez9ywZft8hFTYjvgJGlivMeiPSpsJnMXr5Xe\n\t5Z3QN/C+wpN2+EGu68I8ybA5s7myW54i6A0lTGiR9JWTL1WJuE8B244K837b2oLLOwxe1ZyrXcL\n\tVNe13A8OKi", "X-Gm-Gg": "AfdE7cm9/3azcCj174gR4OY8yN5HMqC4mJW9aFUwkKMVQ2u7Ub6k+POeff6WVOQR4/8\n\t0g0CrWK1w31yWPWulThmWqVcAjIqXyX+v7qmxAztTalItdme9AC5w23UV6bA/MiVFk7qLVDeqU+\n\tJN7JuLx5G+9JakQ6nz+3yZ/l0LcRVkxTfyS7K1fkWnb45bdF1hDNrlhGtY5NsR7MDBZpvRuI2jF\n\t4DOwa21HVtgZ3k+BY3Hjt0wdx7qCmVJtXLWgx3Ict3dE0BVNmhoF089K9SWlH0+g51rN+aN7WUu\n\tdzjB6mmZz7HM2TcjLc6mI4mQt5wYp5EekGTdiot0O3slz8P7Xbh9LbjJw6jYnFl70OZRjeq/XGV\n\to/um893zGMbexop+BJNIO9Xe8+pv3BCSfDOr1RRo0dqK7a4U+yMcpAV5C59URWXFq52aRhpB+72\n\tRRDEN8iO12xtH595s=", "X-Received": [ "by 2002:a05:622a:c85:b0:519:e020:6087 with SMTP id\n\td75a77b69052e-5213c013438mr183324131cf.11.1784646002245; \n\tTue, 21 Jul 2026 08:00:02 -0700 (PDT)", "by 2002:a05:622a:c85:b0:519:e020:6087 with SMTP id\n\td75a77b69052e-5213c013438mr183323661cf.11.1784646001609; \n\tTue, 21 Jul 2026 08:00:01 -0700 (PDT)" ], "From": "Hans de Goede <johannes.goede@oss.qualcomm.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Loic Poulain <loic.poulain@oss.qualcomm.com>,\n\tHans de Goede <johannes.goede@oss.qualcomm.com>", "Subject": "[PATCH v2 1/7] libcamera: V4L2Subdevice: Add whence argument to\n\t[get|set]Selection()", "Date": "Tue, 21 Jul 2026 16:59:51 +0200", "Message-ID": "<20260721145958.68489-2-johannes.goede@oss.qualcomm.com>", "X-Mailer": "git-send-email 2.55.0", "In-Reply-To": "<20260721145958.68489-1-johannes.goede@oss.qualcomm.com>", "References": "<20260721145958.68489-1-johannes.goede@oss.qualcomm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Proofpoint-ORIG-GUID": "JEY2GDOIFrFtpwc0rh_lJItj3JT_adKL", "X-Proofpoint-Spam-Info": "AW1haW4tMjYwNzIxMDE1OCBTYWx0ZWRfX4C55jp9GtyEK\n\ts/aJ6+bC3TiXLBin2FN85vkQu/wjhUnRV5XHI6hdv7oOarFqo/Q4jS4Oanxyhx2G3m6pnSyQ7cq\n\tep+wY4Z8jT06fQJ6nbQPNGmiMFj7BG4=", "X-Proofpoint-GUID": "JEY2GDOIFrFtpwc0rh_lJItj3JT_adKL", "X-Authority-Analysis": "v=2.4 cv=Sb7HsPRu c=1 sm=1 tr=0 ts=6a5f8974 cx=c_pps\n\ta=JbAStetqSzwMeJznSMzCyw==:117 a=xqWC_Br6kY4A:10 a=RAioF0-LDSMA:10\n\ta=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22\n\ta=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=BV3TIWPM9q02PJwuZ20A:9\n\ta=uxP6HrT_eTzRwkO_Te1X:22", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNzIxMDE1OCBTYWx0ZWRfX28oV5yqvvMIK\n\tz2q+FGkwk3OAUZEdtWB/n3cCFOndNLOT4pjdIR7Tdiq6wQtWkhct0Q6WvvCEqwWU7xCRlFCoGID\n\t5iNjBQBvlqWkb1woX3geLG14SX0OCaxEG4WKq79y/IwGDXzJd0hLqtSwten30udjxhSkwJ9TPx1\n\tFGmQG5L4L92TWkd7j9AsZwCH+Vpg4wqdg9NWNsGrA8VnAbVt7RzQbcL/lUbSFDxXDyhRV4Q71/i\n\tQSDcpP0UlchlWVp0xLGqPQ0/YyFdxGX5w9yB8hXWI1iDRlCoM1k589WUual88ZY9dP3mIF0n8o7\n\tW09Em1GBrps0F9tqcN8GinU9AM5DNw8ABM1kHKr2lVqXz3SvZI8mVwP7D1lDMNl2HNuMWMTgazt\n\tt8EAgxWFpMnsg5AUC7DMki19hw3jeX69XqdcgXyNfrkeOz83UyeTo6f2X4XyM+DqPiPxCkKFyi4\n\tATfAQcg/JQMY0g1ODAA==", "X-Proofpoint-Virus-Version": "vendor=baseguard\n\tengine=ICAP:2.0.293, Aquarius:18.0.1143, Hydra:6.1.134,\n\tFMLib:17.12.100.49\n\tdefinitions=2026-07-21_03,2026-07-20_03,2025-10-01_01", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tbulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 clxscore=1015\n\tlowpriorityscore=0 impostorscore=0 adultscore=0 phishscore=0\n\tpriorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc=\n\troute=outbound adjust=0 reason=mlx scancount=1\n\tengine=8.22.0-2606150000\n\tdefinitions=main-2607210158", "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 a whence argument to V4L2Subdevice::[get|set]Selection() allowing\ncallers to specify that the operation should be applied to the try state,\nrather then always applying it to the active state.\n\nSigned-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>\n---\n include/libcamera/internal/v4l2_subdevice.h | 14 ++++++++------\n src/libcamera/v4l2_subdevice.cpp | 20 ++++++++++++++------\n 2 files changed, 22 insertions(+), 12 deletions(-)", "diff": "diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h\nindex c37a82afa..36848915f 100644\n--- a/include/libcamera/internal/v4l2_subdevice.h\n+++ b/include/libcamera/internal/v4l2_subdevice.h\n@@ -123,16 +123,18 @@ public:\n \tconst MediaEntity *entity() const { return entity_; }\n \n \tint getSelection(const Stream &stream, unsigned int target,\n-\t\t\t Rectangle *rect);\n-\tint getSelection(unsigned int pad, unsigned int target, Rectangle *rect)\n+\t\t\t Rectangle *rect, Whence whence = ActiveFormat);\n+\tint getSelection(unsigned int pad, unsigned int target, Rectangle *rect,\n+\t\t\t Whence whence = ActiveFormat)\n \t{\n-\t\treturn getSelection({ pad, 0 }, target, rect);\n+\t\treturn getSelection({ pad, 0 }, target, rect, whence);\n \t}\n \tint setSelection(const Stream &stream, unsigned int target,\n-\t\t\t Rectangle *rect);\n-\tint setSelection(unsigned int pad, unsigned int target, Rectangle *rect)\n+\t\t\t Rectangle *rect, Whence whence = ActiveFormat);\n+\tint setSelection(unsigned int pad, unsigned int target, Rectangle *rect,\n+\t\t\t Whence whence = ActiveFormat)\n \t{\n-\t\treturn setSelection({ pad, 0 }, target, rect);\n+\t\treturn setSelection({ pad, 0 }, target, rect, whence);\n \t}\n \n \tFormats formats(const Stream &stream);\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex a69de154e..8f9d4dbd9 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -1171,17 +1171,19 @@ int V4L2Subdevice::open()\n * \\param[in] stream The stream the rectangle is retrieved from\n * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n * \\param[out] rect The retrieved selection rectangle\n+ * \\param[in] whence The format to get, \\ref V4L2Subdevice::ActiveFormat\n+ * \"ActiveFormat\" or \\ref V4L2Subdevice::TryFormat \"TryFormat\"\n *\n * \\todo Define a V4L2SelectionTarget enum for the selection target\n *\n * \\return 0 on success or a negative error code otherwise\n */\n int V4L2Subdevice::getSelection(const Stream &stream, unsigned int target,\n-\t\t\t\tRectangle *rect)\n+\t\t\t\tRectangle *rect, Whence whence)\n {\n \tstruct v4l2_subdev_selection sel = {};\n \n-\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n+\tsel.which = whence;\n \tsel.pad = stream.pad;\n \tsel.stream = stream.stream;\n \tsel.target = target;\n@@ -1205,11 +1207,13 @@ int V4L2Subdevice::getSelection(const Stream &stream, unsigned int target,\n \n /**\n * \\fn V4L2Subdevice::getSelection(unsigned int pad, unsigned int target,\n- * Rectangle *rect)\n+ * Rectangle *rect, Whence whence = ActiveFormat)\n * \\brief Get selection rectangle \\a rect for \\a target\n * \\param[in] pad The 0-indexed pad number the rectangle is retrieved from\n * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n * \\param[out] rect The retrieved selection rectangle\n+ * \\param[in] whence The format to get, \\ref V4L2Subdevice::ActiveFormat\n+ * \"ActiveFormat\" or \\ref V4L2Subdevice::TryFormat \"TryFormat\"\n *\n * \\return 0 on success or a negative error code otherwise\n */\n@@ -1219,17 +1223,19 @@ int V4L2Subdevice::getSelection(const Stream &stream, unsigned int target,\n * \\param[in] stream The stream the rectangle is to be applied to\n * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n * \\param[inout] rect The selection rectangle to be applied\n+ * \\param[in] whence The format to get, \\ref V4L2Subdevice::ActiveFormat\n+ * \"ActiveFormat\" or \\ref V4L2Subdevice::TryFormat \"TryFormat\"\n *\n * \\todo Define a V4L2SelectionTarget enum for the selection target\n *\n * \\return 0 on success or a negative error code otherwise\n */\n int V4L2Subdevice::setSelection(const Stream &stream, unsigned int target,\n-\t\t\t\tRectangle *rect)\n+\t\t\t\tRectangle *rect, Whence whence)\n {\n \tstruct v4l2_subdev_selection sel = {};\n \n-\tsel.which = V4L2_SUBDEV_FORMAT_ACTIVE;\n+\tsel.which = whence;\n \tsel.pad = stream.pad;\n \tsel.stream = stream.stream;\n \tsel.target = target;\n@@ -1258,11 +1264,13 @@ int V4L2Subdevice::setSelection(const Stream &stream, unsigned int target,\n \n /**\n * \\fn V4L2Subdevice::setSelection(unsigned int pad, unsigned int target,\n- * Rectangle *rect)\n+ * Rectangle *rect, Whence whence = ActiveFormat)\n * \\brief Set selection rectangle \\a rect for \\a target\n * \\param[in] pad The 0-indexed pad number the rectangle is to be applied to\n * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n * \\param[inout] rect The selection rectangle to be applied\n+ * \\param[in] whence The format to get, \\ref V4L2Subdevice::ActiveFormat\n+ * \"ActiveFormat\" or \\ref V4L2Subdevice::TryFormat \"TryFormat\"\n *\n * \\todo Define a V4L2SelectionTarget enum for the selection target\n *\n", "prefixes": [ "v2", "1/7" ] }