From patchwork Thu May 16 08:07:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10945853 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 D56BE6C5 for ; Thu, 16 May 2019 08:07:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C92FA28AA0 for ; Thu, 16 May 2019 08:07:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD91B28AA2; Thu, 16 May 2019 08:07:37 +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 6A8F228AA0 for ; Thu, 16 May 2019 08:07:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2EC81892CC; Thu, 16 May 2019 08:07:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800052.outbound.protection.outlook.com [40.107.80.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id C880B892CC for ; Thu, 16 May 2019 08:07:34 +0000 (UTC) Received: from DM3PR12CA0130.namprd12.prod.outlook.com (2603:10b6:0:51::26) by BYAPR12MB2664.namprd12.prod.outlook.com (2603:10b6:a03:69::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.25; Thu, 16 May 2019 08:07:32 +0000 Received: from DM3NAM03FT056.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::207) by DM3PR12CA0130.outlook.office365.com (2603:10b6:0:51::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Thu, 16 May 2019 08:07:32 +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 DM3NAM03FT056.mail.protection.outlook.com (10.152.83.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Thu, 16 May 2019 08:07:32 +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; Thu, 16 May 2019 03:07:30 -0500 From: Chunming Zhou To: , Subject: [PATCH libdrm 4/7] add timeline signal/transfer ioctls v2 Date: Thu, 16 May 2019 16:07:11 +0800 Message-ID: <20190516080714.14980-4-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190516080714.14980-1-david1.zhou@amd.com> References: <20190516080714.14980-1-david1.zhou@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(136003)(346002)(39860400002)(376002)(2980300002)(428003)(199004)(189003)(4326008)(1076003)(47776003)(53936002)(5660300002)(2906002)(426003)(110136005)(76176011)(51416003)(48376002)(6666004)(7696005)(50466002)(356004)(70586007)(70206006)(81166006)(8676002)(86362001)(478600001)(72206003)(336012)(2616005)(126002)(446003)(316002)(486006)(11346002)(476003)(8936002)(77096007)(305945005)(68736007)(26005)(50226002)(81156014)(53416004)(16586007)(36756003)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB2664; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cc3fd7d4-d00e-4ce8-bd74-08d6d9d58c31 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:BYAPR12MB2664; X-MS-TrafficTypeDiagnostic: BYAPR12MB2664: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:346; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: mR8buN4CEgONUvB1AXkps6D9WErDnu0Wqq2qNzOFsM/D8upoeqKH3g/Quznt7oq+Gy1sReHdD5R+Ocz/ujywIaaq2x5zE/EHKLiysuLv5/X5YtC+zcUY9418hhy2j1xLY6FBa2DGvx4RxEFeRNY3IceakU/WluU7gMWXVPi2CA+4T+SKzZDUmrm6uNoKiXAHMFHfzv9vuMJ8bDWMoXMDjDJ75xRhjHBIxmJ3p9LraSPMgzqqb0exUdDCjzyP2+apEkIV5Hx8bStPVwfvnrVrJUsIc29k/rg/642afQ30Bu52s+uldkXIMOKxR4grM4QcwlWBiCmHGp5qJSTeVtiATZadMceK87sEahjlIitQuHp87l7euLST+/vu3gsHUsoD+ReldkKcZ1OYx4O18KiocWzOcDpDNIOFzP8dBNi6/2s= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 08:07:32.1814 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cc3fd7d4-d00e-4ce8-bd74-08d6d9d58c31 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: BYAPR12MB2664 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+BJslU7vJVtg6Rwi9klBc0Tbpt5PpdeTXRnkUIjzojw=; b=PTtuAa+hIflGIhu/VD+0gckcFI93XRBMnKSIcuQb+yYacV40xlD9bMdLhZ+k4lTc3k7bbGosw1J7eaqlD6w4cCuiBGwdNe0tSMcsSxQSQRoptd2G6g4YnYdkI5NOiIuvSwMb/dgJ3Im2q857m9dAYTnknV3iBs2itLzNq1+qq5c= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP v2: use one transfer ioctl Signed-off-by: Chunming Zhou Reviewed-by: Lionel Landwerlin --- xf86drm.c | 33 +++++++++++++++++++++++++++++++++ xf86drm.h | 6 ++++++ 2 files changed, 39 insertions(+) diff --git a/xf86drm.c b/xf86drm.c index 1a717f02..953fc762 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -4257,6 +4257,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 = (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, @@ -4299,4 +4314,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 60c7a84f..3fb1d1ca 100644 --- a/xf86drm.h +++ b/xf86drm.h @@ -876,12 +876,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) }