From patchwork Fri Dec 7 15:56:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10718447 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 D58F715A6 for ; Fri, 7 Dec 2018 15:57:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C39C22DADC for ; Fri, 7 Dec 2018 15:57:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B65B42E5F6; Fri, 7 Dec 2018 15:57:12 +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 524952DADC for ; Fri, 7 Dec 2018 15:57:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA6306E7DB; Fri, 7 Dec 2018 15:57:11 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-eopbgr810042.outbound.protection.outlook.com [40.107.81.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id DBB066E7DB; Fri, 7 Dec 2018 15:57:10 +0000 (UTC) Received: from DM5PR12CA0061.namprd12.prod.outlook.com (2603:10b6:3:103::23) by DM6PR12MB2634.namprd12.prod.outlook.com (2603:10b6:5:4a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.22; Fri, 7 Dec 2018 15:57:09 +0000 Received: from DM3NAM03FT065.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by DM5PR12CA0061.outlook.office365.com (2603:10b6:3:103::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.17 via Frontend Transport; Fri, 7 Dec 2018 15:57:09 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT065.mail.protection.outlook.com (10.152.82.254) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.17 via Frontend Transport; Fri, 7 Dec 2018 15:57:09 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Fri, 7 Dec 2018 09:57:08 -0600 From: Chunming Zhou To: , , , Date: Fri, 7 Dec 2018 23:56:39 +0800 Message-ID: <20181207155642.16063-4-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181207155642.16063-1-david1.zhou@amd.com> References: <20181207155642.16063-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)(346002)(376002)(39860400002)(136003)(2980300002)(428003)(189003)(199004)(54906003)(478600001)(1076002)(110136005)(72206003)(53936002)(106466001)(316002)(47776003)(305945005)(66574011)(68736007)(53416004)(5660300001)(5820100001)(76176011)(26005)(11346002)(86362001)(575784001)(105586002)(186003)(446003)(77096007)(426003)(126002)(336012)(476003)(2616005)(2201001)(50226002)(8936002)(14444005)(8676002)(6666004)(81156014)(81166006)(104016004)(356004)(486006)(36756003)(2906002)(450100002)(97736004)(7696005)(4326008)(23676004)(2870700001)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2634; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT065; 1:2JgQA8C3CJ74VaH9/akAgjC9mM0TorTV5PhUXpiM00yyydM8R5V9ouhewcu4B/a082aZPcP2VygejoJUuOBXm0G6Bw2jGploGEHC3ljgg68CaRCgLkXr9RgB4/JQacwt X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c988e542-c1cc-4d0b-7eb4-08d65c5ca525 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:DM6PR12MB2634; X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2634; 3:hGlLUY45FTM6bscyTCzEv11tm5egR+pEhqPvKNwc2EoHE1v8eW1yUgARHbqR/9CoJ/pUUiQOpsBWAzHBrmhFn6al/FZCKwAMR1ytUIvlORYcFTsEsnndUUrgOnNGNJO3sIu40gzoQmjBwsWyRW20hLCsbbUk4NbEdp19ai6I9HhTaiIXEyGHZpf9daHo5nWt3cQP61Dg4YRBxzwCv6q/i+KyiVR5JyTiuZ/1vv5gw5/uCcPW7+PjOM+fIwQOLzB4xrQ3YGcYox7gowPonBFWqd5Axx0XFSbq2qwFcZvepnsBoWTEwgVOI4ZUHD0vHR5W5jZ1p+JTVS1uOUOq/EBjoqb2rwzU1Cug46ZDdyv3ZWk=; 25:TXyK42xjO2+xTT3dr/O9pcbExBik3gfPCK3AstRx/fh10E2kFSvjjQG9MTRHUtzt+ricfYBGGEQr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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)(10201501046)(3231455)(999002)(944501520)(52105112)(93006095)(93003095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DM6PR12MB2634; BCL:0; PCL:0; RULEID:; SRVR:DM6PR12MB2634; X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2634; 4:zc06ZlKvGCGyUk0i7KVpKSjabKjGhnYKQrMwsuZM1854I/d0EglLUN5uIMOxawEfb/I70R2D1ywg4grCZNDO0kRNPZ0iuftSp/Brk3/ONNKc3OVFTT4mgi3Ejpo9pyzV2hull9tOxf3zqZwmZbHI1e+20RHsOlEwxRU6h/IpnrbCohONoJDNQNDjpcRRQ4JIdYj37ylxd89t5B4jQYRU3lMCF0MKl7U1q65AgacJeSTVhVWoSgVnLj3WTw2qEfcwar0JV7v7psEcsv8wkugVpw== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BDM6PR12MB2634=3B23=3AkLzyXeE?= =?utf-8?q?zQ2DDjARUhM0q5/EXbYAK/beJkCmXvYORl+xrsCWBVXZtilSw6kqBbTMyzfAJeNaU?= =?utf-8?q?mIlMHG/hctgNVIry6Xadjf9pec07Dhixh/JrtONq79XYITrkJKJTO9O33YFU8l7PG?= =?utf-8?q?J92D7NiwMisIAuX17oHfahzI9BVCXKgrD7HbNfzK7VqWp2EP78PRxULT0j0dCfRRm?= =?utf-8?q?UrqWPu6YRV0zJ33MOA9XYY2M2aPwU4By99aHgrJ0tC+jWFqb+KUAPEN6vE+1+T7vE?= =?utf-8?q?7khiQcS40cYRsGj89n7Jo/XXF/3Bw76DIqYe+A0OBq7H1GrUx7iiHkl8YS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4SHE7Sr4w62zOG3ggTOEICLDSyi1Sf8P5jA8fD5v1BquzzpvWX28VmxaLIs/SnPdTDKhganx2ZySpZjz99QMlUfJkkEuk4=; 7:+r3I+5vCupewWK2Fs4T3Iu2QCu/13RuEEPggcC+nHNm8B0qUq06rl04CkrvDp1l1GqSfnET5zsQSSwIbsVBYMUNGtLbONG1Kj1/8AvEYJHLUne4wSqMkLUpD1783Fe3BCaagIn2fFpB9dM4VbUTfUA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2634; 20:VhI/izmGWXUtBwf5zVQPdY2fBO/1CmwdyT9nMqoZGF64d40BmIEIqt2G9zXw8vGzwbchcc2F/VuO/7PGUeVUGVAo5n6bUW0Zdf/eH83x+ZBxiz0lxuX+vrCkWOjenDpzr+aJiPEan01jRGiLxeC6N/po5gPQWH4TnPK0N7sNcQQYYtdnON/Opbk6UhIs/rR0c5WSaJ9M0QWia/9IrwI/0dFB1QrNLt3x1ZBapagwlsWgg6175l62o3fCk/Izmtrv X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 15:57:09.4604 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c988e542-c1cc-4d0b-7eb4-08d65c5ca525 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2634 Subject: [Intel-gfx] [PATCH libdrm 4/7] 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)