From patchwork Fri Dec 7 15:56:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10718443 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 AF0FB14E2 for ; Fri, 7 Dec 2018 15:57:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D3EF2DADC for ; Fri, 7 Dec 2018 15:57:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90D6C2E5F6; Fri, 7 Dec 2018 15:57:06 +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 3FC612DADC for ; Fri, 7 Dec 2018 15:57:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3547D6E7D9; Fri, 7 Dec 2018 15:57:05 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710072.outbound.protection.outlook.com [40.107.71.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id B9C2A6E7D9; Fri, 7 Dec 2018 15:57:03 +0000 (UTC) Received: from BN6PR12CA0030.namprd12.prod.outlook.com (2603:10b6:405:70::16) by BYAPR12MB2631.namprd12.prod.outlook.com (2603:10b6:a03:69::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Fri, 7 Dec 2018 15:57:01 +0000 Received: from DM3NAM03FT012.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::209) by BN6PR12CA0030.outlook.office365.com (2603:10b6:405:70::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 15:57:01 +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 DM3NAM03FT012.mail.protection.outlook.com (10.152.82.116) 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:01 +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:00 -0600 From: Chunming Zhou To: , , , Date: Fri, 7 Dec 2018 23:56:38 +0800 Message-ID: <20181207155642.16063-3-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)(136003)(39860400002)(346002)(376002)(2980300002)(428003)(189003)(199004)(47776003)(50226002)(7696005)(76176011)(51416003)(4326008)(81166006)(8676002)(81156014)(8936002)(450100002)(2906002)(186003)(77096007)(26005)(336012)(305945005)(48376002)(6666004)(1076002)(356004)(97736004)(36756003)(50466002)(11346002)(16586007)(5660300001)(2616005)(126002)(476003)(104016004)(110136005)(426003)(486006)(446003)(68736007)(105586002)(2201001)(86362001)(53936002)(106466001)(478600001)(72206003)(53416004)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB2631; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT012; 1:6afG3hrbaPmF3j18QLnH5tWj9bthVD3zhLYUqllfgCUSGKJ/C0AKIdAnrTFUK05ijpv/AsM8kNKDvowsGZMxOvZbu99d25MNTQC/LKT9KrtYSKkgf+eQzgCYcCrDEtfg X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3c8751a-9e23-41da-f8cb-08d65c5ca033 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BYAPR12MB2631; X-Microsoft-Exchange-Diagnostics: 1; BYAPR12MB2631; 3:I1zqzqdmSfQvIdXepGgERAo1q6mJYit0S4o7f0qNyUtI9V2/10Z3vEGTi6KA5GhpHvOps9ZvGZV/2gOm3OmpeLXfxwA9FIn9fACIR44JKoNwgAHP4bb9MKwSO2VbgZKNzYMHCRGIjsQmTxIcxU3RJLIQpHC4/Vq4sNmmJK/VX1nP7xSuXPzvYmSSQ3Rb0fudzNvMq0kiwW26wIgrv7Rw39ncmjR61MQsELFEmtZHisnGqppBfm1NDCEzQn5cJVrfMTSiGCGWLtK8EgfFbTUJOPC3EV6jolAFZEAks9/hucsHghEBjVdDpCrmfnuhrO2e0g8ZB1e6Z2tRb/UlAiREuuTWIwSf+sG+G1w+Z2H6HdM=; 25:o2aGLjCiNsjU4ju0MjAYKP4OSPh1glNn34Dlt8ljnbTnBNuoQuUlRiRzZR1ceceAU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EhjbKWHARnAu6/o7Zt+pqPZtSCV X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93003095)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:BYAPR12MB2631; BCL:0; PCL:0; RULEID:; SRVR:BYAPR12MB2631; X-Microsoft-Exchange-Diagnostics: 1; BYAPR12MB2631; 4:LkoANhyMIrH5hNPsVugry+DEvo/D+knl8M/Z/rD/vu/FCgBXw6NikRK+L+m06OzHk4cONAyxxgKALYuP9xTK4ck7MxLBZQNjQNNeh/taEBuYbYAwLf1H4UaBmMAP7pKdEcsD1jcIWil1FUTBiLo7JwRJoJQfoqbnQZoc80l1DWAmpGaCOayRV6fTV8jsL9hOkHI3eW08jBxYye/dbJs084JmJwtlxLKUd3/IzyAM1LOiK4TMpO0Oc/bEH0WE2yd3GTqQfm2hjNpaS0XVJo9cjQ== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR12MB2631; 23:wDd0AkHahHZt/91d996pypMfqGb5bGBO5IpHaExUs?= wPzlOCUysgBvi20supAWZvst7tidC55gpy16EXp7U7TIP1k3eO6qt7Xf3ZUiK+hhtOYr9XMnhU1T4pzMNzsIT57Lhe6TwoWjs1qYt8HlZ3+9qc0Rhddb9cxtYHlU90Y/4JBf9kO6rw957Pk/MyeZ1scrb/Q86TzyZFXmyuEmzEe+s3EbYT5n8dKKqowRH5gDJhgV2Si+r4y4b1AfyXFRHZSzRLCqODXvk8FAeE41/XPNtdmO+WuPlJTSn1NNCtqBc/QvpQNvYCzJnG1bHywwSoR8aFkTy8ybOe8Tr/WwwHwP2QErZ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jme7k1/L3CfDuZQJLBO8aO+D2lfzZWM9h2JvR6wEQ9VJ0pfp21Lc45GXtYRns7fAHgzxKVqlDPvrf+5RAVkddF5+YtSOPk4Ah668zEQfniC7FbAfa8VREiBfokoAmYhy0GjRRHpFyCnKSqRyeD69evpkz3J8UUgAJkFpf0BByQU2LegHIoZU= X-Microsoft-Exchange-Diagnostics: 1; BYAPR12MB2631; 6:ZggQFG3vQTI2vQe8pfFxh1vVuc4LVhxCG85ss7cusXwURFZOSHC0qanK5UrG5X8/sW2g/OBg1AsKyR2EkhNUViWPCidP2bU/ufgG1b1R6zrZdXP4FBzJtr2o4v+D9/4b1gMxXmpvKmZ/lfCR/VnlmgazSfpMiY2K92q/GefWqga0jZl9SmAwE7Ji2qQb/i45LtWllikOl0CiRb881SExiZWPYTrBiiRGo7WxafBtJi2XclQbi9IKytWsDkveYBcF2CwoN29Tj5aBVB5xG1b92fW5ctXsDSGY9x0uRFDGdljVD1sSqtGPkZ3p0xccWMWwyqXh8q5W8yiMTTVEvqmkY2kFRIsHqV8pSAVsK6se2A2dkhKa520HVdtsjvnTWjt5wu1xgZe/SHPmY2vmpahLmilVPJkTpd+YXmyOfKV5sWeoJlSK5QllyUMtAkA1VZlZuhqy1Vjj+59GIeZWBpFDuw==; 5:/VkWepeHqS8boSoTGlfoCDcnJjOq9bDkzdjuY96aRa4CNXHUWoZpaNxRYX7p2vBLFRA0DhXSYd90VXf3n6BQB0MEHErwSiJRHa8dxfdg342yAt2uvM+U7deGgiLrN+MLYPtaTWRX/+lh56zosMpQ5TTsa9Y1At5pDbhzTSfdINE=; 7:qmSGSow5E3rlo2B15wH3mZbjrJrsHTl5F0OwpUgbs1fsZYSMiormKEgXjM36I+vFzN2nU7rinYZChOKk83yL9u30/YMufQpNenw0AkhQfVQhiq3ACz7xeJYE6BDmC70FaT0hFeGa7hScYMacef6bhg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BYAPR12MB2631; 20:b+q5cXpnzoF4zB7WpP3fvXTpCnMjvz7O3ocEcSmUusFS1pR15POH3YFa9Vca1Kon0R4i1Ozg1S3EW6w8dzGsqd3en8sZM1KgGNDeWUMHygwVqYhpilRgMy1zxokcAICa7wXSiE6G8hRBHaGxY5AgzlkbDewB1Qpwnf2XIYcbu3W4qtZz9+lWRjltG3GoIndoV4JtrOZ1pvVxPfd6YwUB4lSWeCbn38sAfZGdPkv98+jfOC/xoBFWGFOFcuAxGycW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 15:57:01.2136 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3c8751a-9e23-41da-f8cb-08d65c5ca033 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: BYAPR12MB2631 Subject: [Intel-gfx] [PATCH libdrm 3/7] 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) }