From patchwork Tue Dec 11 10:36:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10723477 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 3F3771869 for ; Tue, 11 Dec 2018 10:36:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AFF92A0AA for ; Tue, 11 Dec 2018 10:36:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B5282A0DC; Tue, 11 Dec 2018 10:36:59 +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=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 9F8A72A0AA for ; Tue, 11 Dec 2018 10:36:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DD0EB6E09F; Tue, 11 Dec 2018 10:36:57 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780077.outbound.protection.outlook.com [40.107.78.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 81A286E0CA; Tue, 11 Dec 2018 10:36:56 +0000 (UTC) Received: from MWHPR12CA0034.namprd12.prod.outlook.com (2603:10b6:301:2::20) by BN4PR12MB0833.namprd12.prod.outlook.com (2a01:111:e400:59bd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.21; Tue, 11 Dec 2018 10:36:54 +0000 Received: from BY2NAM03FT048.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::201) by MWHPR12CA0034.outlook.office365.com (2603:10b6:301:2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.18 via Frontend Transport; Tue, 11 Dec 2018 10:36:53 +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:36:53 +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:51 -0600 From: Chunming Zhou To: , , , Date: Tue, 11 Dec 2018 18:36:23 +0800 Message-ID: <20181211103627.25985-4-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)(136003)(346002)(376002)(39860400002)(2980300002)(428003)(189003)(199004)(305945005)(72206003)(4326008)(97736004)(14444005)(50466002)(2906002)(478600001)(316002)(1076002)(2616005)(426003)(5660300001)(6666004)(126002)(54906003)(110136005)(476003)(66574011)(11346002)(356004)(450100002)(5820100001)(86362001)(2201001)(575784001)(186003)(68736007)(50226002)(53416004)(26005)(53936002)(77096007)(446003)(336012)(486006)(7696005)(81166006)(23676004)(81156014)(47776003)(76176011)(106466001)(105586002)(8936002)(8676002)(2870700001)(36756003)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0833; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT048; 1:fQKswhwy3FkQ28GDKAEQu+QAdDVr4RXOv24gySGbACxsQjk/2FQuv0v2g4BlZXn+EA0wfLcDm1+3yAbFPuJCk582151L/j21pklClBgP5P2N+/IQB3R3z2ws/3upBouU X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02ca9bd7-ee11-45d4-ee7d-08d65f54911b X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BN4PR12MB0833; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0833; 3:738w7ARD/MfyOlQtqKXMBfUqfsCh7+xc8E3p8/OTyRX1zQWzGORFcfqnuNScF0KkMsdc910/tHOL0ubBMWlEIsuJshV465pXIXb2jltxY7oYrCEhGdM0GB9JtX5ElYvqA1lD0plhRwCBufaUP4ABCMyjAm68iQ+1z135te3qfCNtGT2lSDE+oxlYMB192h5sJ5Qe+IL7w7A0Wggq1/kU9wHAdWytSV7qRjXeKPMQmeQKBRNsplKOvXY14Zuq5t4UsehnS6AtYmgTrYjB1/yJN2heQjjApUJNWfZTxpbR60L2g0IxfZ1M72baJteQ4uWZ+3vcnzXdp0eY+pPDgzctmyJIyenL6FOUZ3GwwpgtNQc=; 25:I+QeEoxHo339s9PTaUyKxA+8Hxj74UXyNItBxnGmRxc2t/usN+KSlbEcSRHhnX3TzvyRneYfHIdHu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/ndLA5L9ZE1gV8lGIoIxDgoo+2ruGdY5kXwh5 X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231455)(999002)(944501520)(52105112)(3002001)(10201501046)(93006095)(93003095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:BN4PR12MB0833; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0833; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0833; 4:8Rn+74qS2EEQlNdpMNASVS8H0zJaXbl0Kzm9mrXlo2ZXJtIfVTsQE/EoqaRPT2UB8KPWIKOrFQVDuVdxxPBW/UyjGh8XOA/iW0UK6TLxH26hZM3e9oc45KoK2Bm2OjEIk+oJq4eig8GvQ27nB+mR+zCI2p7XwRkLT4HhxWi+6xdJ49ZX7DWdFKdO5KAUlkwrlEZPgBA/NWcobWmP1+K8jxlH4IhDaQLLLCkdhwlsJl8oSpFat6mRRDyz5EwRnFxM9cZJsYEEnbK57Rmw6Ws/tw== X-Forefront-PRVS: 08831F51DC X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBN4PR12MB0833=3B23=3AxHXjCV5?= =?utf-8?q?1rnbIjTlig5jAVqtnu9na+suSszDWtajIdxfFpT+F6aJlgv7F5wxznRduSUUVQtT1?= =?utf-8?q?CijvkJnNnHPIk/O2t4jLMooM6Lz4NuyQLOkSv73voS40W7UbFtKCHCADq/KSN4hZp?= =?utf-8?q?Tv/NHCxEz5EMe72SNsGyNq5c7+WUBZs/s30QfGm+rKUp3/kz7hxRHWZbM8ihixUYc?= =?utf-8?q?L0SWExJkbkfd5Z1p2PDpguw/zXSVee+WlOfZNDXOAy9iUGg2RPOQ5ptd28GoH3OPa?= =?utf-8?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JzEowLpg6Q7OiGjZhBS1OUVWHplnJH7y4LKRYczT0ucHMCIyCV/lc20bJhtt6J8YE+UfU+xcU2A/i7Fbkp/uTslX2UhY8kuXh8ioRjnVrqyEgSvvY+9fJidYPp5CccM=; 7:V2Q2a9rnR2zlWOlixDUL05jIyiRFEvcW9SZZuUvRUKHjFBsJYqQQJ/40Vc5bOrns/C75AM4KIgx0y66q/EjZ7zjvYh3P21cwIIlpuOTe3Hj1x7C0W4llmOmnNvpJg44iCQpCPoszWHjC4pYpmH4GIg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0833; 20:4QJlw6uO6z92fS5o0cd71UGplNMSFY6vEG4prpLRiatVqsUayD5oTxD5Lc0925HQShKEknvIqO3BGjZd2yRhF9i9zhFVKwlmz6ivUdVb18wj1IEaSg8orgbqvf8kg97fBMVzuvizrBdmPJ34NY8vY4iIYrQiHKz+zVjU+dZpJKOZqsJqsSnmBjCccqK1eJJgmTvl4+Su+4k5ZrOXQ/zWaWO6k/rXd1TVgyHoTxGuEPCekbJ1gmxH1FiAxyZU2ayx X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2018 10:36:53.3890 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02ca9bd7-ee11-45d4-ee7d-08d65f54911b 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: BN4PR12MB0833 Subject: [Intel-gfx] [PATCH libdrm 4/8] wrap syncobj timeline query/wait APIs for amdgpu v3 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 , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP v2: symbos are stored in lexical order. v3: drop export/import and extra query indirection Signed-off-by: Chunming Zhou Signed-off-by: Christian König --- amdgpu/amdgpu-symbol-check | 2 ++ amdgpu/amdgpu.h | 39 ++++++++++++++++++++++++++++++++++++++ amdgpu/amdgpu_cs.c | 23 ++++++++++++++++++++++ 3 files changed, 64 insertions(+) diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check index 6f5e0f95..4553736f 100755 --- a/amdgpu/amdgpu-symbol-check +++ b/amdgpu/amdgpu-symbol-check @@ -49,8 +49,10 @@ amdgpu_cs_submit amdgpu_cs_submit_raw amdgpu_cs_syncobj_export_sync_file amdgpu_cs_syncobj_import_sync_file +amdgpu_cs_syncobj_query amdgpu_cs_syncobj_reset amdgpu_cs_syncobj_signal +amdgpu_cs_syncobj_timeline_wait amdgpu_cs_syncobj_wait amdgpu_cs_wait_fences amdgpu_cs_wait_semaphore diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index dc51659a..330658a0 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -1489,6 +1489,45 @@ int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev, int64_t timeout_nsec, unsigned flags, uint32_t *first_signaled); +/** + * Wait for one or all sync objects on their points to signal. + * + * \param dev - \c [in] self-explanatory + * \param handles - \c [in] array of sync object handles + * \param points - \c [in] array of sync points to wait + * \param num_handles - \c [in] self-explanatory + * \param timeout_nsec - \c [in] self-explanatory + * \param flags - \c [in] a bitmask of DRM_SYNCOBJ_WAIT_FLAGS_* + * \param first_signaled - \c [in] self-explanatory + * + * \return 0 on success\n + * -ETIME - Timeout + * <0 - Negative POSIX Error code + * + */ +int amdgpu_cs_syncobj_timeline_wait(amdgpu_device_handle dev, + uint32_t *handles, uint64_t *points, + unsigned num_handles, + int64_t timeout_nsec, unsigned flags, + uint32_t *first_signaled); +/** + * Query sync objects payloads. + * + * \param dev - \c [in] self-explanatory + * \param handles - \c [in] array of sync object handles + * \param points - \c [out] array of sync points returned, which presents + * syncobj payload. + * \param num_handles - \c [in] self-explanatory + * + * \return 0 on success\n + * -ETIME - Timeout + * <0 - Negative POSIX Error code + * + */ +int amdgpu_cs_syncobj_query(amdgpu_device_handle dev, + uint32_t *handles, uint64_t *points, + unsigned num_handles); + /** * Export kernel sync object to shareable fd. * diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 3b8231aa..e4a547c6 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -661,6 +661,29 @@ drm_public int amdgpu_cs_syncobj_wait(amdgpu_device_handle dev, flags, first_signaled); } +drm_public int amdgpu_cs_syncobj_timeline_wait(amdgpu_device_handle dev, + uint32_t *handles, uint64_t *points, + unsigned num_handles, + int64_t timeout_nsec, unsigned flags, + uint32_t *first_signaled) +{ + if (NULL == dev) + return -EINVAL; + + return drmSyncobjTimelineWait(dev->fd, handles, points, num_handles, + timeout_nsec, flags, first_signaled); +} + +drm_public int amdgpu_cs_syncobj_query(amdgpu_device_handle dev, + uint32_t *handles, uint64_t *points, + unsigned num_handles) +{ + if (NULL == dev) + return -EINVAL; + + return drmSyncobjQuery(dev->fd, handles, points, num_handles); +} + drm_public int amdgpu_cs_export_syncobj(amdgpu_device_handle dev, uint32_t handle, int *shared_fd)