aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1191-drm-amdgpu-Modify-create_process_vm-interface.patch
blob: fbca22d6f9dc438696da8041f375c5329d7692c1 (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
From 948f95763f9a332aed04302d31147fe573fd4564 Mon Sep 17 00:00:00 2001
From: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Date: Mon, 27 Jun 2016 15:30:45 -0400
Subject: [PATCH 1191/4131] drm/amdgpu: Modify create_process_vm interface

Modify create_process_vm to accommodate master VM. KFD process chooses
the VM of the first device detected to be the master VM. This
information is passed on to KGD via create_process_interface.

Change-Id: I8b5fd102f1f598673af0c936b718b1d7d8d235a3
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_priv.h    | 2 ++
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index cabf0fe..887d6c3 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -669,6 +669,8 @@ struct kfd_process {
 	size_t debug_event_count;
 
 	struct rb_root bo_interval_tree;
+
+	void *master_vm;
 };
 
 /**
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index c98b5da..87dd412 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -733,12 +733,15 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_dev *dev,
 		idr_init(&pdd->alloc_idr);
 
 		/* Create the GPUVM context for this specific device */
-		if (dev->kfd2kgd->create_process_vm(dev->kgd, &pdd->vm)) {
+		if (dev->kfd2kgd->create_process_vm(dev->kgd, &pdd->vm,
+						    p->master_vm)) {
 			pr_err("Failed to create process VM object\n");
 			list_del(&pdd->per_device_list);
 			kfree(pdd);
 			pdd = NULL;
 		}
+		if (p->master_vm == NULL)
+			p->master_vm = pdd->vm;
 	}
 
 	return pdd;
-- 
2.7.4