aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/1277-drm-amdkfd-Prepare-cleanup-of-KFD-ioctl-APIs.patch
blob: 898e7d2b3cd1237dcdc960b714333924f5ad899c (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
From f1577f1960ac515359d7b9cb7832087738e46a37 Mon Sep 17 00:00:00 2001
From: Felix Kuehling <Felix.Kuehling@amd.com>
Date: Fri, 18 Mar 2016 17:01:40 -0400
Subject: [PATCH 1277/4131] drm/amdkfd: Prepare cleanup of KFD ioctl APIs

* Remove deprecated APIs that were never upstreamed
* Add new alloc_memory_of_scratch argument structure
* Prepare removing _new suffix from the new APIs
* Prepare cleanup of memory allocation flags
* Fix 32-on-64 bit issues in some of the new APIs

This change does not break the ABI of currently used APIs. KFD and
Thunk can smoothly transition to using the non-new APIs. After that
we will make one ABI-breaking change that consolidates the ioctl number
space and memory allocation flags and fixes remaining 32-on-64-bit
issues.

Change-Id: Ib5d89db68d77f6227be63e2698fd1532ae6d39a2
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index c763103..b1c5750 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -1133,8 +1133,7 @@ kfd_ioctl_wait_events(struct file *filp, struct kfd_process *p, void *data)
 static int kfd_ioctl_alloc_scratch_memory(struct file *filep,
 					struct kfd_process *p, void *data)
 {
-	struct kfd_ioctl_alloc_memory_of_gpu_args *args =
-			(struct kfd_ioctl_alloc_memory_of_gpu_args *)data;
+	struct kfd_ioctl_alloc_memory_of_scratch_args *args = data;
 	struct kfd_process_device *pdd;
 	struct kfd_dev *dev;
 	long err;
@@ -1276,12 +1275,12 @@ static uint32_t kfd_convert_user_mem_alloction_flags(
 		goto out;
 	}
 	/* Allocate userptr BO */
-	if (userspace_flags & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR) {
+	if (userspace_flags & KFD_IOC_ALLOC_MEM_FLAGS_USERPTR_OLD) {
 		kernel_allocation_flags = ALLOC_MEM_FLAGS_USERPTR;
 		goto out;
 	}
 	/* Allocate doorbell BO */
-	if (userspace_flags & KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL) {
+	if (userspace_flags & KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL_OLD) {
 		kernel_allocation_flags = ALLOC_MEM_FLAGS_DOORBELL;
 		goto out;
 	}
@@ -1289,7 +1288,7 @@ static uint32_t kfd_convert_user_mem_alloction_flags(
 out:
 	if (userspace_flags & KFD_IOC_ALLOC_MEM_FLAGS_DGPU_AQL_QUEUE_MEM)
 		kernel_allocation_flags |= ALLOC_MEM_FLAGS_AQL_QUEUE_MEM;
-	if (userspace_flags & KFD_IOC_ALLOC_MEM_FLAGS_COHERENT)
+	if (userspace_flags & KFD_IOC_ALLOC_MEM_FLAGS_COHERENT_OLD)
 		kernel_allocation_flags |= ALLOC_MEM_FLAGS_COHERENT;
 	/* Current HW doesn't support non paged memory */
 	kernel_allocation_flags |= ALLOC_MEM_FLAGS_NONPAGED;
@@ -1331,7 +1330,7 @@ static int kfd_ioctl_alloc_memory_of_gpu_new(struct file *filep,
 	if (IS_ERR(pdd))
 		return PTR_ERR(pdd);
 
-	if (args->flags & KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL) {
+	if (args->flags & KFD_IOC_ALLOC_MEM_FLAGS_DOORBELL_OLD) {
 		if (args->size != kfd_doorbell_process_slice(dev))
 			return -EINVAL;
 		offset = kfd_get_process_doorbells(dev, p);
-- 
2.7.4