From patchwork Mon Apr 1 09:58:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10879587 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 B8DB414DE for ; Mon, 1 Apr 2019 09:59:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2A6927EED for ; Mon, 1 Apr 2019 09:59:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 94B8528435; Mon, 1 Apr 2019 09:59:16 +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 4C0B527EED for ; Mon, 1 Apr 2019 09:59:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16245895F5; Mon, 1 Apr 2019 09:59:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0603.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe48::603]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77F9189338; Mon, 1 Apr 2019 09:59:13 +0000 (UTC) Received: from DM3PR12CA0066.namprd12.prod.outlook.com (2603:10b6:0:56::34) by DM6PR12MB3466.namprd12.prod.outlook.com (2603:10b6:5:3b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.16; Mon, 1 Apr 2019 09:59:12 +0000 Received: from DM3NAM03FT018.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by DM3PR12CA0066.outlook.office365.com (2603:10b6:0:56::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1750.15 via Frontend Transport; Mon, 1 Apr 2019 09:59: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 DM3NAM03FT018.mail.protection.outlook.com (10.152.82.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1750.16 via Frontend Transport; Mon, 1 Apr 2019 09:59: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; Mon, 1 Apr 2019 04:59:11 -0500 From: Chunming Zhou To: , , , Subject: [PATCH libdrm 7/8] wrap transfer interfaces Date: Mon, 1 Apr 2019 17:58:37 +0800 Message-ID: <20190401095838.10165-7-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401095838.10165-1-david1.zhou@amd.com> References: <20190401095838.10165-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)(136003)(376002)(39860400002)(2980300002)(428003)(199004)(189003)(16586007)(72206003)(8676002)(50466002)(1076003)(336012)(51416003)(68736007)(4326008)(2201001)(2906002)(6666004)(106466001)(104016004)(53936002)(86362001)(305945005)(478600001)(446003)(77096007)(316002)(105586002)(186003)(97736004)(426003)(8936002)(11346002)(356004)(5660300002)(53416004)(36756003)(476003)(110136005)(50226002)(81156014)(486006)(81166006)(76176011)(47776003)(2616005)(26005)(48376002)(7696005)(126002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB3466; 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: 12a33bbc-7cbe-4b41-69d3-08d6b688b13d X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:DM6PR12MB3466; X-MS-TrafficTypeDiagnostic: DM6PR12MB3466: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0994F5E0C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: AKYphSDOzwfTF/H1l+BuqNnEmA6CX3vCAnfNH0bPE926HqmU3K+IwR6p5kuYFADNBpeN3MeJKfnSCpJo0PbGZ5R8E9+RvVKBNT3KNRnu+2nAW4hk6eJ/OmroCsyvgrz2wYMTEVQpvTT1Pd9Jxmpl/DjSaQr7hHWHZWcggTge+sMvTt5UXSkRixxRBD3VNP9jCOQEyty7ljW2xOt3dxAXMJhjVMUTKuxcVhn16OA0gqJHKWAy+nOQMaiy/va6AXHbZ2M1o1Z+ViMCObcJUMRk4bXAU522FH9UJBZfTthrHJNSQYw8xuszi12y/X7+ciECF9nsT1WCbQtK0hZGt16rBh5NdU4kFFojwBkYAmUWUpZheHpBckfZbjKe4mPUzPyhwYFDAzwtILjCGpHdY56fdsXjq79UtnNTJN0E3SI03LI= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2019 09:59:12.2951 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 12a33bbc-7cbe-4b41-69d3-08d6b688b13d 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: DM6PR12MB3466 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=Rej5iMLU3NO2UnpFs1lG57Og538A2y2dVgH6zQ1feXg=; b=d06ZJ5UqlEzLhrm5EBqdkzKGNnIJeHckQbB1+ioph9b0pimRfSuglvJcqOCCH1/MwsiwYuhVY5iqFkF+asFnCU1OKFAzwa7OgnbQkzO7AiEzFZbRFB3zMC/ocSzZKZQJVNqa2DkUNmRagA/2GkVahrumv3psTLY1AP4j3xVkBFY= 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 Signed-off-by: Chunming Zhou --- amdgpu/amdgpu.h | 22 ++++++++++++++++++++++ amdgpu/amdgpu_cs.c | 16 ++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h index b5bd3ed9..2350835b 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -1670,6 +1670,28 @@ int amdgpu_cs_syncobj_import_sync_file2(amdgpu_device_handle dev, uint32_t syncobj, uint64_t point, int sync_file_fd); + +/** + * transfer between syncbojs. + * + * \param dev - \c [in] device handle + * \param dst_handle - \c [in] sync object handle + * \param dst_point - \c [in] timeline point, 0 presents dst is binary + * \param src_handle - \c [in] sync object handle + * \param src_point - \c [in] timeline point, 0 presents src is binary + * \param flags - \c [in] flags + * + * \return 0 on success\n + * <0 - Negative POSIX Error code + * + */ +int amdgpu_cs_syncobj_transfer(amdgpu_device_handle dev, + uint32_t dst_handle, + uint64_t dst_point, + uint32_t src_handle, + uint64_t src_point, + uint32_t flags); + /** * Export an amdgpu fence as a handle (syncobj or fd). * diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 1c02d16f..a1c1af55 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -792,6 +792,22 @@ out: return ret; } +drm_public int amdgpu_cs_syncobj_transfer(amdgpu_device_handle dev, + uint32_t dst_handle, + uint64_t dst_point, + uint32_t src_handle, + uint64_t src_point, + uint32_t flags) +{ + if (NULL == dev) + return -EINVAL; + + return drmSyncobjTransfer(dev->fd, + dst_handle, dst_point, + src_handle, src_point, + flags); +} + drm_public int amdgpu_cs_submit_raw(amdgpu_device_handle dev, amdgpu_context_handle context, amdgpu_bo_list_handle bo_list_handle,