From patchwork Tue May 7 11:33:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10932829 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 68BF8912 for ; Tue, 7 May 2019 11:34:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 576852864A for ; Tue, 7 May 2019 11:34:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BC8828927; Tue, 7 May 2019 11:34:26 +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 027722864A for ; Tue, 7 May 2019 11:34:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E1DB6E7B1; Tue, 7 May 2019 11:34:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-eopbgr740078.outbound.protection.outlook.com [40.107.74.78]) by gabe.freedesktop.org (Postfix) with ESMTPS id 63FBC6E7AD for ; Tue, 7 May 2019 11:34:21 +0000 (UTC) Received: from CY4PR12CA0039.namprd12.prod.outlook.com (2603:10b6:903:129::25) by CY4PR12MB1142.namprd12.prod.outlook.com (2603:10b6:903:40::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Tue, 7 May 2019 11:34:19 +0000 Received: from DM3NAM03FT051.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::205) by CY4PR12CA0039.outlook.office365.com (2603:10b6:903:129::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.10 via Frontend Transport; Tue, 7 May 2019 11:34: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 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.1856.11 via Frontend Transport; Tue, 7 May 2019 11:34: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, 7 May 2019 06:34:17 -0500 From: Chunming Zhou To: Subject: [PATCH libdrm 6/7] wrap transfer interfaces Date: Tue, 7 May 2019 19:33:58 +0800 Message-ID: <20190507113359.16387-6-david1.zhou@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190507113359.16387-1-david1.zhou@amd.com> References: <20190507113359.16387-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)(39860400002)(136003)(346002)(396003)(2980300002)(428003)(199004)(189003)(2616005)(54906003)(47776003)(1076003)(316002)(6916009)(26005)(53416004)(50466002)(2351001)(48376002)(77096007)(486006)(476003)(126002)(36756003)(70206006)(305945005)(70586007)(11346002)(81156014)(426003)(5660300002)(8936002)(16586007)(86362001)(478600001)(336012)(53936002)(72206003)(446003)(50226002)(8676002)(76176011)(2906002)(51416003)(186003)(7696005)(356004)(6666004)(68736007)(4326008)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1142; 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: 9e23320a-5079-46b1-2ee6-08d6d2dff1be X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:CY4PR12MB1142; X-MS-TrafficTypeDiagnostic: CY4PR12MB1142: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2043; X-Forefront-PRVS: 0030839EEE X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: +4JSFBS2s8J8/LHDpo2khaQVoX6l8Dcy4mP96PsOImrnZ6Xr97zh3tFtS8mu1813tP9RdFrIpEUYGEthtIsXe5cWIA/Kuthsolt4zu4mJ0/fhfYRK7x66db1epgkO8D/MgXsSX/sCabxqQdWNGRGMbe9iXz2/cCxhQ9OVC4BOfJCqplANRD5rhfJIP0VM69HeSY56x6q7LSrZdLI3l49iRqwo5/5Rvwdq5l+3uaLLzT4oWtdpn7ULgtXuG+QKJA3O91eiwjm+kLfdxT1jkqVM5aSO9EKwcZLGken2810mWBDBOxDwu/ZVvuM4RgKR+v5eEJCV6pLVyP69BCRomSBJi5yWwoY4eWEBbtoIPoYsCVR/GQsebXbQNi5eGpWwhRi/uC/df55VSvHCCcoVTr5uyY9QI4nk6qBMfFRJ3FwHdI= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2019 11:34:19.2935 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e23320a-5079-46b1-2ee6-08d6d2dff1be 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: CY4PR12MB1142 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=VMzc/yDIhFGzpxygir/Hw9Hy1VAH1isKOqICaXuG4pI=; b=Lcj9kVBXfWpyp9zGqqAXZyi3qxJkN3EY4gmuFvCuiFQPRaYAPdxkVCA4FxnehURcq4V9gCF7DVFEzpdFj+h1B1PCe035B6RAXxu2a9Obj2BzsLTGmz6isEqbvcDj9D9cpvoe/W9dAWgRoSlyz++ddogZPvPDdB0zU6h9XQkXpRU= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; 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: , Cc: Christian.Koenig@amd.com 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 d2480dbe..9d9b0832 100644 --- a/amdgpu/amdgpu.h +++ b/amdgpu/amdgpu.h @@ -1685,6 +1685,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 daca4421..977fa3cf 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -817,6 +817,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,