From patchwork Tue Apr 9 09:04:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10890803 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 3621D1800 for ; Tue, 9 Apr 2019 09:05:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2333D28832 for ; Tue, 9 Apr 2019 09:05:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17E5E288A2; Tue, 9 Apr 2019 09:05:35 +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 BDFE328898 for ; Tue, 9 Apr 2019 09:05:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 73D4589218; Tue, 9 Apr 2019 09:05:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@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 9AF8C89204; Tue, 9 Apr 2019 09:05:21 +0000 (UTC) Received: from DM3PR12CA0138.namprd12.prod.outlook.com (2603:10b6:0:51::34) by CY1PR12MB0585.namprd12.prod.outlook.com (2a01:111:e400:c439::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.14; Tue, 9 Apr 2019 09:05:20 +0000 Received: from BY2NAM03FT048.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::207) by DM3PR12CA0138.outlook.office365.com (2603:10b6:0:51::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1792.14 via Frontend Transport; Tue, 9 Apr 2019 09:05:19 +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 BY2NAM03FT048.mail.protection.outlook.com (10.152.85.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16 via Frontend Transport; Tue, 9 Apr 2019 09:05:19 +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; Tue, 9 Apr 2019 04:05:12 -0500 From: Chunming Zhou To: , , , Subject: [PATCH libdrm 7/8] wrap transfer interfaces Date: Tue, 9 Apr 2019 17:04:36 +0800 Message-ID: <20190409090437.3485-7-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190409090437.3485-1-david1.zhou@amd.com> References: <20190409090437.3485-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)(396003)(346002)(376002)(39860400002)(2980300002)(428003)(199004)(189003)(36756003)(106466001)(305945005)(97736004)(316002)(104016004)(105586002)(356004)(16586007)(110136005)(336012)(53936002)(186003)(53416004)(26005)(6666004)(77096007)(2201001)(446003)(426003)(86362001)(126002)(81156014)(81166006)(68736007)(51416003)(76176011)(2906002)(7696005)(50226002)(4326008)(486006)(47776003)(11346002)(476003)(2616005)(8676002)(1076003)(8936002)(5660300002)(48376002)(478600001)(72206003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0585; 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: 5bfe57da-71c2-4d1a-0d9e-08d6bcca7dad X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328); SRVR:CY1PR12MB0585; X-MS-TrafficTypeDiagnostic: CY1PR12MB0585: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 000227DA0C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: JJCBWH1iyGPzEH8bKqqT+BPFriOaLZ8OhGu93UWxNo1UN5AagWUIjx0+IHJ1vsKU3bFRhkb3cN+IX+GdFOP2nke5VesTVmho73boqe75P1LHQ5dFKPwbizZvYYb2z7cM4KWmqYqjc/EmkcODLWQmCaWbZElD/TV7EhczHiT2B6NpMmxak7b6afu6bj+jjzUUT1Djm5h7GTBYchuUelMQtMTPf24hlTQ6RMJmL0z4ukNiADkqYGbolFBonz6NNOVhy0DQSeqQwZGkpM2IELYvz41a79TR1zAUuaB3RllTraFs+uBL25bTIZiJJuCBFf+eKUyrNvmfc9C/9vzMxyvavXdyOjd6n+T2DUqXPrbUqsNN6VrhYAI8NV6+o/1gHtE+OeeEKedRB5oh1qxwwzAs6ZoNDJNsLBZoKuc4WqwBIhQ= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2019 09:05:19.5696 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5bfe57da-71c2-4d1a-0d9e-08d6bcca7dad 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: CY1PR12MB0585 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=AW1JtJ823tY7dJM7xRAJNQEfUc4Q61NK5SNMZIiJRSztg1pMEXcp10Q89LCocYZptYRCiZCIL8BWVPb2zlOvdRnPf3bfdVKk8rYyvLl4l+txaJ55Gn6JnYsTqtSoszrFUuk/6BjTTTFvAT0hVJmk3CmHUBOjtrg4Qw52CxrhUJI= 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,