From patchwork Tue Dec 12 09:33:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10106559 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E91E5602B3 for ; Tue, 12 Dec 2017 09:34:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFE1529B66 for ; Tue, 12 Dec 2017 09:34:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D28E529B69; Tue, 12 Dec 2017 09:34:38 +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=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 0F86229B66 for ; Tue, 12 Dec 2017 09:34:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7EB136E352; Tue, 12 Dec 2017 09:34:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0052.outbound.protection.outlook.com [104.47.36.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id CD2A06E352; Tue, 12 Dec 2017 09:34:35 +0000 (UTC) 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; bh=IePnkIFdszqyPKnVsS9cmIB2+fy6m9YhQUBETr3Kk6c=; b=rlcGs/ardyRU1OpwSXda7ioEjNA/yylOdZWiAjgRAbotb0eVDCS1eMqZzoI3uD7dV1a/F/a+XGVcm2AP8jseBBtHE2i0HMxwHpT9ycy2G2mWc83QfjFC14RJhldtfDGnJt03tAQCxN/OgLMtdU+Z5AbwrvHjN7CNO/c+LkobZVM= Received: from BN4PR12CA0011.namprd12.prod.outlook.com (10.164.241.21) by MWHPR12MB1454.namprd12.prod.outlook.com (10.172.55.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 09:34:33 +0000 Received: from CO1NAM03FT028.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::207) by BN4PR12CA0011.outlook.office365.com (2603:10b6:403:2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.239.5 via Frontend Transport; Tue, 12 Dec 2017 09:34:33 +0000 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; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT028.mail.protection.outlook.com (10.152.80.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.302.6 via Frontend Transport; Tue, 12 Dec 2017 09:34:33 +0000 Received: from roger-build-server.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.361.1; Tue, 12 Dec 2017 03:34:28 -0600 From: Roger He To: , Subject: [PATCH 3/6] drm/ttm: use an ttm operation ctx for ttm_bo_move_xxx Date: Tue, 12 Dec 2017 17:33:45 +0800 Message-ID: <1513071228-29551-3-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513071228-29551-1-git-send-email-Hongbo.He@amd.com> References: <1513071228-29551-1-git-send-email-Hongbo.He@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)(7966004)(376002)(346002)(39860400002)(2980300002)(428003)(189003)(199004)(508600001)(8936002)(68736007)(48376002)(356003)(305945005)(50226002)(77096006)(2906002)(7696005)(81156014)(8676002)(72206003)(76176011)(36756003)(51416003)(81166006)(104016004)(47776003)(575784001)(86362001)(16586007)(110136005)(53936002)(4326008)(97736004)(450100002)(50466002)(5660300001)(316002)(6666003)(2950100002)(106466001)(105586002)(53416004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1454; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT028; 1:+NDCYrbUaNR+uh9wCEni0ynR5n/7CzMPCX71zLy0D8pmQYzc1s7PhYHAfARtstAuDjY6pySG4v6sqAOTci0MHW1PObJQQNqxmQ5fOE1KveoHSiZhLt/pQ16Q7h7Ay8lx X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15770337-4099-4ed9-ea3a-08d541438d50 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:MWHPR12MB1454; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1454; 3:v56gHb18IQSaFXd/fYOTStuf6YRHvw6rY34HVg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+71OeHcRJY7L8KlkXSVJIXR8pOhdNYmihz8wY4o2lMCj3mTIg2CUEfU8V+n2f+0jX9H3UIYFzmgllwyr9y+YLqY7bSs20TKEZZn22IdNYZnR6LDbd1ri4HecL2XKv5qSPkN7yvJXFKlEym0HiJl6IwI4yeFsK0QWZbcz4RGDGzeVxt+5LFugETvK51DAP0yFnOWW7HKMr8dVVY0APOzwJvKA93oO6aCfLmwXg6NdYlqYdad+CrIqrRg4t9NccjD5aDFHX7vDY7ITW6ShaZ4enO5A5ZEOVJO+gc14Q99HRvCBaM0UEmBrt6qo6pEG39ZTWyA6Mi/TBMyCSb5JvV2zC3zRc/Ba3KiHyVT093JmgznR5vxHqd5Esr7tP7xdSLiNtXo3ntlI3ZoG54OQkHJHNQNxg79WVs X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93003095)(10201501046)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201703011903075)(201702281528075)(201703061421075)(6072148)(201708071742011); SRVR:MWHPR12MB1454; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR12MB1454; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1454; 4:ffzD9g+TjNhAlVYa3Pp8tCIo+DbgI9pF/YJMeAf3UEj3hIojVVM/nEbU+kuRgGExEzRj6OpV/CAiPbo1RM4PH+Vji4DbJuQtlw0/zOPHeviiONP9l0lxcoRLBLz2jYxylHU+Hqj0Qm4EcM24I1/+Rnbf4x/f0mXbM6AoaZkJ3iNWeeYxwavlHoBP3yzJxAIg8IwoeWVJphiERSH9f9mDpoANEmLw9aGk+huDZ+v5zgPNbGG2gRVjFrtxDi3rQ5dr0gCIYp8jAsMfKTC8eIQ6wIF+0JjlAH2a7PH+0Q3cSeyspzPrW+ypCYmIhq5thOec X-Forefront-PRVS: 051900244E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1454; 23:zM8cbGzbgIjuFaLyAXy/umRzuoGDquAVTCdJXyeo8?= =?us-ascii?Q?awMoS4oxb23pZjKBKl7wQ2qy/j7hE/FKaXtPzjT8tRHA0ymG3/omcLat1OQ5?= =?us-ascii?Q?8rRCq4D2c6i9a4J1uv4DNYl28sX6h/6z2fpjW30ksC1RE7WGn7pqU4GdkYu4?= =?us-ascii?Q?Stik5s+T526iG54Z1SQsMYfoszBZ5gcLeTxRnLD3eVCaJrGqerKuCOn6MIFt?= =?us-ascii?Q?7iWqehkioyRe87KapIqJN66LyAxbEsS8RUB/buD8fQ/YAUYPirNHnrHpALbz?= =?us-ascii?Q?gOzUjhsqjLiYheDrmzUR/RM3mVVFKaOlCTNgek6ToKTD1p3iTHMQ5WkNuFvm?= =?us-ascii?Q?skezeX6HxjL0OsIl42Kp442yHRNlVvKKYxAhzs8eUViNSgrSKDmAhzHFi1XV?= =?us-ascii?Q?1H4gvrU30lmiPPG4pdQleKhgKZZ1L3wmRgEF4AmZef5Sirpj8Qs0e9IwmuxD?= =?us-ascii?Q?axo9DkKw+GOgWui8LvTjgIr10/yXFOU2jU5VEfJBNphGX3js1O/yml4VWqMT?= =?us-ascii?Q?dPml1JOQGsuvU7IZWkgswCRe+lgpUdnJZnj1OqLU8VW+2K3uA3cXQprP4dhw?= =?us-ascii?Q?+0KUN/NFZrX1xx6p2NVl6EMDYnXTTg0M4HzSRZAklkfdtDhTnK8A+rOUtnbL?= =?us-ascii?Q?pCsLfC8PyacRfYR1woRv7W95in9oLz3GRoEgzA/CQZc4zm6vDTFMODEHsi/j?= =?us-ascii?Q?fNpteQDSLvRpNRd5+6YkT3jDLaEl6RfxsjkgUAfq56jrpsDG9h8H13bVnKGo?= =?us-ascii?Q?+Xs/o9bbaDwlOSYufiJUSwHTX4A5R6+6a7VEfGWkvH7AsekYF0skc79GfjNb?= =?us-ascii?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mo4nWvJo+oDyRWvneohVT7pl7zPqoHwaWuLGxA299Q62rkC1c7ap7BmbwAOl/yLtnAyIDlEFIUPBW4cPuxAZ9uUNRPq1VqfIrVGPys+NPumzPp9jP1DjmwEHTiDhOdkgdrXO6HhK3z SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1454; 20:K3zSMubuesujAezwcguo9CllEtEvdOqd00FbAsQ7POJ3GgLUqlsnHpZqIf32AyAZTJI0Ed8tma7ooDPz8d2gV/Gbn6COQFzOWNBz5uZyhy3ql5rZqp8Sces79SpbrrbL57Hk1/ip/UEapHv0iq6KUUQUHaEH+wVZcHgvCT4d/dCzTu6FHJd/jgzmOyCfC7LRDBP8qMjmFqQVmLY80uEctIf/KBOg1Bj5RUJEtIuuT8qo0HLHkMp7sU/qJhCl8NMN X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 09:34:33.0422 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15770337-4099-4ed9-ea3a-08d541438d50 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1454 Cc: Roger He X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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 include ttm_bo_move_memcpy and ttm_bo_move_ttm Change-Id: I160b2fe1da3200405810d0215c4521b5f0d3615a Signed-off-by: Roger He Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 7 +++---- drivers/gpu/drm/nouveau/nouveau_bo.c | 7 +++---- drivers/gpu/drm/qxl/qxl_ttm.c | 3 +-- drivers/gpu/drm/radeon/radeon_ttm.c | 7 +++---- drivers/gpu/drm/ttm/ttm_bo.c | 6 ++---- drivers/gpu/drm/ttm/ttm_bo_util.c | 8 ++++---- include/drm/ttm/ttm_bo_driver.h | 4 ++-- 7 files changed, 18 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 7db9556..c307a7d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -505,7 +505,7 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict, if (unlikely(r)) { goto out_cleanup; } - r = ttm_bo_move_ttm(bo, ctx->interruptible, ctx->no_wait_gpu, new_mem); + r = ttm_bo_move_ttm(bo, ctx, new_mem); out_cleanup: ttm_bo_mem_put(bo, &tmp_mem); return r; @@ -536,7 +536,7 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict, if (unlikely(r)) { return r; } - r = ttm_bo_move_ttm(bo, ctx->interruptible, ctx->no_wait_gpu, &tmp_mem); + r = ttm_bo_move_ttm(bo, ctx, &tmp_mem); if (unlikely(r)) { goto out_cleanup; } @@ -597,8 +597,7 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict, if (r) { memcpy: - r = ttm_bo_move_memcpy(bo, ctx->interruptible, - ctx->no_wait_gpu, new_mem); + r = ttm_bo_move_memcpy(bo, ctx, new_mem); if (r) { return r; } diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 949bf6b..6b6fb20 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1226,7 +1226,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr, if (ret) goto out; - ret = ttm_bo_move_ttm(bo, intr, no_wait_gpu, new_reg); + ret = ttm_bo_move_ttm(bo, &ctx, new_reg); out: ttm_bo_mem_put(bo, &tmp_reg); return ret; @@ -1255,7 +1255,7 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr, if (ret) return ret; - ret = ttm_bo_move_ttm(bo, intr, no_wait_gpu, &tmp_reg); + ret = ttm_bo_move_ttm(bo, &ctx, &tmp_reg); if (ret) goto out; @@ -1380,8 +1380,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, /* Fallback to software copy. */ ret = ttm_bo_wait(bo, ctx->interruptible, ctx->no_wait_gpu); if (ret == 0) - ret = ttm_bo_move_memcpy(bo, ctx->interruptible, - ctx->no_wait_gpu, new_reg); + ret = ttm_bo_move_memcpy(bo, ctx, new_reg); out: if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) { diff --git a/drivers/gpu/drm/qxl/qxl_ttm.c b/drivers/gpu/drm/qxl/qxl_ttm.c index d866f32..78ce118 100644 --- a/drivers/gpu/drm/qxl/qxl_ttm.c +++ b/drivers/gpu/drm/qxl/qxl_ttm.c @@ -357,8 +357,7 @@ static int qxl_bo_move(struct ttm_buffer_object *bo, bool evict, qxl_move_null(bo, new_mem); return 0; } - return ttm_bo_move_memcpy(bo, ctx->interruptible, ctx->no_wait_gpu, - new_mem); + return ttm_bo_move_memcpy(bo, ctx, new_mem); } static void qxl_bo_move_notify(struct ttm_buffer_object *bo, diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 98e30d7..557fd79 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -347,7 +347,7 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo, if (unlikely(r)) { goto out_cleanup; } - r = ttm_bo_move_ttm(bo, interruptible, no_wait_gpu, new_mem); + r = ttm_bo_move_ttm(bo, &ctx, new_mem); out_cleanup: ttm_bo_mem_put(bo, &tmp_mem); return r; @@ -380,7 +380,7 @@ static int radeon_move_ram_vram(struct ttm_buffer_object *bo, if (unlikely(r)) { return r; } - r = ttm_bo_move_ttm(bo, interruptible, no_wait_gpu, &tmp_mem); + r = ttm_bo_move_ttm(bo, &ctx, &tmp_mem); if (unlikely(r)) { goto out_cleanup; } @@ -445,8 +445,7 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, if (r) { memcpy: - r = ttm_bo_move_memcpy(bo, ctx->interruptible, - ctx->no_wait_gpu, new_mem); + r = ttm_bo_move_memcpy(bo, ctx, new_mem); if (r) { return r; } diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 70b2673..17fe8be 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -324,13 +324,11 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, if (!(old_man->flags & TTM_MEMTYPE_FLAG_FIXED) && !(new_man->flags & TTM_MEMTYPE_FLAG_FIXED)) - ret = ttm_bo_move_ttm(bo, ctx->interruptible, - ctx->no_wait_gpu, mem); + ret = ttm_bo_move_ttm(bo, ctx, mem); else if (bdev->driver->move) ret = bdev->driver->move(bo, evict, ctx, mem); else - ret = ttm_bo_move_memcpy(bo, ctx->interruptible, - ctx->no_wait_gpu, mem); + ret = ttm_bo_move_memcpy(bo, ctx, mem); if (ret) { if (bdev->driver->move_notify) { diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index e7a519f..9237099 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -45,7 +45,7 @@ void ttm_bo_free_old_node(struct ttm_buffer_object *bo) } int ttm_bo_move_ttm(struct ttm_buffer_object *bo, - bool interruptible, bool no_wait_gpu, + struct ttm_operation_ctx *ctx, struct ttm_mem_reg *new_mem) { struct ttm_tt *ttm = bo->ttm; @@ -53,7 +53,7 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo, int ret; if (old_mem->mem_type != TTM_PL_SYSTEM) { - ret = ttm_bo_wait(bo, interruptible, no_wait_gpu); + ret = ttm_bo_wait(bo, ctx->interruptible, ctx->no_wait_gpu); if (unlikely(ret != 0)) { if (ret != -ERESTARTSYS) @@ -329,7 +329,7 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, } int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, - bool interruptible, bool no_wait_gpu, + struct ttm_operation_ctx *ctx, struct ttm_mem_reg *new_mem) { struct ttm_bo_device *bdev = bo->bdev; @@ -345,7 +345,7 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, unsigned long add = 0; int dir; - ret = ttm_bo_wait(bo, interruptible, no_wait_gpu); + ret = ttm_bo_wait(bo, ctx->interruptible, ctx->no_wait_gpu); if (ret) return ret; diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 6996d88..5115718 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -976,7 +976,7 @@ void ttm_mem_io_free(struct ttm_bo_device *bdev, */ int ttm_bo_move_ttm(struct ttm_buffer_object *bo, - bool interruptible, bool no_wait_gpu, + struct ttm_operation_ctx *ctx, struct ttm_mem_reg *new_mem); /** @@ -998,7 +998,7 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo, */ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, - bool interruptible, bool no_wait_gpu, + struct ttm_operation_ctx *ctx, struct ttm_mem_reg *new_mem); /**