From patchwork Tue Dec 11 10:36:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10723489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAB401869 for ; Tue, 11 Dec 2018 10:37:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C9D4E299A3 for ; Tue, 11 Dec 2018 10:37:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE4D92A0DC; Tue, 11 Dec 2018 10:37:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 606EE299A3 for ; Tue, 11 Dec 2018 10:37:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4B3036E0C3; Tue, 11 Dec 2018 10:37:09 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-eopbgr740047.outbound.protection.outlook.com [40.107.74.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71B5B6E0A2; Tue, 11 Dec 2018 10:37:04 +0000 (UTC) Received: from MWHPR12CA0044.namprd12.prod.outlook.com (2603:10b6:301:2::30) by BN4PR12MB0834.namprd12.prod.outlook.com (2a01:111:e400:59bd::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Tue, 11 Dec 2018 10:37:02 +0000 Received: from BY2NAM03FT048.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::203) by MWHPR12CA0044.outlook.office365.com (2603:10b6:301:2::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.19 via Frontend Transport; Tue, 11 Dec 2018 10:37:01 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by BY2NAM03FT048.mail.protection.outlook.com (10.152.85.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1425.16 via Frontend Transport; Tue, 11 Dec 2018 10:37:01 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Tue, 11 Dec 2018 04:36:57 -0600 From: Chunming Zhou To: , , , Date: Tue, 11 Dec 2018 18:36:25 +0800 Message-ID: <20181211103627.25985-6-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181211103627.25985-1-david1.zhou@amd.com> References: <20181211103627.25985-1-david1.zhou@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(39860400002)(136003)(2980300002)(428003)(189003)(199004)(97736004)(5660300001)(126002)(446003)(305945005)(81166006)(11346002)(426003)(4326008)(51416003)(2616005)(104016004)(476003)(76176011)(8936002)(486006)(336012)(8676002)(81156014)(450100002)(105586002)(2906002)(72206003)(106466001)(47776003)(7696005)(1076002)(478600001)(77096007)(110136005)(53416004)(2201001)(36756003)(16586007)(48376002)(53936002)(86362001)(26005)(50226002)(356004)(50466002)(68736007)(316002)(6666004)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0834; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT048; 1:IUrN8by4I3f4e/Xk6gBmllzkw7nmfTD7BiR8wB7Wlmc9ZUYJ+Jsa43mvQqtG6PzgpAgnVZaK8aGmO2PdAW5776V8u10qZRSmeqto4b4Mj9q/gnbAv0+aDPH+q448fOri X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec6be3e9-1a84-4899-8ec7-08d65f5495c6 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BN4PR12MB0834; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0834; 3:et0qxbsvuyb8sjcbZDaGauPmgqEURleY4O43FP2r9Sv2mutiCt/yV349rWbj7XUQvxPZ5U6qD8Evnq/vP6izoHUkM6W+oZo45WOmIpl//5r40OSaCgqB75NGLBt3lGuZgMD/92Hz+vcAgCt0Wqx9k8Bvgw3Vtiz1wzOIqEL2Sv6k/Y40MkNr1Iy9aL/euIP7fJ/2E08XZBVr/nSApx/F3A/S62gIdiMsA/3KZH4qaw8C5FvFLNBr9EvJPZ1aCS45I3JAmcOCqOCOaeIXsfW0L8yYDpDMmZFgsG9HTIHRHvJ92YML+6fEIcqoS5EbAw9CUCv879Gvy/1KrHo861CtudZD30C3yaQEfuNsgbluJlI=; 25:h/Ri+XCgSejFuvwyprFP41ukpubTQbZxMCDMU5G6HcJU8rnIKnRHtJ8CMBDeh5gBhr0+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P59ytpozB+i+BZVA/P+v7esvrlduBN3UxloVMa6wJZW+s/Ik8ZBqA X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(3230017)(999002)(6040522)(2401047)(5005006)(8121501046)(3231472)(944501520)(52105112)(93006095)(93003095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BN4PR12MB0834; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0834; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0834; 4:HJJsXSGNQvlo1pdSOUy8kiRT5Cv1B4WJgot5KP3ejV1yBuXyClLAA8ocKWU51KeL7YBH6K59F0HNZs3rUCV3RuU2Xy7pKAuSQ+Vtkh0X5dijFBxQoWOxMnQoDFXeTYZfk1SMNrqy0Yt8a6Wz/oZT4Grwr+dUmRcAtEAZFULvT4OBV3QD6nR2q9wdN+Vw6FTkSSbCsUqdZ9UHzbZxJ6P20fhS7TU60JWMj2TVdRmrBzgZZ3fj0oH9KZSoRW+pd3xVJNvVeBEwq09kYIdGjqcmaA== X-Forefront-PRVS: 08831F51DC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR12MB0834; 23:C8NHce9DY0VolJ6RFu1JD7UeUJERio4UInIJJY3eY?= WQdbl4/4zOqhi00YbRxnlWGXCMAZzt/0IDeNDbG83yGqvxVCksySxarbyylcG0HE1WG02RFIUxsu22MIq62ISPRkDucWW0z9t7mFbOzT0ZCxHsCMZB7+lRSSVmUJ+ZTc+pNOemjef4hjd5ZQP/H2TZETFFvICAFQGW4buFoNu6pK8AtGCdjRKmMZ2ozwnsJyaqpEieelcSRfpy11nNIuCwqLna8jwA8/lPWAb5N18xIOlNJvcTC+o50gghnHJ+1s03oSZaQGgUK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-Exchange-Diagnostics: 1; BN4PR12MB0834; 20:Xyk8elomkk390Ewz2+ZCPS7O/AQVSSst6ZgdTrnWkjM7c58yWTlix/lJkQlLIHlL727HZJ2SEH5MioDhkdHUnr+5k1TV5jdKHOQ8PLDJifzSFkP+ghehyEuiLicyUz3srj/3AAlfRioCiZaH7R+9jAyib/7gcrh1MFc/JqJIvsyLtLFBnXuDChoFiUpw4Fhfs8PjqEGsmBusb/MjMkw3cdn3PAzlIr2K/9WCeVy+6dgMSsdpx6yqBc+6yH1m6n1D X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2018 10:37:01.2494 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec6be3e9-1a84-4899-8ec7-08d65f5495c6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR12MB0834 Subject: [Intel-gfx] [PATCH libdrm 6/8] expose timeline signal/export/import interfaces v2 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chunming Zhou Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP v2: adapt to new one transfer ioctl Signed-off-by: Chunming Zhou --- amdgpu/amdgpu-symbol-check | 3 ++ amdgpu/amdgpu.h | 51 ++++++++++++++++++++++++++++ amdgpu/amdgpu_cs.c | 68 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+) diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check index 4553736f..255d25e5 100755 --- a/amdgpu/amdgpu-symbol-check +++ b/amdgpu/amdgpu-symbol-check @@ -48,10 +48,13 @@ amdgpu_cs_signal_semaphore amdgpu_cs_submit amdgpu_cs_submit_raw amdgpu_cs_syncobj_export_sync_file +amdgpu_cs_syncobj_export_sync_file2 amdgpu_cs_syncobj_import_sync_file +amdgpu_cs_syncobj_import_sync_file2 amdgpu_cs_syncobj_query amdgpu_cs_syncobj_reset amdgpu_cs_syncobj_signal +amdgpu_cs_syncobj_timeline_signal amdgpu_cs_syncobj_timeline_wait amdgpu_cs_syncobj_wait amdgpu_cs_wait_fences diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index 330658a0..5536d2d5 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -1469,6 +1469,23 @@ int amdgpu_cs_syncobj_reset(amdgpu_device_handle dev, int amdgpu_cs_syncobj_signal(amdgpu_device_handle dev, const uint32_t *syncobjs, uint32_t syncobj_count); +/** + * Signal kernel timeline sync objects. + * + * \param dev - \c [in] device handle + * \param syncobjs - \c [in] array of sync object handles + * \param points - \c [in] array of timeline points + * \param syncobj_count - \c [in] number of handles in syncobjs + * + * \return 0 on success\n + * <0 - Negative POSIX Error code + * +*/ +int amdgpu_cs_syncobj_timeline_signal(amdgpu_device_handle dev, + const uint32_t *syncobjs, + uint64_t *points, + uint32_t syncobj_count); + /** * Wait for one or all sync objects to signal. * @@ -1586,7 +1603,41 @@ int amdgpu_cs_syncobj_export_sync_file(amdgpu_device_handle dev, int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev, uint32_t syncobj, int sync_file_fd); +/** + * Export kernel timeline sync object to a sync_file. + * + * \param dev - \c [in] device handle + * \param syncobj - \c [in] sync object handle + * \param point - \c [in] timeline point + * \param flags - \c [in] flags + * \param sync_file_fd - \c [out] sync_file file descriptor. + * + * \return 0 on success\n + * <0 - Negative POSIX Error code + * + */ +int amdgpu_cs_syncobj_export_sync_file2(amdgpu_device_handle dev, + uint32_t syncobj, + uint64_t point, + uint32_t flags, + int *sync_file_fd); +/** + * Import kernel timeline sync object from a sync_file. + * + * \param dev - \c [in] device handle + * \param syncobj - \c [in] sync object handle + * \param point - \c [in] timeline point + * \param sync_file_fd - \c [in] sync_file file descriptor. + * + * \return 0 on success\n + * <0 - Negative POSIX Error code + * + */ +int amdgpu_cs_syncobj_import_sync_file2(amdgpu_device_handle dev, + uint32_t syncobj, + uint64_t point, + int sync_file_fd); /** * Export an amdgpu fence as a handle (syncobj or fd). * diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index e4a547c6..399aa66e 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -649,6 +649,18 @@ drm_public int amdgpu_cs_syncobj_signal(amdgpu_device_handle dev, return drmSyncobjSignal(dev->fd, syncobjs, syncobj_count); } +drm_public int amdgpu_cs_syncobj_timeline_signal(amdgpu_device_handle dev, + const uint32_t *syncobjs, + uint64_t *points, + uint32_t syncobj_count) +{ + if (NULL == dev) + return -EINVAL; + + return drmSyncobjTimelineSignal(dev->fd, syncobjs, + points, syncobj_count); +} + drm_public int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev, uint32_t *handles, unsigned num_handles, int64_t timeout_nsec, unsigned flags, @@ -724,6 +736,62 @@ drm_public int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev, return drmSyncobjImportSyncFile(dev->fd, syncobj, sync_file_fd); } +drm_public int amdgpu_cs_syncobj_export_sync_file2(amdgpu_device_handle dev, + uint32_t syncobj, + uint64_t point, + uint32_t flags, + int *sync_file_fd) +{ + uint32_t binary_handle; + int ret; + + if (NULL == dev) + return -EINVAL; + + if (!point) + return drmSyncobjExportSyncFile(dev->fd, syncobj, sync_file_fd); + + ret = drmSyncobjCreate(dev->fd, 0, &binary_handle); + if (ret) + return ret; + + ret = drmSyncobjTransfer(dev->fd, binary_handle, 0, + syncobj, point, flags); + if (ret) + goto out; + ret = drmSyncobjExportSyncFile(dev->fd, binary_handle, sync_file_fd); +out: + drmSyncobjDestroy(dev->fd, binary_handle); + return ret; +} + +drm_public int amdgpu_cs_syncobj_import_sync_file2(amdgpu_device_handle dev, + uint32_t syncobj, + uint64_t point, + int sync_file_fd) +{ + uint32_t binary_handle; + int ret; + + if (NULL == dev) + return -EINVAL; + + if (!point) + return drmSyncobjImportSyncFile(dev->fd, syncobj, sync_file_fd); + + ret = drmSyncobjCreate(dev->fd, 0, &binary_handle); + if (ret) + return ret; + ret = drmSyncobjImportSyncFile(dev->fd, binary_handle, sync_file_fd); + if (ret) + goto out; + ret = drmSyncobjTransfer(dev->fd, syncobj, point, + binary_handle, 0, 0); +out: + drmSyncobjDestroy(dev->fd, binary_handle); + return ret; +} + drm_public int amdgpu_cs_submit_raw(amdgpu_device_handle dev, amdgpu_context_handle context, amdgpu_bo_list_handle bo_list_handle,