From patchwork Thu May 16 08:07:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10945857 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 3AF206C5 for ; Thu, 16 May 2019 08:07:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E2B728AA0 for ; Thu, 16 May 2019 08:07:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2277828AA2; Thu, 16 May 2019 08:07:44 +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 CCCCE28AA0 for ; Thu, 16 May 2019 08:07:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2BCF8930C; Thu, 16 May 2019 08:07:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710076.outbound.protection.outlook.com [40.107.71.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB1E2892F1 for ; Thu, 16 May 2019 08:07:41 +0000 (UTC) Received: from DM3PR12CA0077.namprd12.prod.outlook.com (2603:10b6:0:57::21) by CY4PR1201MB0053.namprd12.prod.outlook.com (2603:10b6:910:23::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.24; Thu, 16 May 2019 08:07:39 +0000 Received: from DM3NAM03FT054.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::202) by DM3PR12CA0077.outlook.office365.com (2603:10b6:0:57::21) 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:38 +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 DM3NAM03FT054.mail.protection.outlook.com (10.152.83.223) 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:38 +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:37 -0500 From: Chunming Zhou To: , Subject: [PATCH libdrm 6/7] wrap transfer interfaces Date: Thu, 16 May 2019 16:07:13 +0800 Message-ID: <20190516080714.14980-6-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)(346002)(39860400002)(376002)(136003)(396003)(2980300002)(428003)(189003)(199004)(68736007)(336012)(4326008)(2906002)(53416004)(186003)(356004)(6666004)(53936002)(23676004)(50466002)(7696005)(76176011)(2870700001)(316002)(426003)(486006)(110136005)(2616005)(476003)(126002)(446003)(11346002)(50226002)(1076003)(36756003)(478600001)(8676002)(81166006)(81156014)(5660300002)(47776003)(70586007)(5820100001)(70206006)(8936002)(86362001)(77096007)(26005)(72206003)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0053; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3d39459-061f-43d9-37f3-08d6d9d59010 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328); SRVR:CY4PR1201MB0053; X-MS-TrafficTypeDiagnostic: CY4PR1201MB0053: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2043; X-Forefront-PRVS: 0039C6E5C5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: vTeKuYEP8iapE+iL6ZPHMmIlma/jiQB/2SUfMf19wVPf9zxe4QpJgk8vfdXIoPa7uMwZcD1+58j3N9lVu6B9ROjsxfPFV+FmBJvUdfidA7Z2yZ2PkuAFgzwtLo/gtuAA7fd7QVn9X9rLMHY4NAcVPiUF/lMr/lK8ScIULlSPli0RX7yL/vKzEKSOhSrAjRefplLJUeITK7LJrf8FFFyVnJWzM5tuZAhxzLwDfFg/9K54UFMj+gqhAPa+w2URjGb+H8N6XFNTzWvOMWoqYwzXuvBJo/r1dFKEmBEITrOQpUhy0z9xiXj94VdXhzCHkSlznNy8fMJyFxw/v3jehAJWoFqVV8BYOPMhKVIkbQku4TwoTJCwfm9vfLeHBRCOlclo1bqdo7wpjcL5Ny5DRzvdUnM7qXbTbjqmpv5bGoBX6tY= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2019 08:07:38.6716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3d39459-061f-43d9-37f3-08d6d9d59010 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: CY4PR1201MB0053 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=7dbko5WAdMGbIMIXiM5liwDe1ouAXfmmK+tTPp9O2aA=; b=EFGWAe6i70ghroTrjKWcwVanx0AEWjyLu1XRb7qLGP4k3g6PmpAJ71/DPhO67xBilH38gUxg/RLVGOw/h3yM/hlN6BLQI8Th2i2k9icfaadivzMQ3t2tjBgFG99cUTvJuAO4Hxs0cgFsi/YZbicaEl2iEKB0LggG1Dl8FQKhytY= 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 Acked-by: Christian König Acked-by: Lionel Landwerlin --- 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,