From patchwork Fri Dec 7 15:56:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10718435 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 4363815A6 for ; Fri, 7 Dec 2018 15:57:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DF5C2E4DD for ; Fri, 7 Dec 2018 15:57:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BBD92DADC; Fri, 7 Dec 2018 15:57:01 +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 BBD8B2DADC for ; Fri, 7 Dec 2018 15:57:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E43916E7D0; Fri, 7 Dec 2018 15:56:58 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-eopbgr750084.outbound.protection.outlook.com [40.107.75.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E3166E7CD; Fri, 7 Dec 2018 15:56:57 +0000 (UTC) Received: from DM5PR12CA0063.namprd12.prod.outlook.com (2603:10b6:3:103::25) by BN7PR12MB2627.namprd12.prod.outlook.com (2603:10b6:408:29::17) 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:56:55 +0000 Received: from DM3NAM03FT065.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::208) by DM5PR12CA0063.outlook.office365.com (2603:10b6:3:103::25) 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:56:55 +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:56:55 +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:56:54 -0600 From: Chunming Zhou To: , , , Date: Fri, 7 Dec 2018 23:56:36 +0800 Message-ID: <20181207155642.16063-1-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 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)(39860400002)(376002)(346002)(136003)(396003)(2980300002)(428003)(189003)(199004)(7696005)(23676004)(77096007)(86362001)(50226002)(104016004)(1076002)(8676002)(2201001)(478600001)(72206003)(126002)(68736007)(2616005)(50466002)(4326008)(26005)(336012)(476003)(450100002)(36756003)(81156014)(8936002)(81166006)(486006)(426003)(97736004)(186003)(5660300001)(5820100001)(47776003)(53416004)(106466001)(53936002)(316002)(2906002)(305945005)(105586002)(6666004)(356004)(110136005)(54906003)(2870700001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR12MB2627; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT065; 1:rPZvPz6HDFNuiZvN9cqvun02M6VrGseqj3yapl2SVHb5vWeQR5yQWAYlia9VcPqT3B0/t/qCK3NKp3ywc7dKA7ezU/g3XS/6BnAcbYw+RVrLw1DEJaTAJnqPkFq8blED X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c7be6c87-db29-4a1d-f9c4-08d65c5c9cb2 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:BN7PR12MB2627; X-Microsoft-Exchange-Diagnostics: 1; BN7PR12MB2627; 3:OAqRGg3cNkBWtQH4BNYD5khbh8tI5M7lXKFJhPi9ZOJmm3iFCY+4PA9CEQxI8etg93IFZ+w499J/4ld2ENAQvDcS1CmONYxi9OlZeu1v/Hz7uZ2gQPGetJ16sSHITotYVDpbpeKt6a0UHHFEJvd6MTS+cdKzWij39sJ4vavfUVr0y7IuaB4NZQsTodHeyB9TufDO30ORTlXLGMdpepmPlDsEuhI5ZPTAW8kJl31Fhpgg3zB1ReQ0LF/mVB9dcq0535PXV3en/li7gBvI02DUB5V1x9GChtoyexMSLJuKffW2Y08retionyLgXtu3UoahTXBICw+op0k2k8f20FozSlsQTdPoh4zc/hxXdAZeedY=; 25:c7lv6DOyDWK2qsSiHH3BQX3QaKdXerDv+muzwN52PXSwH9u4xybfimAUEpHYwe923RIhndChQ/dEuOdbxzBHo2/RHwJEuYcSeA9BhzKvP0RQz6jxBVHR9D80L3qR5NKdW19micxFySZ1NC/upDpzZnvyTRYMGm5wqQoCtIogizsG+pazv9b1GV5xyzPtrnD3en774WVOtLyCR/21U06R4Ni90uzYxS3sOS/NJsEo7CMGhmuYlVT6f7tWoXHO7H/q5BorC9B5wHENeDh4nt/P22Uhno9KU2JEw1gASmkgSfPz9DFS2mZj6HLl3i+ssOGVUEXy2jr5NJwtGX9/r9fMgQ== X-MS-TrafficTypeDiagnostic: BN7PR12MB2627: X-Microsoft-Exchange-Diagnostics: 1; BN7PR12MB2627; 31:APsShmlY7DUrnXOVvgSOLBC9Kzjbo8CrwGxVHaZVydqc47GGI0J9HrV/LgIYEnwqMKPfHetykzYUEoARno3Fac0Ubhizoq+WQjG6BfbRpxWm8qwhgbesFpJj8PylOL6nn0viW+x0eAFc2YFCGCTJOHmUpBXel0eV7Ba4DHH7wgTvEFgtbj1ZU5FKWnW+lnaxI/0csPggEZ7w1NDLH3HWuUSM4ZeuarkrItFNrhQBQVw=; 20:ktBNefAN9t7mngYV4c52Kcge2N8HDuGZWeyLxvSolaZsHnbcTZ/nzAr+Xei8IiwVPABqCnCF8v+x4lTlbfGI3Azv2KL4Z8JSf0ziVFFWBsy9tyGiNnSeUTwKT4eQKyuEClCBPKwVZn3vHXHkPX5cRcuLdbpM19Y+jFArcGLMoCf+AlDBbPdLWeWP+cUDJAIXSCy3xuLluRE75ympQv/dfAAqr+Wtn1ugpwFiQXuJ02hD9F9OIdStae//fXCMLqLSogDwTvwy06aP52RnCgFninqodNByT7fAhBlrmp5g6NDSzDi3Si6yLZwqoV09+tQqz/gxcY8x2JlnhshsQU813/O8rHkLVjetexk/aAvt6KfOY10sZ0xs9dbQsEFNMxdaFR3uEnlPfwk8RY8UWMeIzDZ/m8SEtdJ8m81ETvWB8ajLcNHYWmFjnoNUh/HVcxHIcOB1exXT5RHP7i9rheOc3VwaIMCt8IQBBKeAf6MWBxBRk6V4MLLPyPTyQSbf3sJk 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)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:BN7PR12MB2627; BCL:0; PCL:0; RULEID:; SRVR:BN7PR12MB2627; X-Microsoft-Exchange-Diagnostics: 1; BN7PR12MB2627; 4:Z7Q1/7xNpxZ+ymurcUmZVF9rwoph84mc5hjhLvwdTLTVs3ZZ0RDS08q6Da1gN6YrXwJgKj0GbKGEdzceOXs008R41jvlpnmhY6pIHdWEO0boy9sNB9POXRJbYlhldumH9KIQtO1TFnYHxf9j5bhRGNZ+j6c9TlMuQM1UztRyllmdCBxD2lAFRCCNiAbqHItt11z5Net/viPbZQU09ahQ/OT3Hpx+jIdYZYWx02Yjb0TXBt4rZbw1NURBsQgjVxQJEasQc+rlM1vkTn4jyDiilg== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBN7PR12MB2627=3B23=3A4vwWgII?= =?utf-8?q?ZVO1d8tgamzxX8IFOhOFC6d09QINNIbScrGKQJ8y8Sqok13vkkuOslXNiUDUzveXf?= =?utf-8?q?NW7mZ1vnPz/RTVPbGg3BRPqMZesOiIJZYMoozMDjI9ziQgzgsXCbOwks/lrW3n3y1?= =?utf-8?q?FVXs79CaynCaleCWav1+ofoW/gBpyB1q700WgfalP5Q+cpG0jlncyu4VLWSURIG+Y?= =?utf-8?q?/WBIrS/NGXZz8trDg6Vu1yvqPyqQwXn+1fxS8t/aPZ9etpyaBW5bhKeMudse4XPLh?= =?utf-8?q?lkDErRulzx27C1TP1CVB+RP/bIsjITULFywJemIWF8MEUKW9Hq9umxCGqjwWyDea1?= =?utf-8?q?047VVrw6Vivimc8X446xgBgs1IjZrCAlpm6aZSBaiwII2t9Y4j5eN2d33CQW5E45r?= =?utf-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agnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN7PR12MB2627; 20:ceDOP+Lm5OgJBqb/h2XCaXvFbllR3qiwXNKmxJdsl+qEOv5mVhCK+t3idtnhVmm5c+4fAUv5GVqnCKBxwXbmz+VwM+Vyhvx5semuGKG7590WcLYb/bFdvhVxVvoBVxV2QueF5MUQP+fUsqdfjkH3z2cS0xDsVsnaVW7AZL/eSQaG+Ut8aEyYDSfOO/r/fnkxWLK/GkoV36/Kg9xSQYKf5bcDY2UHSJffdQo7McTuLqVTCaYa/Jd7/DNQgqZXpdih X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 15:56:55.3350 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7be6c87-db29-4a1d-f9c4-08d65c5c9cb2 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: BN7PR12MB2627 Subject: [Intel-gfx] [PATCH libdrm 1/7] new syncobj extension 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: drop not implemented IOCTLs and flags v3: add transfer/signal ioctls Signed-off-by: Chunming Zhou Signed-off-by: Christian König --- include/drm/drm.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/drm/drm.h b/include/drm/drm.h index 85c685a2..26f51bca 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h @@ -729,8 +729,18 @@ struct drm_syncobj_handle { __u32 pad; }; +struct drm_syncobj_transfer { + __u32 src_handle; + __u32 dst_handle; + __u64 src_point; + __u64 dst_point; + __u32 flags; + __u32 pad; +}; + #define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0) #define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1) +#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) struct drm_syncobj_wait { __u64 handles; /* absolute timeout */ @@ -741,12 +751,31 @@ struct drm_syncobj_wait { __u32 pad; }; +struct drm_syncobj_timeline_wait { + __u64 handles; + /* wait on specific timeline point for every handles*/ + __u64 points; + /* absolute timeout */ + __s64 timeout_nsec; + __u32 count_handles; + __u32 flags; + __u32 first_signaled; /* only valid when not waiting all */ + __u32 pad; +}; + struct drm_syncobj_array { __u64 handles; __u32 count_handles; __u32 pad; }; +struct drm_syncobj_timeline_array { + __u64 handles; + __u64 points; + __u32 count_handles; + __u32 pad; +}; + /* Query current scanout sequence number */ struct drm_crtc_get_sequence { __u32 crtc_id; /* requested crtc_id */ @@ -903,6 +932,12 @@ extern "C" { #define DRM_IOCTL_MODE_GET_LEASE DRM_IOWR(0xC8, struct drm_mode_get_lease) #define DRM_IOCTL_MODE_REVOKE_LEASE DRM_IOWR(0xC9, struct drm_mode_revoke_lease) +#define DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT DRM_IOWR(0xCA, struct drm_syncobj_timeline_wait) +#define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct drm_syncobj_timeline_array) +#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer) +#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array) + + /** * Device specific ioctls should only be in their respective headers * The device specific ioctl range is from 0x40 to 0x9f. From patchwork Fri Dec 7 15:56:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10718439 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 AE40915A6 for ; Fri, 7 Dec 2018 15:57:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EBB92DADC for ; Fri, 7 Dec 2018 15:57:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92E712E5F6; Fri, 7 Dec 2018 15:57:03 +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 4DDD52DADC for ; Fri, 7 Dec 2018 15:57:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4803A6E7D1; Fri, 7 Dec 2018 15:57:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690041.outbound.protection.outlook.com [40.107.69.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5441E6E7D1; Fri, 7 Dec 2018 15:57:01 +0000 (UTC) Received: from MWHPR1201CA0013.namprd12.prod.outlook.com (2603:10b6:301:4a::23) by BY2PR12MB0054.namprd12.prod.outlook.com (2a01:111:e400:2c80::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.17; Fri, 7 Dec 2018 15:56:59 +0000 Received: from DM3NAM03FT051.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by MWHPR1201CA0013.outlook.office365.com (2603:10b6:301:4a::23) 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:56:59 +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 DM3NAM03FT051.mail.protection.outlook.com (10.152.83.56) 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:56:58 +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:56:57 -0600 From: Chunming Zhou To: , , , Date: Fri, 7 Dec 2018 23:56:37 +0800 Message-ID: <20181207155642.16063-2-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)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(428003)(199004)(189003)(8676002)(2906002)(48376002)(2616005)(81156014)(16586007)(47776003)(53416004)(104016004)(336012)(110136005)(81166006)(426003)(106466001)(316002)(486006)(26005)(36756003)(105586002)(476003)(97736004)(126002)(50226002)(51416003)(356004)(77096007)(50466002)(450100002)(8936002)(6666004)(186003)(86362001)(2201001)(305945005)(53936002)(68736007)(7696005)(5660300001)(11346002)(478600001)(72206003)(446003)(4326008)(76176011)(1076002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0054; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT051; 1:vji/qfOEYPEGzlJqjjA29g+fk775YgSIU0RxD/Y+snAb5qRDPgwZtS8WSMh4jBUmT76N6wOj6X5/jf6A7isr+oUdvw0LFLMuNIgIg04SLDbH44kvDlVu40aQ01QOxanF X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f686ce51-b606-429b-8914-08d65c5c9eaf X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:BY2PR12MB0054; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0054; 3:FhM0BSvJcH6zTeFanCR/qdzpY3h5ImH1tu2OLnpyRaoLO5qt6ulQ7KgJW/LZLZxYxv32mTfeaWzVUI6sOl6uXM0yzrUPrXWYraTOTHBD7gZSbnJ61jOxrWJ/3BLgl88EiJ0D+WUCPHFqSBohZG8duX28IWX+3KrkkjiSmUCLZBYjbbV1NpZX/lx/c5XW1hFtexjjavFbmGPuR6G5TDDqRcFZwJolFYc+HnZDa1WnE8sWHEiGn3ltaD87O8GL1vgy9hWMfVujG5t3tiStydbkcG7Fi6ZvpkO6Oq1AtpicGVSE5JpCphEa3vyzEiyo7/NB2mGSgEjE0s0uCuFgD0teefmkYasd29724IJH5OW4r0g=; 25:iXd9N946BapKOnY65prHCi3LFcb7HT+3SXQkRTrPpjd1k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7wV7Z1b0ftu1OQdER1cLRlmzbodSasS7kxuHx5Zeu9Mo6+8Q 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)(3002001)(93006095)(93003095)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:BY2PR12MB0054; BCL:0; PCL:0; RULEID:; SRVR:BY2PR12MB0054; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0054; 4:pvhbxvz5EXuyMFbkueCnfzqQw+iCDPxeET6R8sLOjoACh0wHQIWfRU754W/TK1Jtu74DuCQ3Kj5GYKhCDbJ72Z8HO/Djrftwhb8dyrfMbxqd29xytObxLavht7jPG+iBxH8vWS1OfrRj+Gl/z9QZ/xynWYQYII0Dc9eziLzIk4xoqXGxW6gw8Gfp5gTlsqdQYfWDxxT5Bg+xDHmmbJNfmYCeKAlUP+P4GKFdNLtK+VdNmUcETiQlMC7KYIRAYYgcYZqFqJ/ZjaXMnOcKlgwBPA== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR12MB0054; 23:HKhwG+jDriQVGxYkyxip3VW0lZoS22RF5MY11Ef7r?= ToGOuyZi4sQb4DUKNsxKX/7tIXO/FwEe9xmJZa4OHoXMyORHyN2CqUyWBUL/X8CrN5luIOdxHmEnnc3a4naqw6ppEbomQxI2Mc9AIUXwarP1JOMAdcbvNrOhOyXo9zVzvDxpE2zJZw+YpfXYy04wTDY2Jo5qLFeRh9FAMaqlF9vwQmkcwFslNIFXcd4OhCOrtRGGflHDKQVMRbVHNpXy6oC67K3g2PBnNlGsEGMeF4YZfvNwvEwjSttJc6WpqT67fDLc5L+jxhZ1Rpr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DBits8rBrAXcN4DllR3j94JlPc29OyaDi35tDmLQL+jyPbo8t1avygBijlP19UnL+rHTykVvg8qV4RMAokTXs6rv0kWZJUbGp9ezXZ9yF7HnTeV1/SqQ/xcLHPxsr5IWAzslKjC20VwHHPcxvqG7/WahPAneWKdCrNPGP4HYvpP3Q1RW+QRybd63DHi5gYcD7nNIjOxf4MNQALAo04U590= X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0054; 6:fuEEmrbm7ihnPg4e4kqyBsURBo7mjVm+t07lvEv3woPnEgihNdjTqRdAgol6xT9foOhmex82p6Re8zR4qykGq3Os4+YhX1LLtTja4PMvGRK5ynsBVJDOPX7n2DLGETAyDYKP7ZSRt7VDY3sf3yIzwy7ZjvCvXv2Bn6d3c2FvH8DITmjGfN3umW4/95uYKXPTLUgvholERIo/SdGQ3LMOY0ELnC0DiAN8NQhllxfvGO/or3oOmTFp/vpaMSN7VGO+iANRNZ39h9El2GU/BNCpK57jsZjfR1nhrQauyEdvwk3h1asswJU15LZEertcoETP6uEAHU0CVelJGY02Qoc6POsV98/XCyN3pCqe71oSlDrqXDRu7OF39Z29DZnMpR9Cs1asMp8o3nzHSfO2FpztUam6DitzcNL5kK7dfOHfwGUThCnLo6G405r+/gAmrQD6HygrWR5pArc5ju3Q+K/AMA==; 5:S9XME62xwmn9hN7uRbvSSza9dM7DMJb5zCMr+FgJ3fcdkokQsTKI2LBxkPmf2a1hAShxP0TrcM9cM6lmMLjckrvec/E8tPQzdmy7HWYru/kvlAr126lWouXmab9QN6OeTTu+G0lsgRtBxMpQJ52IOq9zM/hsVmPibEYX8GvnjXQ=; 7:AuMenf9HWZTwcB++p8xc7d4FVbzZ5Tq7KyXwBQSEH9ckyBYIxpYPnOaR9y5Q52m/HMbC2a+3pVBEmzXRBghj0RnrWLyJ8Vr1OAOWa/gRBZJlpsgnAIKl6sDZuQsa392LKfI72grGYA56E3uaXFC0qQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0054; 20:Sk9pSHfNKh1EGgLBfsv4HOMOEj/eAH0UbK/G4gB2qRZdLXFXSMXDfzfSPijQPHl9L2EV4nm/eECwBw/M2gWQ+f0gmv0RqeJI5DDW3LRh7TX2lCn7fH30wyr4bk+fkhIQ52rCFkhi9KiHZ+W9Lw9mdZe58V0P4lOQldsegnYXcGKa3Nqf3y27jiPqb8CNK2HuCvENykQ+MGALK6rglNqO21Oi3R5qFCTHIyWOJJM453PwspIHU1NtEuZoiDf4rIZI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 15:56:58.5898 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f686ce51-b606-429b-8914-08d65c5c9eaf 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: BY2PR12MB0054 Subject: [Intel-gfx] [PATCH libdrm 2/7] addr cs chunk for syncobj timeline 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 Signed-off-by: Chunming Zhou --- include/drm/amdgpu_drm.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/drm/amdgpu_drm.h b/include/drm/amdgpu_drm.h index 1ceec56d..a3c067dd 100644 --- a/include/drm/amdgpu_drm.h +++ b/include/drm/amdgpu_drm.h @@ -517,6 +517,8 @@ struct drm_amdgpu_gem_va { #define AMDGPU_CHUNK_ID_SYNCOBJ_IN 0x04 #define AMDGPU_CHUNK_ID_SYNCOBJ_OUT 0x05 #define AMDGPU_CHUNK_ID_BO_HANDLES 0x06 +#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_WAIT 0x07 +#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_SIGNAL 0x08 struct drm_amdgpu_cs_chunk { __u32 chunk_id; @@ -592,6 +594,13 @@ struct drm_amdgpu_cs_chunk_sem { __u32 handle; }; +struct drm_amdgpu_cs_chunk_syncobj { + __u32 handle; + __u32 flags; + __u64 point; +}; + + #define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ 0 #define AMDGPU_FENCE_TO_HANDLE_GET_SYNCOBJ_FD 1 #define AMDGPU_FENCE_TO_HANDLE_GET_SYNC_FILE_FD 2 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;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Tb1oWDcPCQEASrj+f9+PIB17q8ZlwI1JTyGnQWA+jsBdsr++vYj+jGo5ULyVhG0/G+UTdQgLukMYgOrGVS19T5dE/0mAb5I7+mIjHwP1yvruppuIycyrC+ZBgRadFj/wg2yAHnQTbRdVaXQgx6oztf3cLIrJkRGS3/3LWMfn2h5kNSIPUIx9Z6MRjowEUZXC84vATaaNvIFpSYjP4xkn3c6BpA+LVchcr9gKIihW9QA7WVXE5uRCetOCxaVIWMOUeFcN5VNiWznnWiUhCkCXK1pUPE3YSovHSlc87ePnd3CRi21Dj8htk108E7wSt0lWnbbeuxhdaVxw15W8uSQHKO8Y1VnSbG/G7ETJtViMwSlvzDoiMY0GNHM4r866YLZ5seuPlCxTUxNK+lBwgLJ3qYIebXFklKB7xfPcLFm1L4gSvTbG+hsZqCSF5/8l70FHeu52mCV3oYgEhjbKWHARnAu6/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/IzyAM1LOiK4TMpO0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ilVPJkTpd+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) } 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/FZCKwAMR1ytUIvlORYcFTsEsnndUUrgOnNGNJO3sIu40gzoQmjBwsWyRW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Y/DJXIkKs+YnvWiZkeQouLJZ0M5+3f6xM8fReJ03A+8jXDsogaF4ThL6HITywcYH6GASfxN19x73dnvQy5xei7DGcqA2dTM6zQFDOumo9Vzy8oxw0ApmquiwIwuxPhm4dn26l6WUvw/3Afs62q0cWYTX18vVodWveryp1lZSIaxroJl1/QkmNS7R1A/cPoqpZ1Bsxi7yzxMm7uO+L3iyTlXnRbJ8+ODtIF3eat5vcwRhPzXQugwgeu4XkFrh+uEUu0gJVEADHZQPAzq54ZnPFQ6Scz97++MnEgIWiKxgyurukm9bY9mNH 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+xrsCWBVXZtilSw6kqBbT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fqe0x6GYjaFuKHi4qKXWvLJ0GVsSAfRFFnAQ9hDTc6/EIJ3NMXr1ZDW+yldLZgpk75Q9Zl0JEiUuh+IGd9wJsdEOgfyvwnNnMhyqB+UnBtOFg6RAYaYbBYTXt38L8XJF11eXCELFPeiMZdG7vF9v35BY0lFZur2zAStdAFz0Oz3fwKTbKg6NAr2tW69xv7yvKZT6b6zL/LuP18Srw+bsw==; 5:fYlcl0RG0Tqox49XWCKayw7hKIc0/jCVQd8zhRqg7zaQ1UrSvx2eZqyvH+ShPZMJzfFUdyXVArwOI4SHE7Sr4w62zOG3ggTOEICLDSyi1Sf8P5jA8fD5v1BquzzpvWX28VmxaLIs/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) From patchwork Fri Dec 7 15:56:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10718451 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 A037614E2 for ; Fri, 7 Dec 2018 15:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8ED182DADC for ; Fri, 7 Dec 2018 15:57:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 832882E5F6; Fri, 7 Dec 2018 15:57:17 +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 2B2342DADC for ; Fri, 7 Dec 2018 15:57:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6169E6E7F4; Fri, 7 Dec 2018 15:57:16 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800045.outbound.protection.outlook.com [40.107.80.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 58BCB6E7F4; Fri, 7 Dec 2018 15:57:15 +0000 (UTC) Received: from BN6PR1201CA0023.namprd12.prod.outlook.com (2603:10b6:405:4c::33) by CY1PR12MB0060.namprd12.prod.outlook.com (2a01:111:e400:4c2c::14) 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:13 +0000 Received: from DM3NAM03FT062.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by BN6PR1201CA0023.outlook.office365.com (2603:10b6:405:4c::33) 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:12 +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 DM3NAM03FT062.mail.protection.outlook.com (10.152.83.142) 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:12 +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:11 -0600 From: Chunming Zhou To: , , , Date: Fri, 7 Dec 2018 23:56:40 +0800 Message-ID: <20181207155642.16063-5-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)(136003)(376002)(396003)(346002)(39860400002)(2980300002)(428003)(189003)(199004)(446003)(72206003)(8936002)(478600001)(450100002)(8676002)(81166006)(36756003)(81156014)(11346002)(2616005)(426003)(316002)(16586007)(106466001)(50466002)(104016004)(476003)(5660300001)(53416004)(6666004)(68736007)(110136005)(2906002)(48376002)(50226002)(2201001)(53936002)(356004)(486006)(105586002)(26005)(76176011)(126002)(7696005)(51416003)(86362001)(97736004)(4326008)(336012)(305945005)(186003)(77096007)(47776003)(1076002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0060; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT062; 1:l4hLtWPc97U1GPNgxSg1ilsS6Sc2+ZMXlGWQ+tOsYsxU/qc0BhXRXyb77ZmXFjLlU5hwgW14BidLGRXSMCCSyio+Csn9muHMzPTY4LwJ1gvxckSh/Osp5ZkIFxA8fSOD X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f1424af-fbb6-443a-149c-08d65c5ca6d6 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:CY1PR12MB0060; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0060; 3:bmyKYYbNxZsRq58yWQW0W7qVkTk+e9xrNpcsKyTf6tZ6hUrPwdt66udLxO/Ahq5TF7Cmyt3MzZx44Hf6sFiYQQJogt08t1n12FMOevvRgaj59rhHyKBpcDQpuA5fK9M519A92YA0YU2vndzZ/9o6q0CejpFAHCQ3BCvUI4BS2D6S+YCWGR5I0/Nq5RQsWUufhuNRrNlA3W30iEA7H0TtCTl8xawDaxOqJEuD0H78/au+RIbCxXkS+aq+NP388NxaH2CizvjrZEEhU51h0pXxplLGtJD42FLRwhdCHKA1+3tXdzfwUDfMOONc+88ncK5eej/+u08eTojffhl2Q3u3gJj8x/ETsfi8AAlwHdLHyHs=; 25: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EMbzanfCAyLaSm2+8PiMa3qnJnLJOXE2NQrqwpd6HmOn/OoDNb1F0R5k2vSU9x8fKBK9yGYk4y+k7VO7EAVDtxl2Ms 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)(3002001)(3231455)(999002)(944501520)(52105112)(93006095)(93003095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:CY1PR12MB0060; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0060; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0060; 4:hDBY0cJPLH/Xz/UBwOd1CqnOiar4iHOu5zBICo2QASk6jkuiVyg/ByzKOzITql9VX59Z5Y1IxEGNwHyorBU23I5zy8bfUwiaoksb7bbtmzv1pyKhvBD40jCp/Bu0upwLnmFAtJs9Wg3VAkDp48QJhJjaRLGOiFub8dwtX0KxzNV2eEwhOcF2cREvEulMh7FJg9kC+Sx3eRFBrvaBdcWKt+VdQQrTmRMFyPGKim9m0KCIipZ2QQuD3niK4C9H9mw46RAh1a1suc58LzEwmQa/rQ== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR12MB0060; 23:G+RHEt0dU519grSk3jh3cIC5o5vHRnW4EolEmH8rr?= 4nJBJKpfPguCVO1qOrOuv6RhCwX7y8RdDojtfSZNE+YHSTljE7kb/5lDWamEEDCR3NBp9jyCp7PJFVKAH1pqK+7h4nofU1pTjk1tMr22tQja47MgZmM3hH+OZl68YNztPHpuoasnTHWg3VGfX2mYSIdhXPtox9vfQP4MESRjXoxdijDXwcT+XZuDOcFyPBQnmsHC2E8dNwR11YJ0bGSeUyaRnj337FdxVxb/VFLOVYvWR5fu9qCGaw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Output: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0060; 20:jUF4wRMGjizPfio/K4XzsMEqFzZXMczv0bUFC3QnazC+J4xKKw+eQC371IsIgm3qW8O7toN3AGixj3UkK3LMGU2X54PtM1YQqubjrIcr3JYejf3KLJryRtUIcdoUDDaGSNMFS/dzoYwUHn4odC32xy57tU4wAh3m0egTDqLRJH5HcDi0iYshDuPN9CkLCVPHfMJ+40B6sKmwPRz0H2P1quDfg/nDc+PraPRVAYhhaphEZB1Ycf376YinwX4Pdw2f X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 15:57:12.2798 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f1424af-fbb6-443a-149c-08d65c5ca6d6 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: CY1PR12MB0060 Subject: [Intel-gfx] [PATCH libdrm 5/7] add timeline signal/transfer ioctls 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: use one transfer ioctl Signed-off-by: Chunming Zhou --- xf86drm.c | 33 +++++++++++++++++++++++++++++++++ xf86drm.h | 6 ++++++ 2 files changed, 39 insertions(+) diff --git a/xf86drm.c b/xf86drm.c index 9816b3b2..2a089616 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -4278,6 +4278,21 @@ drm_public int drmSyncobjSignal(int fd, const uint32_t *handles, return ret; } +drm_public int drmSyncobjTimelineSignal(int fd, const 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_TIMELINE_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, @@ -4320,4 +4335,22 @@ drm_public int drmSyncobjQuery(int fd, uint32_t *handles, uint64_t *points, return 0; } +drm_public int drmSyncobjTransfer(int fd, + uint32_t dst_handle, uint64_t dst_point, + uint32_t src_handle, uint64_t src_point, + uint32_t flags) +{ + struct drm_syncobj_transfer args; + int ret; + + memclear(args); + args.src_handle = src_handle; + args.dst_handle = dst_handle; + args.src_point = src_point; + args.dst_point = dst_point; + args.flags = flags; + + ret = drmIoctl(fd, DRM_IOCTL_SYNCOBJ_TRANSFER, &args); + return ret; +} diff --git a/xf86drm.h b/xf86drm.h index 49a40633..799d9b9e 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -875,12 +875,18 @@ 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 drmSyncobjTimelineSignal(int fd, const uint32_t *handles, + uint64_t *points, 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); +extern int drmSyncobjTransfer(int fd, + uint32_t dst_handle, uint64_t dst_point, + uint32_t src_handle, uint64_t src_point, + uint32_t flags); #if defined(__cplusplus) } From patchwork Fri Dec 7 15:56:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10718457 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 1BA5114E2 for ; Fri, 7 Dec 2018 15:57:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B40E2DADC for ; Fri, 7 Dec 2018 15:57:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F37A02E5F6; Fri, 7 Dec 2018 15:57:21 +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 863B42DADC for ; Fri, 7 Dec 2018 15:57:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C67B6E801; Fri, 7 Dec 2018 15:57:20 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730076.outbound.protection.outlook.com [40.107.73.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id 508AE6E7F7; Fri, 7 Dec 2018 15:57:17 +0000 (UTC) Received: from BN6PR1201CA0023.namprd12.prod.outlook.com (2603:10b6:405:4c::33) by DM6PR12MB2636.namprd12.prod.outlook.com (2603:10b6:5:4a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 7 Dec 2018 15:57:15 +0000 Received: from DM3NAM03FT062.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::208) by BN6PR1201CA0023.outlook.office365.com (2603:10b6:405:4c::33) 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:15 +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 DM3NAM03FT062.mail.protection.outlook.com (10.152.83.142) 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:14 +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:14 -0600 From: Chunming Zhou To: , , , Date: Fri, 7 Dec 2018 23:56:41 +0800 Message-ID: <20181207155642.16063-6-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)(376002)(396003)(346002)(136003)(39860400002)(2980300002)(428003)(189003)(199004)(8936002)(47776003)(8676002)(36756003)(81156014)(81166006)(50226002)(6666004)(356004)(97736004)(426003)(4326008)(76176011)(50466002)(7696005)(51416003)(86362001)(450100002)(336012)(2906002)(186003)(2616005)(476003)(11346002)(126002)(486006)(446003)(77096007)(305945005)(48376002)(2201001)(26005)(53936002)(105586002)(478600001)(104016004)(53416004)(16586007)(106466001)(316002)(110136005)(1076002)(72206003)(68736007)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2636; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT062; 1:VgS/e0gPDOJ4k3ZJ+q4jCsJXR8jsFJkqw0LTUm9lL+1PR39j1ljCXHZS0Hgnvcn5cSPoxt38l1OElmlAU4viLJuWqiFTm+0gt5xuo/qdwdhneK0ZlvM+r5slwyNOpK+L X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a6280d06-ae51-4b48-f133-08d65c5ca855 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:DM6PR12MB2636; X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2636; 3:4ylNsrEiFbIP0Naa/YFURxJelGXrr7IX2HQqAvTDzB65Q2tfwJH39qUSea7qXrId/HMaW85KpEfC5feRDsN6DhihH3JgNmMOAN0u57vyi8Arf6T66k/7dlQQHc8TWFScKWRpVoZCSNN4vkfTLLNkH09OjPMfO0GzUdp01GAQD9eNsV9iCibIV2aqzI+R1bMAYnlTrQl3dFpE0KmGOzRntWwB4miFv61ERjPhmUeNqrwFTVDL6nzaUk3kfwnYvldsIYi2uJJkBE8orXTYITcMKfdvm/tdc8aewATHtwGzym2ZbGh/7thQM63GHqWaMkrQSnCZb0v3/99EFFUg/68SDPkpuuksK0mMreTfbYjkqh4=; 25:ySyKb4Shx4rjdbIjiILCcFr0dDVFfiAHGL2I2Qit4F3Gs4P/0ao/nXMWQxhArSUDSkXuq7f3rgi4qktAP41H/VUbsxhu0DFJricxW0aCRgn6g4o4eunkHxNV/seyFowGXL0OAW8jX6Wz/oyH72h1QiY9pxfGSC6gYDG9ngTTQ/suY642k6rc2lHcNLw7ooiMfPVY1BdIJMPtlKWJixfKObLhia5SufJydpejCYt/SMKZWsV4EJT12JYwrsVF78lAAY+7Qwb8NRU2dSks3okoIMtbapM91TWTUq46xL44TRovTKYQeJieOSR7IDqKfWjtFQkK6/KkhKYWkjtUMIiA4A== X-MS-TrafficTypeDiagnostic: DM6PR12MB2636: X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2636; 31:1z4LhnWrq9miAilwAViSrL1EjxnayaaAscu/tGZPdhmAGJHWxOKlMT+s1qEGkFqLLZmWnDSq4UvVNaOJWtmHLPjxeWgXoGwx0W0n2lB2rRXDwo8mgAIQG7F2xbnNIGRDWDZFLBC66cfXMeXd7bNyInSaHi843zxh83cXmLuYp8lWOAhSiDxwGnQNZwjY0mlMyoZT7Svejocp7uDllpFN5GRgeZ0YL47zvNGWs2TZo38=; 20:gEW0yVk8v9FYuogGIzDx0kjOAB40FynDkntOrPBpD60rabq4+0Mty8nkD7Tn7Vz10TPMy7WN/Es3afXg4X6FcSWvxTo6tD57pvtGshLHVp7ZulTTh442s2npfSI8n8B7yhiTTuq1E/aIMJVfmLjl3yThmEp+fBBn76l0MsTo+x2gqazWZZNjZNnbRngX6Vdsp/enFlr6jDm0zu3wy7S8sUdK0fgbIv+Z4oKakI8DkVQgU2M00vgUKn+y0yfAvUoysfgAu6JGw8VFxe+eWZe7PA8g7cynakenHgpMsvxcr8+7CcOOnqzMxRbSKEoPk79HEvg9ts4Zvjx+Hj6YcUKE8ijOg7PM2cj2v+TOKC112Nx0TT+BjIEOouABQUwT+m0B5/PjGUlJSJu8sYTl93c6CAciHsfvrueE9FoIGXD0dJd6QfHADA4F8penL8vZuw9XNXLwP7QG49f4uCon/zjpQfsrrw2DMgpMjNdpAnTzMpd9OeOO41eQvN9YrOin2+g8 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)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DM6PR12MB2636; BCL:0; PCL:0; RULEID:; SRVR:DM6PR12MB2636; X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2636; 4:EzJvea+OQm6MVP/ZFWmwJQgLmhFBUjF5m6MXUEfmM8C+cbByypmUGV177D56Q0QJNi1lnLYPNi2H+OYyvrJPDnFML1blkCs8wY1uFtTonKs1dgyj4JEVU4La5bSNosQieMkm2n4YsvHq8hTvowHjqmQ1Kz+fAgLKxDHYjcZQE1I5e5tfyvhSfjbwTJWfK7we1QjSi7v58PPXz2yqlYvUoVa+By0peMKPtSzn/WPCTs39pmWH9hfh9a092fcBC056M0/stNxddVzRa+nhT69gbw== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR12MB2636; 23:29PtQE/0BmJRu0egaw8B4psgSFOHvRzD3Jgd4ejlH?= VjsnQEaYcOi4oyWezk9OdC2BmBeO0cXkESI1DZuj+vLcoJ28uyQQUG56Jjr7Soee15ghyuEhAMxF4JVwBaO9bxAxvP/KfuaEoMR08/46wagrazpHUQYv8doefw/IOlvz862NmNidYXaQLmtw16OiPZ/mAroivjPin9gbDkffep97EuXA1Z+l0CeZU//nAcK8OksF7puLwP4kjF/fx3TD0WdbUK+rl4WuVMAEcRpElIqdhi2yES3MnUIhkoGYZ6l68SwbIwNgwrz5uXa0Y0iPtrpRW4EGzZbvKmtHYL0fhkxehhGPVYuZfONgmOUlOvpRQka8UurfeY2TRKGvH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uoE2xcWyFI8SQ4DfCwCK4qq6T/HyxrogLv6p1R6HEdoxLU0H0MYrEHO3690yRVOvpatqlm8zRFcRkd513yU+ioNdJvcqHc3iSUwALyjKrncj+k49c4+DECRsw1Vg97vitvh5U3yFTzQYWQk= X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2636; 6:Jq+nlKNaMAoixJ0r6dA70EAAxMk1JuSs7jimkNoDY6G3K2YU66k0CVJz/zhXzu0NreP8wojQCL9WmtyeeUl07MmhM62GUOJbQWhcb2KN3LztZOAkr8aTLwCAPGok6y1yzR55LvAfNawXhAsT2W6HcW8wTplTuy9sT7K2bIs98iK9ySXHbQ6oTI6lp4djCpLKPKcrA4zv/4IA7eGZ5i+lMXDEGa+Bk7C+H71ga/MS5cHgRoPH5LEl08hr72W+mh2CjOMTckPPiE1ZiA87hORsK4qup/p6Ic1niUn9KBGzFRpLK0xUz5BUkk3aAcv94A7bPYq/z9aIt25GaemrVLonRsj08iv+tx1rciHEsjMgdjkAmIXxy6nyCjv0TT4QLyRcF3Zimj/dzcMtLhusF+TkYS5dyWdVbhuTWSM1DTpJmzOcNOLe/mg4MOyVDGYY3v410F6I/o89Qn2i8brTWf2lmQ==; 5:vyRwRnIyTGPD/QMpuV1R6Eauu6v8gcn6w9IMY4eliOk0aacCJDdArOFdOix/Z2Ptg3zvsWg/QjCtW7W4933HmepJRTrXxDwX1ZKuiaYPuPAUsjYmzl1/COljzZoxVEkqzIGX4pq6jnjR1lWH56PKPOLN0wtc55Ry0RHpYed/vGA=; 7:NsEKS1IX2X1zIeg2+js2HKvZAKMDP5rGWrATl1DmRkmvhhgLc8v6qxu4FsW0Mtjxzz19i4WX/sXTcnLjoaegxgdNgYnAP58/lAW2sEZIZvMZKNOgFXCtnSQGaQF60DQOprkmwZGufV9Ffq1pqBVrCQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR12MB2636; 20:uAEg6p4rPi7P8Nfl+0Ehl383zeZ3gllbFU2n+phTcv2Jz8sVdYSy3Bn6DRwP8QGnLfBsasnWvzPN4dnDNiqt/d/AmBGXNJietvAxcq/P76McnkoSwghlRrrV4AsPyBFyGCtFLzXcyQncUYwpNAO1ew3vQwbQddUalvVu6iPJEUExB07YzVhn7ErSUnxda3KyelnHFn30IHL0WFtQV5F3t7XvNQa5ixnw5xjRmiaB40UcJUwNKzJcBx3p5lX/Ww7h X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 15:57:14.8736 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6280d06-ae51-4b48-f133-08d65c5ca855 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: DM6PR12MB2636 Subject: [Intel-gfx] [PATCH libdrm 6/7] 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 | 62 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 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..f9feee60 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,56 @@ 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; + + 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; + + 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, From patchwork Fri Dec 7 15:56:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10718461 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 1C16915A6 for ; Fri, 7 Dec 2018 15:57:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A8522DADC for ; Fri, 7 Dec 2018 15:57:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2AAD2E5F6; Fri, 7 Dec 2018 15:57:30 +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=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 4F23F2DADC for ; Fri, 7 Dec 2018 15:57:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 76FC76E7FE; Fri, 7 Dec 2018 15:57:28 +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-eopbgr810075.outbound.protection.outlook.com [40.107.81.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id D3A026E7F7; Fri, 7 Dec 2018 15:57:26 +0000 (UTC) Received: from DM5PR12CA0014.namprd12.prod.outlook.com (2603:10b6:4:1::24) 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; Fri, 7 Dec 2018 15:57:24 +0000 Received: from DM3NAM03FT024.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::206) by DM5PR12CA0014.outlook.office365.com (2603:10b6:4:1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 15:57:24 +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 DM3NAM03FT024.mail.protection.outlook.com (10.152.82.182) 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:23 +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:22 -0600 From: Chunming Zhou To: , , , Date: Fri, 7 Dec 2018 23:56:42 +0800 Message-ID: <20181207155642.16063-7-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)(39860400002)(346002)(376002)(136003)(2980300002)(428003)(189003)(199004)(104016004)(575784001)(86362001)(110136005)(54906003)(8676002)(81166006)(77096007)(6666004)(356004)(26005)(50226002)(66574011)(14444005)(8936002)(2201001)(446003)(336012)(11346002)(186003)(486006)(2616005)(476003)(126002)(81156014)(426003)(4744004)(72206003)(450100002)(53416004)(478600001)(2906002)(50466002)(4326008)(76176011)(305945005)(5660300001)(23676004)(36756003)(7696005)(316002)(53936002)(68736007)(106466001)(5820100001)(2870700001)(97736004)(1076002)(105586002)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0834; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT024; 1:TY4rN93cZUEXwsQ2BiSLGoM0Joc7ioFAY+/tQyGIbkF1KU8XTr2R9Wi7SY+sZYIWBCt+hLarCQ5rhijPaJcFqDOBWFaymQavONUVxtIVIcl6LJ4BHKYaeQwjIxqnZagM X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd4e0169-2c4c-4c0c-577c-08d65c5cada6 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:7QLhZIQNhJABphddwf9vn9wKRTcFBqMBHiAgNNrNxH8I6OM3FQCZSSrUkJeTznN0xTZT4cpOFpJ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7GcPy9I8f4X6IyjDVXR8ZCzYG55Z7vJD/iwtryhqQ+wG8oNirGlNJqfe5r/t9L8XMpeqdZtBlxUPu/GxdHsdPHud+TX31WtBPO+4gD7KPkI19xx1yFstaeEZsMW4wDuJA9GjeoeHjiEWTZGElKv/DoeDisW1b3+1FCN4S1ufFrHaaow03APWAIV5/N80r4QNj0Ac20iydDuKDOqullUjLJ33HWL6aDkwuxYzmXflrXz4PURIgFg4ySgxnkqlVz40OmEEK7IbIblBv1ckv2wm4vSQYh4wdjThbTKCDI6gcBHz6/SOBa7SRWTeRtvgZdaoyibxQr1bOS7FmhZwNCnIDMxHjZOBbca1OyDTDwle3TVURD/7BLQk 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)(93006095)(93003095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BN4PR12MB0834; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0834; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0834; 4:v91sSshCEboWKUq8PJFfuAJQLGeCcbe9y0gmrjtvCnz38v64YsK5nA97DS/DYaYXZTMqb0m2Ba+Dc0c52wks20cKz4/eUtDJgUiwBgjkPQLwpxLRy6yP5KtJjIHYw/7DV6LGyMLJAQAyt4R1c8qnCu9HX6C5o97owqR91uVpgb2+ekCMMKlCgxM2FIhBKBare/39Dqe4PmZ5BpE0llAK3UdejHkHNc/SqO8GcycYek5GIH3PWSLiLE9vPfyJ/v0UZnsFt/paDn7C6YyYppe6tw== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBN4PR12MB0834=3B23=3AUKn60E6?= =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8YggO8DOAVkCQ0cERUvnc1SrnRWU8z1foRS0jHZ4qv3oODD6Oz5ESBPi63IXIJ79q25doyq7Qx7J+lF2McEVhWedzrhUD2lMasnP+BKj7dKGXl7B+TsYAeKjBO+yz5pxhcFjx7uDkjbd9R51dadBoZi5CiSKv8ujzNVegNqBh2C/Z1od8fvXqlV+B0bydJj8pF9G3Ylp0Sz7qiKCocZXDe8e6dSrw/Cmo1TkH4wYSzCDoDESqu2eJJ4jeKEE2uZXJpjjmEG29fW630z05SUBujnuIIaS6Mnr+7VrIub7Z2gj4DVvyFZnpgujF4OPrww==; 5:NQ0ev3NpK9NlldWLu7CSCF+3slqMetk0tIbaTST2IMkG2cyw5D76lLYBsTCDwBUaHtk3r+WjNp7Ylia8RedfZ4C2SKi70yEruyBXzQ99gKs3CPf22prLVWE7Tt4MZy+G11nZ1ugWWtSG6zqxLUivG6HduNyqZkfco3nwz1cLoLw=; 7:XT87A+M7bX4wnzasngukrHXN9oz9zDbqQ0iCaS4gzExmmBvzmknGq1ualoGRgCD+n8MFhMBwrSTvB0G2sTIhLRwmlIpjk4EZpG0uk/Bww+xRf+y5itLIRxce1XzUJMYwJRxNe6svVOIOA3bfgi6LQQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0834; 20:3+SUAF+18VQmV2k0tSs/ma3s2Xp4cloyA2NhqBi+T7fIcdK1GI1MZBvp5gaNXdd0Jw+Miw6BwdIxdokz3X3PFOwuQII8+SshB3sxb9eVGsdBFvZWcFVeERDNbJEdx18XiL/CJ48uaOqT5okmCN3bXYyr6K4t40Sj1OYbS7brVTh0uO+fIklH8pVl95sUDkCRJBaLwwki2WJxUPrRHgGXQOq6CoOwU2rGFqQ4cRTzq2OlS0/Eu40GrkQV3Rqt/pFc X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 15:57:23.6172 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cd4e0169-2c4c-4c0c-577c-08d65c5cada6 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: BN4PR12MB0834 Subject: [Intel-gfx] [PATCH libdrm 7/7] add syncobj timeline tests 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: drop DRM_SYNCOBJ_CREATE_TYPE_TIMELINE, fix timeout calculation, fix some warnings v3: add export/import and cpu signal testing cases Signed-off-by: Chunming Zhou Signed-off-by: Christian König --- tests/amdgpu/Makefile.am | 3 +- tests/amdgpu/amdgpu_test.c | 12 ++ tests/amdgpu/amdgpu_test.h | 21 +++ tests/amdgpu/meson.build | 2 +- tests/amdgpu/syncobj_tests.c | 290 +++++++++++++++++++++++++++++++++++ 5 files changed, 326 insertions(+), 2 deletions(-) create mode 100644 tests/amdgpu/syncobj_tests.c diff --git a/tests/amdgpu/Makefile.am b/tests/amdgpu/Makefile.am index 447ff217..d3fbe2bb 100644 --- a/tests/amdgpu/Makefile.am +++ b/tests/amdgpu/Makefile.am @@ -33,4 +33,5 @@ amdgpu_test_SOURCES = \ vcn_tests.c \ uve_ib.h \ deadlock_tests.c \ - vm_tests.c + vm_tests.c \ + syncobj_tests.c diff --git a/tests/amdgpu/amdgpu_test.c b/tests/amdgpu/amdgpu_test.c index ebf44098..ff1448f3 100644 --- a/tests/amdgpu/amdgpu_test.c +++ b/tests/amdgpu/amdgpu_test.c @@ -56,6 +56,7 @@ #define UVD_ENC_TESTS_STR "UVD ENC Tests" #define DEADLOCK_TESTS_STR "Deadlock Tests" #define VM_TESTS_STR "VM Tests" +#define SYNCOBJ_TIMELINE_TESTS_STR "SYNCOBJ TIMELINE Tests" /** * Open handles for amdgpu devices @@ -116,6 +117,12 @@ static CU_SuiteInfo suites[] = { .pCleanupFunc = suite_vm_tests_clean, .pTests = vm_tests, }, + { + .pName = SYNCOBJ_TIMELINE_TESTS_STR, + .pInitFunc = suite_syncobj_timeline_tests_init, + .pCleanupFunc = suite_syncobj_timeline_tests_clean, + .pTests = syncobj_timeline_tests, + }, CU_SUITE_INFO_NULL, }; @@ -165,6 +172,11 @@ static Suites_Active_Status suites_active_stat[] = { .pName = VM_TESTS_STR, .pActive = suite_vm_tests_enable, }, + { + .pName = SYNCOBJ_TIMELINE_TESTS_STR, + .pActive = suite_syncobj_timeline_tests_enable, + }, + }; diff --git a/tests/amdgpu/amdgpu_test.h b/tests/amdgpu/amdgpu_test.h index af81eea8..24d64b64 100644 --- a/tests/amdgpu/amdgpu_test.h +++ b/tests/amdgpu/amdgpu_test.h @@ -194,6 +194,27 @@ CU_BOOL suite_vm_tests_enable(void); */ extern CU_TestInfo vm_tests[]; +/** + * Initialize syncobj timeline test suite + */ +int suite_syncobj_timeline_tests_init(); + +/** + * Deinitialize syncobj timeline test suite + */ +int suite_syncobj_timeline_tests_clean(); + +/** + * Decide if the suite is enabled by default or not. + */ +CU_BOOL suite_syncobj_timeline_tests_enable(void); + +/** + * Tests in syncobj timeline test suite + */ +extern CU_TestInfo syncobj_timeline_tests[]; + + /** * Helper functions */ diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build index 4c1237c6..3ceec715 100644 --- a/tests/amdgpu/meson.build +++ b/tests/amdgpu/meson.build @@ -24,7 +24,7 @@ if dep_cunit.found() files( 'amdgpu_test.c', 'basic_tests.c', 'bo_tests.c', 'cs_tests.c', 'vce_tests.c', 'uvd_enc_tests.c', 'vcn_tests.c', 'deadlock_tests.c', - 'vm_tests.c', + 'vm_tests.c', 'syncobj_tests.c', ), dependencies : [dep_cunit, dep_threads], include_directories : [inc_root, inc_drm, include_directories('../../amdgpu')], diff --git a/tests/amdgpu/syncobj_tests.c b/tests/amdgpu/syncobj_tests.c new file mode 100644 index 00000000..a0c627d7 --- /dev/null +++ b/tests/amdgpu/syncobj_tests.c @@ -0,0 +1,290 @@ +/* + * Copyright 2017 Advanced Micro Devices, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * +*/ + +#include "CUnit/Basic.h" + +#include "amdgpu_test.h" +#include "amdgpu_drm.h" +#include "amdgpu_internal.h" +#include + +static amdgpu_device_handle device_handle; +static uint32_t major_version; +static uint32_t minor_version; + +static void amdgpu_syncobj_timeline_test(void); + +CU_BOOL suite_syncobj_timeline_tests_enable(void) +{ + return CU_TRUE; +} + +int suite_syncobj_timeline_tests_init(void) +{ + int r; + + r = amdgpu_device_initialize(drm_amdgpu[0], &major_version, + &minor_version, &device_handle); + + if (r) { + if ((r == -EACCES) && (errno == EACCES)) + printf("\n\nError:%s. " + "Hint:Try to run this test program as root.", + strerror(errno)); + return CUE_SINIT_FAILED; + } + + return CUE_SUCCESS; +} + +int suite_syncobj_timeline_tests_clean(void) +{ + int r = amdgpu_device_deinitialize(device_handle); + + if (r == 0) + return CUE_SUCCESS; + else + return CUE_SCLEAN_FAILED; +} + + +CU_TestInfo syncobj_timeline_tests[] = { + { "syncobj timeline test", amdgpu_syncobj_timeline_test }, + CU_TEST_INFO_NULL, +}; + +#define GFX_COMPUTE_NOP 0xffff1000 +#define SDMA_NOP 0x0 +static int syncobj_command_submission_helper(uint32_t syncobj_handle, bool + wait_or_signal, uint64_t point) +{ + amdgpu_context_handle context_handle; + amdgpu_bo_handle ib_result_handle; + void *ib_result_cpu; + uint64_t ib_result_mc_address; + struct drm_amdgpu_cs_chunk chunks[2]; + struct drm_amdgpu_cs_chunk_data chunk_data; + struct drm_amdgpu_cs_chunk_syncobj syncobj_data; + struct amdgpu_cs_fence fence_status; + amdgpu_bo_list_handle bo_list; + amdgpu_va_handle va_handle; + uint32_t expired, flags; + int i, r; + uint64_t seq_no; + static uint32_t *ptr; + + r = amdgpu_cs_ctx_create(device_handle, &context_handle); + CU_ASSERT_EQUAL(r, 0); + + r = amdgpu_bo_alloc_and_map(device_handle, 4096, 4096, + AMDGPU_GEM_DOMAIN_GTT, 0, + &ib_result_handle, &ib_result_cpu, + &ib_result_mc_address, &va_handle); + CU_ASSERT_EQUAL(r, 0); + + r = amdgpu_get_bo_list(device_handle, ib_result_handle, NULL, + &bo_list); + CU_ASSERT_EQUAL(r, 0); + + ptr = ib_result_cpu; + + for (i = 0; i < 16; ++i) + ptr[i] = wait_or_signal ? GFX_COMPUTE_NOP: SDMA_NOP; + + chunks[0].chunk_id = AMDGPU_CHUNK_ID_IB; + chunks[0].length_dw = sizeof(struct drm_amdgpu_cs_chunk_ib) / 4; + chunks[0].chunk_data = (uint64_t)(uintptr_t)&chunk_data; + chunk_data.ib_data._pad = 0; + chunk_data.ib_data.va_start = ib_result_mc_address; + chunk_data.ib_data.ib_bytes = 16 * 4; + chunk_data.ib_data.ip_type = wait_or_signal ? AMDGPU_HW_IP_GFX : + AMDGPU_HW_IP_DMA; + chunk_data.ib_data.ip_instance = 0; + chunk_data.ib_data.ring = 0; + chunk_data.ib_data.flags = 0; + + chunks[1].chunk_id = wait_or_signal ? + AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_WAIT : + AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_SIGNAL; + chunks[1].length_dw = sizeof(struct drm_amdgpu_cs_chunk_syncobj) / 4; + chunks[1].chunk_data = (uint64_t)(uintptr_t)&syncobj_data; + syncobj_data.handle = syncobj_handle; + syncobj_data.point = point; + syncobj_data.flags = DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT; + + r = amdgpu_cs_submit_raw(device_handle, + context_handle, + bo_list, + 2, + chunks, + &seq_no); + CU_ASSERT_EQUAL(r, 0); + + + memset(&fence_status, 0, sizeof(struct amdgpu_cs_fence)); + fence_status.context = context_handle; + fence_status.ip_type = wait_or_signal ? AMDGPU_HW_IP_GFX: + AMDGPU_HW_IP_DMA; + fence_status.ip_instance = 0; + fence_status.ring = 0; + fence_status.fence = seq_no; + + r = amdgpu_cs_query_fence_status(&fence_status, + AMDGPU_TIMEOUT_INFINITE,0, &expired); + CU_ASSERT_EQUAL(r, 0); + + r = amdgpu_bo_list_destroy(bo_list); + CU_ASSERT_EQUAL(r, 0); + + r = amdgpu_bo_unmap_and_free(ib_result_handle, va_handle, + ib_result_mc_address, 4096); + CU_ASSERT_EQUAL(r, 0); + + r = amdgpu_cs_ctx_free(context_handle); + CU_ASSERT_EQUAL(r, 0); + + return r; +} + +struct syncobj_point { + uint32_t syncobj_handle; + uint64_t point; +}; + +static void *syncobj_wait(void *data) +{ + struct syncobj_point *sp = (struct syncobj_point *)data; + int r; + + r = syncobj_command_submission_helper(sp->syncobj_handle, true, + sp->point); + CU_ASSERT_EQUAL(r, 0); + + return (void *)(long)r; +} + +static void *syncobj_signal(void *data) +{ + struct syncobj_point *sp = (struct syncobj_point *)data; + int r; + + r = syncobj_command_submission_helper(sp->syncobj_handle, false, + sp->point); + CU_ASSERT_EQUAL(r, 0); + + return (void *)(long)r; +} + +static void amdgpu_syncobj_timeline_test(void) +{ + static pthread_t wait_thread; + static pthread_t signal_thread; + static pthread_t c_thread; + struct syncobj_point sp1, sp2, sp3; + uint32_t syncobj_handle; + uint64_t payload; + uint64_t wait_point, signal_point; + uint64_t timeout; + struct timespec tp; + int r, sync_fd; + void *tmp; + + r = amdgpu_cs_create_syncobj2(device_handle, 0, &syncobj_handle); + CU_ASSERT_EQUAL(r, 0); + + // wait on point 5 + sp1.syncobj_handle = syncobj_handle; + sp1.point = 5; + r = pthread_create(&wait_thread, NULL, syncobj_wait, &sp1); + CU_ASSERT_EQUAL(r, 0); + + // signal on point 10 + sp2.syncobj_handle = syncobj_handle; + sp2.point = 10; + r = pthread_create(&signal_thread, NULL, syncobj_signal, &sp2); + CU_ASSERT_EQUAL(r, 0); + + r = pthread_join(wait_thread, &tmp); + CU_ASSERT_EQUAL(r, 0); + CU_ASSERT_EQUAL(tmp, 0); + + r = pthread_join(signal_thread, &tmp); + CU_ASSERT_EQUAL(r, 0); + CU_ASSERT_EQUAL(tmp, 0); + + //query timeline payload + r = amdgpu_cs_syncobj_query(device_handle, &syncobj_handle, + &payload, 1); + CU_ASSERT_EQUAL(r, 0); + CU_ASSERT_EQUAL(payload, 10); + + //signal on point 16 + sp3.syncobj_handle = syncobj_handle; + sp3.point = 16; + r = pthread_create(&c_thread, NULL, syncobj_signal, &sp3); + CU_ASSERT_EQUAL(r, 0); + //CPU wait on point 16 + wait_point = 16; + timeout = 0; + clock_gettime(CLOCK_MONOTONIC, &tp); + timeout = tp.tv_sec * 1000000000ULL + tp.tv_nsec; + timeout += 0x10000000000; //10s + r = amdgpu_cs_syncobj_timeline_wait(device_handle, &syncobj_handle, + &wait_point, 1, timeout, + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL | + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT, + NULL); + + CU_ASSERT_EQUAL(r, 0); + r = pthread_join(c_thread, &tmp); + CU_ASSERT_EQUAL(r, 0); + CU_ASSERT_EQUAL(tmp, 0); + + // export point 16 and import to point 18 + r = amdgpu_cs_syncobj_export_sync_file2(device_handle, syncobj_handle, + 16, + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT, + &sync_fd); + CU_ASSERT_EQUAL(r, 0); + r = amdgpu_cs_syncobj_import_sync_file2(device_handle, syncobj_handle, + 18, sync_fd); + CU_ASSERT_EQUAL(r, 0); + r = amdgpu_cs_syncobj_query(device_handle, &syncobj_handle, + &payload, 1); + CU_ASSERT_EQUAL(r, 0); + CU_ASSERT_EQUAL(payload, 18); + + // CPU signal on point 20 + signal_point = 20; + r = amdgpu_cs_syncobj_timeline_signal(device_handle, &syncobj_handle, + &signal_point, 1); + CU_ASSERT_EQUAL(r, 0); + r = amdgpu_cs_syncobj_query(device_handle, &syncobj_handle, + &payload, 1); + CU_ASSERT_EQUAL(r, 0); + CU_ASSERT_EQUAL(payload, 20); + + r = amdgpu_cs_destroy_syncobj(device_handle, syncobj_handle); + CU_ASSERT_EQUAL(r, 0); + +}