aboutsummaryrefslogtreecommitdiffstats
path: root/meta-v1000/recipes-kernel/linux/linux-yocto-4.14.71/1295-drm-amdkfd-Remove-deprecated-open_graphic_handle-ioc.patch
blob: 93c6e0552354eea21ec96effe46f2668c3aea80f (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From 6188bc491081c20339b96ef1950994dcfda89f65 Mon Sep 17 00:00:00 2001
From: Felix Kuehling <Felix.Kuehling@amd.com>
Date: Fri, 26 May 2017 15:16:43 -0400
Subject: [PATCH 1295/4131] drm/amdkfd: Remove deprecated open_graphic_handle
 ioctl

It was only implemented for Kaveri and was never upstreamed. There
are no open-source users of this interface. It has been superseded
by the pair of get_dmabuf_info and import_dmabuf, which is
implemented for all supported GPUs.

Change-Id: Ib93cb0a46103d4f507e9b66df3ecf33821f8975f
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 60 --------------------------------
 1 file changed, 60 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index fe7de4c..64a4373 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -1511,63 +1511,6 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep,
 	return err;
 }
 
-static int kfd_ioctl_open_graphic_handle(struct file *filep,
-					struct kfd_process *p,
-					void *data)
-{
-	struct kfd_ioctl_open_graphic_handle_args *args = data;
-	struct kfd_dev *dev;
-	struct kfd_process_device *pdd;
-	void *mem;
-	int idr_handle;
-	long err;
-
-	dev = kfd_device_by_id(args->gpu_id);
-	if (!dev)
-		return -EINVAL;
-
-	if (dev->device_info->asic_family != CHIP_KAVERI) {
-		pr_debug("kfd_ioctl_open_graphic_handle only supported on KV\n");
-		return -EINVAL;
-	}
-
-	down_write(&p->lock);
-	pdd = kfd_bind_process_to_device(dev, p);
-	up_write(&p->lock);
-	if (IS_ERR(pdd))
-		return PTR_ERR(pdd);
-
-	err = dev->kfd2kgd->open_graphic_handle(dev->kgd,
-			args->va_addr,
-			(struct kgd_vm *) pdd->vm,
-			args->graphic_device_fd,
-			args->graphic_handle,
-			(struct kgd_mem **) &mem);
-
-	if (err != 0)
-		return err;
-
-	down_write(&p->lock);
-	/*TODO: When open_graphic_handle is implemented, we need to create
-	 * the corresponding interval tree. We need to know the size of
-	 * the buffer through open_graphic_handle(). We use 1 for now.
-	 */
-	idr_handle = kfd_process_device_create_obj_handle(pdd, mem,
-			args->va_addr, 1, NULL);
-	up_write(&p->lock);
-	if (idr_handle < 0) {
-		/* FIXME: destroy_process_gpumem doesn't seem to be
-		 * implemented anywhere
-		 */
-		dev->kfd2kgd->destroy_process_gpumem(dev->kgd, mem);
-		return -EFAULT;
-	}
-
-	args->handle = MAKE_HANDLE(args->gpu_id, idr_handle);
-
-	return 0;
-}
-
 static int kfd_ioctl_set_process_dgpu_aperture(struct file *filep,
 		struct kfd_process *p, void *data)
 {
@@ -2084,9 +2027,6 @@ static const struct amdkfd_ioctl_desc amdkfd_ioctls[] = {
 	AMDKFD_IOCTL_DEF(AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU,
 			kfd_ioctl_unmap_memory_from_gpu, 0),
 
-	AMDKFD_IOCTL_DEF(AMDKFD_IOC_OPEN_GRAPHIC_HANDLE,
-			kfd_ioctl_open_graphic_handle, 0),
-
 	AMDKFD_IOCTL_DEF(AMDKFD_IOC_ALLOC_MEMORY_OF_SCRATCH,
 			kfd_ioctl_alloc_scratch_memory, 0),
 
-- 
2.7.4