summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Zhao <rizhao@nvidia.com>2018-01-25 14:20:31 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-26 17:21:21 -0500
commit1a9d4c1cfa5ad202f94c563ffa831b0ea726108d (patch)
treeabae14f0ecc5c03943c4941ee9ca5cc4dcce21d1
parent1a7484c901fe1abe0c35593ec96ff10e162099c4 (diff)
gpu: nvgpu: vgpu: remove virt_ctx from tegra_gr_comm
queue index can already index the queues. It also help make the api more common. Jira EVLR-2364 Change-Id: I98a5014ba0510a2687fdf096a160c497bd1f6985 Signed-off-by: Richard Zhao <rizhao@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1646197 Reviewed-by: Damian Halas <dhalas@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Nirav Patel <nipatel@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.c5
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c6
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.c3
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c7
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c15
5 files changed, 14 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.c
index dfdbe3ee..ce72fb03 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2018, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -42,8 +42,7 @@ int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s,
42 gk20a_dbg_fn(""); 42 gk20a_dbg_fn("");
43 BUG_ON(sizeof(*ops) != sizeof(struct tegra_vgpu_reg_op)); 43 BUG_ON(sizeof(*ops) != sizeof(struct tegra_vgpu_reg_op));
44 44
45 handle = tegra_gr_comm_oob_get_ptr(TEGRA_GR_COMM_CTX_CLIENT, 45 handle = tegra_gr_comm_oob_get_ptr(tegra_gr_comm_get_server_vmid(),
46 tegra_gr_comm_get_server_vmid(),
47 TEGRA_VGPU_QUEUE_CMD, 46 TEGRA_VGPU_QUEUE_CMD,
48 &oob, &oob_size); 47 &oob, &oob_size);
49 if (!handle) 48 if (!handle)
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c
index 6b8c630b..72e1190d 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Virtualized GPU Fifo 2 * Virtualized GPU Fifo
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -499,8 +499,8 @@ static int vgpu_submit_runlist(struct gk20a *g, u64 handle, u8 runlist_id,
499 void *oob; 499 void *oob;
500 size_t size, oob_size; 500 size_t size, oob_size;
501 501
502 oob_handle = tegra_gr_comm_oob_get_ptr(TEGRA_GR_COMM_CTX_CLIENT, 502 oob_handle = tegra_gr_comm_oob_get_ptr(tegra_gr_comm_get_server_vmid(),
503 tegra_gr_comm_get_server_vmid(), TEGRA_VGPU_QUEUE_CMD, 503 TEGRA_VGPU_QUEUE_CMD,
504 &oob, &oob_size); 504 &oob, &oob_size);
505 if (!oob_handle) 505 if (!oob_handle)
506 return -EINVAL; 506 return -EINVAL;
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.c
index 5e880261..5786783c 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.c
@@ -95,8 +95,7 @@ u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm,
95 } 95 }
96 } 96 }
97 97
98 handle = tegra_gr_comm_oob_get_ptr(TEGRA_GR_COMM_CTX_CLIENT, 98 handle = tegra_gr_comm_oob_get_ptr(tegra_gr_comm_get_server_vmid(),
99 tegra_gr_comm_get_server_vmid(),
100 TEGRA_VGPU_QUEUE_CMD, 99 TEGRA_VGPU_QUEUE_CMD,
101 (void **)&mem_desc, &oob_size); 100 (void **)&mem_desc, &oob_size);
102 if (!handle) { 101 if (!handle) {
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
index 8f1c5d78..34862702 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
@@ -1121,8 +1121,8 @@ static int vgpu_gr_suspend_resume_contexts(struct gk20a *g,
1121 nvgpu_mutex_acquire(&g->dbg_sessions_lock); 1121 nvgpu_mutex_acquire(&g->dbg_sessions_lock);
1122 nvgpu_mutex_acquire(&dbg_s->ch_list_lock); 1122 nvgpu_mutex_acquire(&dbg_s->ch_list_lock);
1123 1123
1124 handle = tegra_gr_comm_oob_get_ptr(TEGRA_GR_COMM_CTX_CLIENT, 1124 handle = tegra_gr_comm_oob_get_ptr(tegra_gr_comm_get_server_vmid(),
1125 tegra_gr_comm_get_server_vmid(), TEGRA_VGPU_QUEUE_CMD, 1125 TEGRA_VGPU_QUEUE_CMD,
1126 (void **)&oob, &oob_size); 1126 (void **)&oob, &oob_size);
1127 if (!handle) { 1127 if (!handle) {
1128 err = -EINVAL; 1128 err = -EINVAL;
@@ -1238,8 +1238,7 @@ int vgpu_gr_init_sm_id_table(struct gk20a *g)
1238 return err; 1238 return err;
1239 } 1239 }
1240 1240
1241 handle = tegra_gr_comm_oob_get_ptr(TEGRA_GR_COMM_CTX_CLIENT, 1241 handle = tegra_gr_comm_oob_get_ptr(tegra_gr_comm_get_server_vmid(),
1242 tegra_gr_comm_get_server_vmid(),
1243 TEGRA_VGPU_QUEUE_CMD, 1242 TEGRA_VGPU_QUEUE_CMD,
1244 (void **)&entry, &oob_size); 1243 (void **)&entry, &oob_size);
1245 if (!handle) 1244 if (!handle)
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c
index cdf3ef1c..3d5afcf9 100644
--- a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c
@@ -53,8 +53,7 @@ static inline int vgpu_comm_init(struct platform_device *pdev)
53{ 53{
54 size_t queue_sizes[] = { TEGRA_VGPU_QUEUE_SIZES }; 54 size_t queue_sizes[] = { TEGRA_VGPU_QUEUE_SIZES };
55 55
56 return tegra_gr_comm_init(pdev, TEGRA_GR_COMM_CTX_CLIENT, 3, 56 return tegra_gr_comm_init(pdev, 3, queue_sizes, TEGRA_VGPU_QUEUE_CMD,
57 queue_sizes, TEGRA_VGPU_QUEUE_CMD,
58 ARRAY_SIZE(queue_sizes)); 57 ARRAY_SIZE(queue_sizes));
59} 58}
60 59
@@ -62,8 +61,7 @@ static inline void vgpu_comm_deinit(void)
62{ 61{
63 size_t queue_sizes[] = { TEGRA_VGPU_QUEUE_SIZES }; 62 size_t queue_sizes[] = { TEGRA_VGPU_QUEUE_SIZES };
64 63
65 tegra_gr_comm_deinit(TEGRA_GR_COMM_CTX_CLIENT, TEGRA_VGPU_QUEUE_CMD, 64 tegra_gr_comm_deinit(TEGRA_VGPU_QUEUE_CMD, ARRAY_SIZE(queue_sizes));
66 ARRAY_SIZE(queue_sizes));
67} 65}
68 66
69int vgpu_comm_sendrecv(struct tegra_vgpu_cmd_msg *msg, size_t size_in, 67int vgpu_comm_sendrecv(struct tegra_vgpu_cmd_msg *msg, size_t size_in,
@@ -74,8 +72,7 @@ int vgpu_comm_sendrecv(struct tegra_vgpu_cmd_msg *msg, size_t size_in,
74 void *data = msg; 72 void *data = msg;
75 int err; 73 int err;
76 74
77 err = tegra_gr_comm_sendrecv(TEGRA_GR_COMM_CTX_CLIENT, 75 err = tegra_gr_comm_sendrecv(tegra_gr_comm_get_server_vmid(),
78 tegra_gr_comm_get_server_vmid(),
79 TEGRA_VGPU_QUEUE_CMD, &handle, &data, &size); 76 TEGRA_VGPU_QUEUE_CMD, &handle, &data, &size);
80 if (!err) { 77 if (!err) {
81 WARN_ON(size < size_out); 78 WARN_ON(size < size_out);
@@ -152,8 +149,7 @@ static int vgpu_intr_thread(void *dev_id)
152 size_t size; 149 size_t size;
153 int err; 150 int err;
154 151
155 err = tegra_gr_comm_recv(TEGRA_GR_COMM_CTX_CLIENT, 152 err = tegra_gr_comm_recv(TEGRA_VGPU_QUEUE_INTR, &handle,
156 TEGRA_VGPU_QUEUE_INTR, &handle,
157 (void **)&msg, &size, &sender); 153 (void **)&msg, &size, &sender);
158 if (err == -ETIME) 154 if (err == -ETIME)
159 continue; 155 continue;
@@ -229,8 +225,7 @@ static void vgpu_remove_support(struct gk20a *g)
229 g->mm.remove_support(&g->mm); 225 g->mm.remove_support(&g->mm);
230 226
231 msg.event = TEGRA_VGPU_EVENT_ABORT; 227 msg.event = TEGRA_VGPU_EVENT_ABORT;
232 err = tegra_gr_comm_send(TEGRA_GR_COMM_CTX_CLIENT, 228 err = tegra_gr_comm_send(TEGRA_GR_COMM_ID_SELF, TEGRA_VGPU_QUEUE_INTR,
233 TEGRA_GR_COMM_ID_SELF, TEGRA_VGPU_QUEUE_INTR,
234 &msg, sizeof(msg)); 229 &msg, sizeof(msg));
235 WARN_ON(err); 230 WARN_ON(err);
236 nvgpu_thread_stop(&priv->intr_handler); 231 nvgpu_thread_stop(&priv->intr_handler);