From patchwork Tue Dec 11 10:36:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10723473 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 3FCD71751 for ; Tue, 11 Dec 2018 10:36:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DEE82A0D7 for ; Tue, 11 Dec 2018 10:36:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FE1D2A0EB; Tue, 11 Dec 2018 10:36:52 +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=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 BE8572A0D7 for ; Tue, 11 Dec 2018 10:36:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 401746E0CB; Tue, 11 Dec 2018 10:36:51 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700070.outbound.protection.outlook.com [40.107.70.70]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAC906E0CB; Tue, 11 Dec 2018 10:36:48 +0000 (UTC) Received: from BN6PR1201CA0007.namprd12.prod.outlook.com (2603:10b6:405:4c::17) by DM2PR12MB0062.namprd12.prod.outlook.com (2a01:111:e400:3c11::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Tue, 11 Dec 2018 10:36:46 +0000 Received: from BY2NAM03FT023.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::207) by BN6PR1201CA0007.outlook.office365.com (2603:10b6:405:4c::17) 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:36:45 +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 BY2NAM03FT023.mail.protection.outlook.com (10.152.84.226) 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:45 +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:43 -0600 From: Chunming Zhou To: , , , Date: Tue, 11 Dec 2018 18:36:22 +0800 Message-ID: <20181211103627.25985-3-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)(39860400002)(376002)(136003)(346002)(2980300002)(428003)(189003)(199004)(8936002)(26005)(86362001)(97736004)(7696005)(51416003)(76176011)(1076002)(50226002)(5660300001)(68736007)(81156014)(356004)(6666004)(8676002)(305945005)(81166006)(47776003)(2906002)(53416004)(446003)(486006)(16586007)(2201001)(478600001)(110136005)(104016004)(11346002)(426003)(476003)(2616005)(105586002)(126002)(450100002)(316002)(186003)(50466002)(72206003)(106466001)(36756003)(53936002)(4326008)(48376002)(77096007)(336012); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0062; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT023; 1:1vazMLROtI5YBT++qnWV6JFOvqNk4cYDb7aQyW8+/JbqcZ5PjwAHZxM7mdyB9OA1R8vqxx8QiNbTjsMJQc/2Wdt+jD2PCx9Jg4KJjXDCKSrHMARNmFgrK/DZtiRSQISD X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b76dc3e-cd96-4e06-3b0e-08d65f548c1c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:DM2PR12MB0062; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0062; 3:IlT6vLpKzsuhvMNOOHrcFXMtyB3udipp34MFSnJccZrTw5EWDiEs6DajB+uHQ5xB0zyJffNPxYnV5cNNAhOB0TfJ4WwZPp4BQwPbGN4+G74ONQangfg6gabufZ1SPtBnigUs8mZ2HB7SWnd/JyVRogFmj24Qi2Yx5N2g1bEMQ+Q6ufGhg/Mt1RQyW5oKlFj4MXXYM6oD1VsPrO2JTer7yNs7NF+P/mghsTJ3HnD+3IMWyi12sMZom1NGddeshhcUJIsxT7wD4Hp1kyUbWWTLfcvGagoXe0Oggzgh4fK8HnFpaJkA/P56z1lIgDZ3MBNGCQKFDOj0e0a3gLve/dy4u2b5CYhEVMbsMJ2vF9MKBBc=; 25:GahBoDq65YgMxtNVSTXce6l73d9I+IkYVexk500H6SEKiRSYJ/0d+Gz2x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bKMeAuyci54KPOBB/9ldkkDdFOAvGzuXmA6FleOPiovAknV 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)(8121501046)(5005006)(93006095)(93003095)(10201501046)(3002001)(3231472)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:DM2PR12MB0062; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0062; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0062; 4:AOLN04DI8wVFExjAnqq9Hd1kPTHpgycu5H7Al8FHi1pey9xUNJ4os0HRz+FdNWIyYbr5WniIdWCD0AwWMMJj7fsDUd65L32zd9zrf+2i2ZQ33LJo5S7mR+/Qo1TlsiZ+/F+ePIB0ysrosmtjO2jCMxXsua+WbJhO76wqupjrD0qrkMKpPYPb5XOtpjsXyxseFbQv0KAATCjLhqmEA0VWGov+Mz0vnn8nkMpsyEOuNTcrI9T/G6Yj/a/RHkZ8YidQdVyFDCoqlKSKgFN6ET1WzA== X-Forefront-PRVS: 08831F51DC X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR12MB0062; 23:lAbK8M2yw4hWQtSjkT88P7jZ2gces7lhQIT5Mi/C8?= dfttE8eB72BRdk+Jgw1FogkyoH4cjtyh4F+Owtr6bTfdoh5HitP2dGMTOKBu3g5gCcwa2JgSpbMnUndiDRfRNMM/fsZM0iLitCWHVI0FYVTLKiNT2c6S5x6lbmM/mKKR4AWAvTfqVo7CU3phSDkP9P/wTuH6lXF6sOX8Q1yM+im3yQthZDDr6WgMsDcSB4SU8m5ScAtoNjzv2rj3fwDn1y3nA46JJTbzcD5GGS5cfmUl2RdxUyi9Hv6zSnTgza0YqyOSVoyQHoYD2qZe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oft-Exchange-Diagnostics: 1; DM2PR12MB0062; 20:Gg39c18wrW1HvT8xBLNOqYIi5qFAiybsnv7ev93Wf+xy38vnlollGdONyIzTdEioWOgDpiyK9XrwbgwHHngPY8qAPGfJ8qPuDMQt1bMR742Cel+bRq2YGrWOgZ8ADID0lSurZonrmU8+FhGOxrNM36XWacAQ6aND91rGNnohfYZjg9509tOYe2YPmBeMQwd2p9OivQNVbr9NI/Ji+wnMghXxBSouv7SSnxaOra8aMzT73Bgo5OcUo2YSt91PhiaU X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2018 10:36:45.0180 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b76dc3e-cd96-4e06-3b0e-08d65f548c1c 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: DM2PR12MB0062 Subject: [Intel-gfx] [PATCH libdrm 3/8] add timeline wait/query ioctl 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: drop export/import Signed-off-by: Chunming Zhou --- xf86drm.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ xf86drm.h | 6 ++++++ 2 files changed, 50 insertions(+) diff --git a/xf86drm.c b/xf86drm.c index 71ad54ba..9816b3b2 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -4277,3 +4277,47 @@ drm_public int drmSyncobjSignal(int fd, const uint32_t *handles, ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_SIGNAL, &args); return ret; } + +drm_public int drmSyncobjTimelineWait(int fd, uint32_t *handles, uint64_t *points, + unsigned num_handles, + int64_t timeout_nsec, unsigned flags, + uint32_t *first_signaled) +{ + struct drm_syncobj_timeline_wait args; + int ret; + + memclear(args); + args.handles = (uintptr_t)handles; + args.points = (uint64_t)(uintptr_t)points; + args.timeout_nsec = timeout_nsec; + args.count_handles = num_handles; + args.flags = flags; + + ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT, &args); + if (ret < 0) + return -errno; + + if (first_signaled) + *first_signaled = args.first_signaled; + return ret; +} + + +drm_public int drmSyncobjQuery(int fd, uint32_t *handles, uint64_t *points, + uint32_t handle_count) +{ + struct drm_syncobj_timeline_array args; + int ret; + + memclear(args); + args.handles = (uintptr_t)handles; + args.points = (uint64_t)(uintptr_t)points; + args.count_handles = handle_count; + + ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_QUERY, &args); + if (ret) + return ret; + return 0; +} + + diff --git a/xf86drm.h b/xf86drm.h index 7773d71a..49a40633 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -875,6 +875,12 @@ extern int drmSyncobjWait(int fd, uint32_t *handles, unsigned num_handles, uint32_t *first_signaled); extern int drmSyncobjReset(int fd, const uint32_t *handles, uint32_t handle_count); extern int drmSyncobjSignal(int fd, const uint32_t *handles, uint32_t handle_count); +extern int drmSyncobjTimelineWait(int fd, uint32_t *handles, uint64_t *points, + unsigned num_handles, + int64_t timeout_nsec, unsigned flags, + uint32_t *first_signaled); +extern int drmSyncobjQuery(int fd, uint32_t *handles, uint64_t *points, + uint32_t handle_count); #if defined(__cplusplus) }