aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/1426-drm-amdgpu-don-t-add_bo_to_vm-in-import_dmabuf.patch
blob: cd8775cebcec5049d2c6600db0710ba196ada79b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 6f627e4104694ccddd4219a8fed4e5463ab2d0b5 Mon Sep 17 00:00:00 2001
From: Felix Kuehling <Felix.Kuehling@amd.com>
Date: Mon, 9 May 2016 17:55:30 -0400
Subject: [PATCH 1426/4131] drm/amdgpu: don't add_bo_to_vm in import_dmabuf

The BO is added to the VM with the proper BO and VM reservations in
map_memory_to_gpu. This fixes several kernel warnings from TTM during
import_dmabuf.

Change-Id: Ie92c6a22061d860e7257f3e2b86e2b2d97362f2c
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index df04747..6cf2ec2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -1395,7 +1395,7 @@ int amdgpu_amdkfd_gpuvm_import_dmabuf(struct kgd_dev *kgd, int dma_buf_fd,
 	struct dma_buf *dma_buf;
 	struct drm_gem_object *obj;
 	struct amdgpu_bo *bo;
-	int r = -EINVAL;
+	int r = 0;
 
 	dma_buf = dma_buf_get(dma_buf_fd);
 	if (IS_ERR(dma_buf))
@@ -1436,14 +1436,6 @@ int amdgpu_amdkfd_gpuvm_import_dmabuf(struct kgd_dev *kgd, int dma_buf_fd,
 		AMDGPU_GEM_DOMAIN_VRAM : AMDGPU_GEM_DOMAIN_GTT;
 	(*mem)->data2.mapped_to_gpu_memory = 0;
 
-	r = add_bo_to_vm(adev, *mem, vm, false, NULL);
-
-	if (r) {
-		amdgpu_bo_unref(&bo);
-		kfree(*mem);
-		*mem = NULL;
-	}
-
 out_put:
 	dma_buf_put(dma_buf);
 	return r;
-- 
2.7.4