Patch Detail
Show a patch.
GET /api/1.1/patches/17344/?format=api
{ "id": 17344, "url": "https://patchwork.libcamera.org/api/1.1/patches/17344/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17344/", "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": "<20220908184850.1874303-3-xavier.roumegue@oss.nxp.com>", "date": "2022-09-08T18:48:38", "name": "[libcamera-devel,02/14] libcamera: v4l2_device: Overload open() to duplicate File descriptor", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "619a02941fa226eab7d82c235a1c218721bb84e9", "submitter": { "id": 107, "url": "https://patchwork.libcamera.org/api/1.1/people/107/?format=api", "name": "Xavier Roumegue", "email": "xavier.roumegue@oss.nxp.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/17344/mbox/", "series": [ { "id": 3477, "url": "https://patchwork.libcamera.org/api/1.1/series/3477/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3477", "date": "2022-09-08T18:48:36", "name": "Add dw100 dewarper support to simple/rkisp1 pipeline", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3477/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17344/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17344/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 9619FC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 8 Sep 2022 18:49:23 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C122A620C4;\n\tThu, 8 Sep 2022 20:49:22 +0200 (CEST)", "from EUR04-DB3-obe.outbound.protection.outlook.com\n\t(mail-eopbgr60044.outbound.protection.outlook.com [40.107.6.44])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 14F65620AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 8 Sep 2022 20:49:19 +0200 (CEST)", "from PAXPR04MB8703.eurprd04.prod.outlook.com\n\t(2603:10a6:102:21e::22)\n\tby AS8PR04MB8852.eurprd04.prod.outlook.com (2603:10a6:20b:42f::14)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.19;\n\tThu, 8 Sep 2022 18:49:17 +0000", "from PAXPR04MB8703.eurprd04.prod.outlook.com\n\t([fe80::485:adba:7081:715a]) by\n\tPAXPR04MB8703.eurprd04.prod.outlook.com\n\t([fe80::485:adba:7081:715a%3]) with mapi id 15.20.5612.019;\n\tThu, 8 Sep 2022 18:49:17 +0000" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662662962;\n\tbh=3x7KzvX7XDJbMgRoaGYt3ecsjkSrqldEa1pjj/q9nHM=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=daUa//m7PhHhvG0G89VzWlnhKESXcVBlbICtJgPM97Ub85H3HbUpfq/gn8lqchsn4\n\tc4wyVzzYk+8xLlmVPhEJBVbYYXty+Xg+LdZKGx+o5Cor6cmvbjdgGLprahq33jfWyV\n\tfKR+bV+7MBbrKOPsv+OCcv92eZa0H4i2WXcRwfIk7w6oPDYc4WdU9qeB7G6jreVQOa\n\t9mv6ISLl5T+qtWNszUMRLt0ytCHxRPQqxXcGHlNZ5yxj4EQLp8Yizd5OCHRvFAELB0\n\tC0dlq0NbeSGDZKeK51P0SZJ274wM044m5ybf3cQu0b/FRxaSgqkmTGz/UEm0dxKyFi\n\titYJdazGGxKyA==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com;\n\ts=selector2-NXP1-onmicrosoft-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=GzuJLk+Y+tr0Y/Xb2ZGRc42XgILlqpSH7wv3nhAFr7U=;\n\tb=iCGAM2pUqTtSLt1QMRJTzPi4Ta7PQ3wotxn17+n+n51XX88OlWPfZPmSueiI/eD/FdsujUZ4xmgRgqDKeqW3O9+2FSkCpz7RB/RoJGquk+WeAES34mGZ9VeGkFfJYV/5799xWcc/upKHmLLVZ+ukr7OhIFtbXvxW4VspDonueyU=" ], "Authentication-Results": [ "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=NXP1.onmicrosoft.com\n\theader.i=@NXP1.onmicrosoft.com\n\theader.b=\"iCGAM2pU\"; dkim-atps=neutral", "dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=oss.nxp.com;" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n\tb=nND6tEUmnD2j7uScxLMvyES78GZLjdl/V4krF3xKGblBaJPukUc9hxohNlMfDAQQ7osvXTy/ZuF0QbPElodt5Dt2SJHZBJ7jPtHUAj3hVqw91nlckjrFPQADiHkKBprg24xTjwGKDq3RjFVamJwLpb9efxkCMr5TpiuzSzGqN0B7nOROf9iKqH8PT2PH1JArmiSibuDtgJusrejnlQFL6NSnAAM2UkSCp0TAkuqoANuUBGkTpDfydbrQBemAXZZ97jNQAnJo5kMbirHW9gHBSvNTa3Fl+OFp1zkB0WRM2t5VTwTCB3NuLa72kVGPTLJH2fohE2mIwoU5zcqjBQ/FTw==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n\ts=arcselector9901;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n\tbh=GzuJLk+Y+tr0Y/Xb2ZGRc42XgILlqpSH7wv3nhAFr7U=;\n\tb=e5pIz0V+SpATz/lZUk7m1+FmAZGJWGXxIDnOA3gQjDRTtA1zUMdfmL4BkBVkSh6pp+3+om8Utkmdr7Bmr/+mwSCrOJSxahwt+/jDugppbypFIQ+xIagd1jppvV4/RSTLuyGuQb/u99uzyJ3LS/915KatxjRF36KVWB4E08pReNokTT6thmGoH2bsyrGtUCYS/33oA+bEVaRQ7ZNnvzOJBOho0M2HF5nj3otTj7mgCMb7OEZfP3vLz6LAs21iG6dmHoQTPS8Buff1ksaTH9It4TFVUfmdrhOwL/HnMTNCYgxIzQYRZAfBfPpI1dWpC4olGZjV/0YjRl8fEkGq6CwfYA==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n\tsmtp.mailfrom=oss.nxp.com;\n\tdmarc=pass action=none header.from=oss.nxp.com; \n\tdkim=pass header.d=oss.nxp.com; arc=none", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 8 Sep 2022 20:48:38 +0200", "Message-Id": "<20220908184850.1874303-3-xavier.roumegue@oss.nxp.com>", "X-Mailer": "git-send-email 2.37.3", "In-Reply-To": "<20220908184850.1874303-1-xavier.roumegue@oss.nxp.com>", "References": "<20220908184850.1874303-1-xavier.roumegue@oss.nxp.com>", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-ClientProxiedBy": "PR3P250CA0001.EURP250.PROD.OUTLOOK.COM\n\t(2603:10a6:102:57::6) To PAXPR04MB8703.eurprd04.prod.outlook.com\n\t(2603:10a6:102:21e::22)", "MIME-Version": "1.0", "X-MS-Exchange-MessageSentRepresentingType": "1", "X-MS-PublicTrafficType": "Email", "X-MS-TrafficTypeDiagnostic": "PAXPR04MB8703:EE_|AS8PR04MB8852:EE_", "X-MS-Office365-Filtering-Correlation-Id": "8b968efe-8abb-4a55-2f99-08da91cad57c", "X-MS-Exchange-SharedMailbox-RoutingAgent-Processed": "True", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "aiyl9Z95u9uOHvdckUk0QUnqN4f8ghc3Zk1FjGzuOsuZN/FEVViPlBig/+ULBIWoPHMfprAeHjxzxOSU3TmOq4RV8cbHRvNDYp0/H0wlz6inlmdJHekQIxK0oNnM8ySZfqAt/9y805QXSZG71C70f9fjbIYv7DqqnFZRsFwDj85sQFJRdvvG1z/xHiyjfWdlhaRRzFM4KmWPII6i6eQEVtE/3zT9/VRaKEGVTf7UVk5NJHbFGzEG+3xIqhp7pDlBh/aa6/RxLrYn2pAjgDi0kZ2+sOQNCaLJXh3tiNviKVI3A+R3c7CGYeI47CZBeFCP3EeUQn9dI7RknoYWPwofnMOSEGMMCTN2Vv9zBOfsBN+uKH3ZrGdTg7bJ4KnNZMRfVDm+EuX1iHNNda2+dVkOq4Dy1kg/EF/p1Lu6XtZS/OfsByitzhzUj+ZG5UhbhqToDaHC32UiIdbI0jjRDqppG/A2QV6gQSXPo8VgXC/V7V7921AvOachS1uM3LhyLL48dmpxRnMtvE/f0dmF1+eZ8+x6/a0yCYLTwsZ/stcwYWbNa2TJKPILDkrUuln4Ctmya6iUCo1/ggjBzEv1yCZluhWoen1ZE4pvMe/di4mPE2RZMgjW4vMD8g6dzZMuNKOOxyJLj8eK0BMt1FIim0RsLUruo6Tk7LwIq9vbuo0ej0CP28N2ogGwZT9eFQQnU6Y841mIiuCPtlrkjUSY0p0GoQ==", "X-Forefront-Antispam-Report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n\tIPV:NLI; SFV:NSPM; H:PAXPR04MB8703.eurprd04.prod.outlook.com; PTR:;\n\tCAT:NONE; \n\tSFS:(13230016)(4636009)(39860400002)(346002)(376002)(396003)(136003)(366004)(38100700002)(66556008)(66476007)(66946007)(8936002)(44832011)(5660300002)(4326008)(8676002)(6916009)(316002)(41300700001)(186003)(1076003)(2616005)(2906002)(478600001)(6666004)(86362001)(6512007)(52116002)(6506007)(83380400001)(6486002);\n\tDIR:OUT; SFP:1101; ", "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1", "X-MS-Exchange-AntiSpam-MessageData-0": "h1SnFAzWjxd0EhqKaE6Kqk2b8h1TNzPeQOwqoKJRm1GuBu6JYO4MLm2lxWcqNzfK5fe6H2biJHpIPqABxA5oVvOCmoQKGpAuz2fo7eI/INrluM+1WArAjQ2tWoWKW/6LYOP/RX2EBLrDVgHTvnUSv/Gh+ZWcOGdnsUxY26D6NLx0UA42qZpTIDcfG+odcHaWFsZ4AL2TGMybRW04yrd7/O9gmECVi5VdMqpAgCXeMdIp+YmMAcLSxDdfOG15GV1mrBrCtvOvW3QRnerI+pLnhYimUVlbK1xVE9dmvJPgIhKt2fn5GbyQDnp4XkgVqa3RP+W7dctVojnPDCp3YwEqkSvuUG1AndovTVUDif8YmJVouBd7LJ+iwD7xy2Mg62YqFpAiH2QQsQvs+yuO66MfhZC6VW8sWYN0B+VRNqe9h4RFHQNzw4NChdAfkW8TlZSS9ubnhXwQl4ZUL47eLN2oOC8eMOuBdskzvSkSmyIOoq2oQbi+vYCLYzqMc7ZudhZQKWpLvgFZVgT6rt+El/vpCRxQBfutfMKsJhBk9cCU3m7oyB9dLFyWL+pi1BPd1UKfYLP7jAkiLTR5UzL37YNz/QkCDfi3qTZXSarIrHCXXXzhaZHaoXmpMFkSEn7aHOBNGLSSeTeGJ+zU6ChtEdTATt9tZEJT8dkAiaj7oCOSGxbRfIYBytrmAkJwuRfXvInxCQtQLY1Clj3vZwzNWaNMah42HtaAw8ZoB2HZLv3DKVToqVNTXrDwFywX/aGick3g2CR9R1YcBEItg9KXVx2gjokAI++4ODdBTiBrVU0+spyXJ9/4By/W0rp2synE9182iyCh/RV2EEECUEnVZbOL1nV+mK9CKhZOhdrn++ttWvRwg+srPuvMghGImKAdr51IEyUniVZnQ4lFrDPVfA9aVbVks5ETfn7uxB8DFBWuLxJDHsCMNBoVz45RXze15KZLEeRcRTxJXj4sUuYk1cnjPmUwVEu1MMkEVK/dL57sBMWZ9UMOyJ9ZRC9Sq/iGDhcPeLShS89iJF8bmB/coGk6nZgGnDzs7yacLnLWps9h01V711l5wQI8eFz2Q+NmrrZJC6SNfp6o+kIzzljL1bvlTm2SuTBmr70xRxU3iTmguRcIsS9rp8j+BIKYn0dtBwzoS3Z7AfIxNbN1vbV4BTrQ7xAl52WOTJWLvzypZhIFnXKCh2aJ6IjlgWhQxNPRvnJjqPyUZbdXnpOi4fT3ZgPVxZcWMJM2KiQUIlqWOv5AT4JDeF05Wn9ToR1VTZGckOEBMydtxd4sXVHB9utEKg2g4pjyKcKqgnv2NbEQlqRQVLvnSTjTA6/ZneuIUBxab6Fac2lYecoAk7XPj8SYn3RH5Yj5/V2rPIBqhTaJyOhsTO2qO9Xd6nhdSkPEY66Df9xA18RBPaggj3jOwJ4NFMo1bWTtqtfIq0sCpGSrjjTC8RplrutamWKfBk+2W7i25LxdKQ6yXsNv0rl91GGr+nEuZLyq3GxT4qR12DLElo3DzhvdjZqqS19KtqnRwwcIseRZGxlpZ/mX6mvLBJdaGRM3YaLL2kgYRf3eQkOmEhUvjGlZ0wZ6aGCMbfoFCD/n4OCHQ2f1GuevuQ6WsAyp14qfAk8w273iFJ0GIsGd5dCDn/BnQZAcYmmE9iTOspYfnKImrHoULzBabGgdtVcd1XJ34g==", "X-OriginatorOrg": "oss.nxp.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "8b968efe-8abb-4a55-2f99-08da91cad57c", "X-MS-Exchange-CrossTenant-AuthSource": "PAXPR04MB8703.eurprd04.prod.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "08 Sep 2022 18:49:17.8390\n\t(UTC)", "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted", "X-MS-Exchange-CrossTenant-Id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635", "X-MS-Exchange-CrossTenant-MailboxType": "HOSTED", "X-MS-Exchange-CrossTenant-UserPrincipalName": "o7sXf0/ovFHVtl1GLDZh7MmvQarPkWW10UejTBKQdBFO+kpRhALHuf6XLSRRiLeyCT++h0LJJzWyOj2JhRCUEg==", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AS8PR04MB8852", "Subject": "[libcamera-devel] [PATCH 02/14] libcamera: v4l2_device: Overload\n\topen() to duplicate File descriptor", "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>", "From": "Xavier Roumegue via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Xavier Roumegue <xavier.roumegue@oss.nxp.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Signed-off-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>\n---\n include/libcamera/internal/v4l2_device.h | 2 ++\n src/libcamera/v4l2_device.cpp | 33 ++++++++++++++++++++++++\n 2 files changed, 35 insertions(+)", "diff": "diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h\nindex 75304be1..8b759311 100644\n--- a/include/libcamera/internal/v4l2_device.h\n+++ b/include/libcamera/internal/v4l2_device.h\n@@ -15,6 +15,7 @@\n #include <linux/videodev2.h>\n \n #include <libcamera/base/log.h>\n+#include <libcamera/base/shared_fd.h>\n #include <libcamera/base/signal.h>\n #include <libcamera/base/span.h>\n #include <libcamera/base/unique_fd.h>\n@@ -54,6 +55,7 @@ protected:\n \t~V4L2Device();\n \n \tint open(unsigned int flags);\n+\tint open(SharedFD handle);\n \tint setFd(UniqueFD fd);\n \n \tint ioctl(unsigned long request, void *argp);\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 756188ea..67847bb0 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -102,6 +102,39 @@ int V4L2Device::open(unsigned int flags)\n \treturn 0;\n }\n \n+/**\n+ * \\brief Open a V4L2 device node\n+ * \\param[in] Shared File descriptor Handle\n+ *\n+ * Duplicate a shared file descriptor handle and use it for further device\n+ * syscalls\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ */\n+int V4L2Device::open(SharedFD handle)\n+{\n+\tint ret;\n+\n+\tUniqueFD newFd = handle.dup();\n+\tif (!newFd.isValid()) {\n+\t\tret = -errno;\n+\t\tLOG(V4L2, Error) << \"Failed to duplicate file handle: \"\n+\t\t\t\t << strerror(-ret);\n+\t\treturn ret;\n+\t}\n+\n+\tret = setFd(std::move(newFd));\n+\tif (ret < 0) {\n+\t\tLOG(V4L2, Error) << \"Failed to set file handle: \"\n+\t\t\t\t << strerror(-ret);\n+\t\treturn ret;\n+\t}\n+\n+\tlistControls();\n+\n+\treturn 0;\n+}\n+\n /**\n * \\brief Set the file descriptor of a V4L2 device\n * \\param[in] fd The file descriptor handle\n", "prefixes": [ "libcamera-devel", "02/14" ] }