summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-11-14 09:43:28 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-17 11:27:19 -0500
commitb42fb7ba26b565f93118fbdd9e17b42ee6144c5e (patch)
tree26e2d919f019d15b51bba4d7b5c938f77ad5cff5
parentb7cc3a2aa6c92a09eed43513287c9062f22ad127 (diff)
gpu: nvgpu: move vgpu code to linux
Most of VGPU code is linux specific but lies in common code So until VGPU code is properly abstracted and made os-independent, move all of VGPU code to linux specific directory Handle corresponding Makefile changes Update all #includes to reflect new paths Add GPL license to newly added linux files Jira NVGPU-387 Change-Id: Ic133e4c80e570bcc273f0dacf45283fefd678923 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1599472 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/Makefile50
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/ce2_vgpu.c45
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/clk_vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/clk_vgpu.c)28
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/clk_vgpu.h27
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/css_vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/css_vgpu.c)28
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/css_vgpu.h34
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/dbg_vgpu.c)24
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.h41
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/fecs_trace_vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c)24
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/fecs_trace_vgpu.h41
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/fifo_vgpu.c)28
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h (renamed from drivers/gpu/nvgpu/vgpu/fifo_vgpu.h)24
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_gr_gm20b.c (renamed from drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c)26
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_gr_gm20b.h25
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_hal_gm20b.c (renamed from drivers/gpu/nvgpu/vgpu/gm20b/vgpu_hal_gm20b.c)40
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_fifo_gp10b.c24
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.c (renamed from drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c)28
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.h39
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c (renamed from drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c)42
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.c (renamed from drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c)26
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.h39
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/gr_vgpu.c)28
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.h (renamed from drivers/gpu/nvgpu/vgpu/gr_vgpu.h)24
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c (renamed from drivers/gpu/nvgpu/vgpu/gv11b/platform_gv11b_vgpu_tegra.c)26
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_fifo_gv11b.c (renamed from drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c)26
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_fifo_gv11b.h25
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gr_gv11b.c34
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gr_gv11b.h24
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gv11b.c (renamed from drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.c)5
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gv11b.h (renamed from drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.h)3
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c (renamed from drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c)49
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_subctx_gv11b.c (renamed from drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c)28
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_subctx_gv11b.h25
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_tsg_gv11b.c53
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_tsg_gv11b.h23
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/ltc_vgpu.c61
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/ltc_vgpu.h27
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/mm_vgpu.c)28
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.h50
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/platform_vgpu_tegra.c (renamed from drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c)28
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/sysfs_vgpu.c49
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/tsg_vgpu.c)24
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c (renamed from drivers/gpu/nvgpu/vgpu/vgpu.c)32
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h (renamed from drivers/gpu/nvgpu/vgpu/vgpu.h)24
-rw-r--r--drivers/gpu/nvgpu/common/linux/vgpu/vgpu_t19x.h30
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/vgpu/ce2_vgpu.c51
-rw-r--r--drivers/gpu/nvgpu/vgpu/clk_vgpu.h33
-rw-r--r--drivers/gpu/nvgpu/vgpu/css_vgpu.h40
-rw-r--r--drivers/gpu/nvgpu/vgpu/dbg_vgpu.h47
-rw-r--r--drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.h47
-rw-r--r--drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.h31
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fifo_gp10b.c30
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.h45
-rw-r--r--drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.h45
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.h31
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c41
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.h30
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.h31
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_tsg_gv11b.c59
-rw-r--r--drivers/gpu/nvgpu/vgpu/gv11b/vgpu_tsg_gv11b.h29
-rw-r--r--drivers/gpu/nvgpu/vgpu/ltc_vgpu.c67
-rw-r--r--drivers/gpu/nvgpu/vgpu/ltc_vgpu.h33
-rw-r--r--drivers/gpu/nvgpu/vgpu/mm_vgpu.h56
-rw-r--r--drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c55
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu_t19x.h36
66 files changed, 1000 insertions, 1247 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile
index e37d18b8..f8253e41 100644
--- a/drivers/gpu/nvgpu/Makefile
+++ b/drivers/gpu/nvgpu/Makefile
@@ -152,21 +152,21 @@ nvgpu-$(CONFIG_GK20A_PCI) += common/linux/pci.o
152nvgpu-$(CONFIG_TEGRA_GK20A_NVHOST) += common/linux/nvhost.o 152nvgpu-$(CONFIG_TEGRA_GK20A_NVHOST) += common/linux/nvhost.o
153 153
154nvgpu-$(CONFIG_TEGRA_GR_VIRTUALIZATION) += \ 154nvgpu-$(CONFIG_TEGRA_GR_VIRTUALIZATION) += \
155 gk20a/platform_vgpu_tegra.o \ 155 common/linux/vgpu/platform_vgpu_tegra.o \
156 vgpu/ltc_vgpu.o \ 156 common/linux/vgpu/ltc_vgpu.o \
157 vgpu/gr_vgpu.o \ 157 common/linux/vgpu/gr_vgpu.o \
158 vgpu/fifo_vgpu.o \ 158 common/linux/vgpu/fifo_vgpu.o \
159 vgpu/ce2_vgpu.o \ 159 common/linux/vgpu/ce2_vgpu.o \
160 vgpu/mm_vgpu.o \ 160 common/linux/vgpu/mm_vgpu.o \
161 vgpu/vgpu.o \ 161 common/linux/vgpu/vgpu.o \
162 vgpu/dbg_vgpu.o \ 162 common/linux/vgpu/dbg_vgpu.o \
163 vgpu/fecs_trace_vgpu.o \ 163 common/linux/vgpu/fecs_trace_vgpu.o \
164 vgpu/tsg_vgpu.o \ 164 common/linux/vgpu/tsg_vgpu.o \
165 vgpu/clk_vgpu.o \ 165 common/linux/vgpu/clk_vgpu.o \
166 vgpu/css_vgpu.o \ 166 common/linux/vgpu/css_vgpu.o \
167 vgpu/gm20b/vgpu_hal_gm20b.o \ 167 common/linux/vgpu/gm20b/vgpu_hal_gm20b.o \
168 vgpu/gm20b/vgpu_gr_gm20b.o \ 168 common/linux/vgpu/gm20b/vgpu_gr_gm20b.o \
169 vgpu/sysfs_vgpu.o 169 common/linux/vgpu/sysfs_vgpu.o
170 170
171nvgpu-$(CONFIG_COMMON_CLK) += \ 171nvgpu-$(CONFIG_COMMON_CLK) += \
172 common/linux/clk.o 172 common/linux/clk.o
@@ -246,9 +246,9 @@ nvgpu-y += \
246nvgpu-$(CONFIG_TEGRA_GK20A) += common/linux/platform_gp10b_tegra.o 246nvgpu-$(CONFIG_TEGRA_GK20A) += common/linux/platform_gp10b_tegra.o
247 247
248nvgpu-$(CONFIG_TEGRA_GR_VIRTUALIZATION) += \ 248nvgpu-$(CONFIG_TEGRA_GR_VIRTUALIZATION) += \
249 vgpu/gp10b/vgpu_hal_gp10b.o \ 249 common/linux/vgpu/gp10b/vgpu_hal_gp10b.o \
250 vgpu/gp10b/vgpu_gr_gp10b.o \ 250 common/linux/vgpu/gp10b/vgpu_gr_gp10b.o \
251 vgpu/gp10b/vgpu_mm_gp10b.o 251 common/linux/vgpu/gp10b/vgpu_mm_gp10b.o
252endif 252endif
253 253
254ifeq ($(CONFIG_ARCH_TEGRA_19x_SOC),y) 254ifeq ($(CONFIG_ARCH_TEGRA_19x_SOC),y)
@@ -290,11 +290,11 @@ nvgpu-$(CONFIG_TEGRA_GK20A) += gv11b/platform_gv11b_tegra.o
290nvgpu-$(CONFIG_TEGRA_GK20A_NVHOST) += common/linux/nvhost_t19x.o 290nvgpu-$(CONFIG_TEGRA_GK20A_NVHOST) += common/linux/nvhost_t19x.o
291 291
292nvgpu-$(CONFIG_TEGRA_GR_VIRTUALIZATION) += \ 292nvgpu-$(CONFIG_TEGRA_GR_VIRTUALIZATION) += \
293 vgpu/gv11b/platform_gv11b_vgpu_tegra.o \ 293 common/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.o \
294 vgpu/gv11b/vgpu_gv11b.o \ 294 common/linux/vgpu/gv11b/vgpu_gv11b.o \
295 vgpu/gv11b/vgpu_hal_gv11b.o \ 295 common/linux/vgpu/gv11b/vgpu_hal_gv11b.o \
296 vgpu/gv11b/vgpu_gr_gv11b.o \ 296 common/linux/vgpu/gv11b/vgpu_gr_gv11b.o \
297 vgpu/gv11b/vgpu_fifo_gv11b.o \ 297 common/linux/vgpu/gv11b/vgpu_fifo_gv11b.o \
298 vgpu/gv11b/vgpu_subctx_gv11b.o \ 298 common/linux/vgpu/gv11b/vgpu_subctx_gv11b.o \
299 vgpu/gv11b/vgpu_tsg_gv11b.o 299 common/linux/vgpu/gv11b/vgpu_tsg_gv11b.o
300endif 300endif
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/ce2_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/ce2_vgpu.c
new file mode 100644
index 00000000..ffb85f16
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/ce2_vgpu.c
@@ -0,0 +1,45 @@
1/*
2 * Virtualized GPU CE2
3 *
4 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
5 *
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,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "vgpu.h"
20
21#include <nvgpu/bug.h>
22
23int vgpu_ce2_nonstall_isr(struct gk20a *g,
24 struct tegra_vgpu_ce2_nonstall_intr_info *info)
25{
26 gk20a_dbg_fn("");
27
28 switch (info->type) {
29 case TEGRA_VGPU_CE2_NONSTALL_INTR_NONBLOCKPIPE:
30 gk20a_channel_semaphore_wakeup(g, true);
31 break;
32 default:
33 WARN_ON(1);
34 break;
35 }
36
37 return 0;
38}
39
40u32 vgpu_ce_get_num_pce(struct gk20a *g)
41{
42 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
43
44 return priv->constants.num_pce;
45}
diff --git a/drivers/gpu/nvgpu/vgpu/clk_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/clk_vgpu.c
index e4ad8f68..bcdf8ee9 100644
--- a/drivers/gpu/nvgpu/vgpu/clk_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/clk_vgpu.c
@@ -3,27 +3,21 @@
3 * 3 *
4 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#include "vgpu/vgpu.h" 19#include "vgpu.h"
26#include "vgpu/clk_vgpu.h" 20#include "clk_vgpu.h"
27 21
28static unsigned long 22static unsigned long
29vgpu_freq_table[TEGRA_VGPU_GPU_FREQ_TABLE_SIZE]; 23vgpu_freq_table[TEGRA_VGPU_GPU_FREQ_TABLE_SIZE];
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/clk_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/clk_vgpu.h
new file mode 100644
index 00000000..8d477643
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/clk_vgpu.h
@@ -0,0 +1,27 @@
1/*
2 * Virtualized GPU Clock Interface
3 *
4 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
5 *
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,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef _CLK_VIRT_H_
20#define _CLK_VIRT_H_
21
22void vgpu_init_clk_support(struct gk20a *g);
23long vgpu_clk_round_rate(struct device *dev, unsigned long rate);
24int vgpu_clk_get_freqs(struct device *dev,
25 unsigned long **freqs, int *num_freqs);
26int vgpu_clk_cap_rate(struct device *dev, unsigned long rate);
27#endif
diff --git a/drivers/gpu/nvgpu/vgpu/css_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/css_vgpu.c
index 7362fc6f..fba3cc63 100644
--- a/drivers/gpu/nvgpu/vgpu/css_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/css_vgpu.c
@@ -1,23 +1,17 @@
1/* 1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22#if defined(CONFIG_GK20A_CYCLE_STATS) 16#if defined(CONFIG_GK20A_CYCLE_STATS)
23 17
@@ -29,8 +23,8 @@
29#include "gk20a/channel_gk20a.h" 23#include "gk20a/channel_gk20a.h"
30#include "gk20a/css_gr_gk20a.h" 24#include "gk20a/css_gr_gk20a.h"
31#include "common/linux/platform_gk20a.h" 25#include "common/linux/platform_gk20a.h"
32#include "vgpu.h" 26#include "common/linux/vgpu/vgpu.h"
33#include "css_vgpu.h" 27#include "common/linux/vgpu/css_vgpu.h"
34 28
35static struct tegra_hv_ivm_cookie *css_cookie; 29static struct tegra_hv_ivm_cookie *css_cookie;
36 30
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/css_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/css_vgpu.h
new file mode 100644
index 00000000..df95e775
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/css_vgpu.h
@@ -0,0 +1,34 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _CSS_VGPU_H_
18#define _CSS_VGPU_H_
19
20#include <nvgpu/types.h>
21
22struct gr_gk20a;
23struct channel_gk20a;
24struct gk20a_cs_snapshot_client;
25
26void vgpu_css_release_snapshot_buffer(struct gr_gk20a *gr);
27int vgpu_css_flush_snapshots(struct channel_gk20a *ch,
28 u32 *pending, bool *hw_overflow);
29int vgpu_css_detach(struct channel_gk20a *ch,
30 struct gk20a_cs_snapshot_client *cs_client);
31int vgpu_css_enable_snapshot_buffer(struct channel_gk20a *ch,
32 struct gk20a_cs_snapshot_client *cs_client);
33u32 vgpu_css_get_buffer_size(struct gk20a *g);
34#endif
diff --git a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.c
index 4879c2eb..06ef43b8 100644
--- a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.c
@@ -1,23 +1,17 @@
1/* 1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include <linux/tegra_gr_comm.h> 17#include <linux/tegra_gr_comm.h>
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.h
new file mode 100644
index 00000000..8552a82e
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/dbg_vgpu.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _DBG_VGPU_H_
18#define _DBG_VGPU_H_
19
20struct dbg_session_gk20a;
21struct nvgpu_dbg_gpu_reg_op;
22struct dbg_profiler_object_data;
23struct gk20a;
24
25int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s,
26 struct nvgpu_dbg_gpu_reg_op *ops,
27 u64 num_ops);
28int vgpu_dbg_set_powergate(struct dbg_session_gk20a *dbg_s, bool disable_powergate);
29bool vgpu_check_and_set_global_reservation(
30 struct dbg_session_gk20a *dbg_s,
31 struct dbg_profiler_object_data *prof_obj);
32bool vgpu_check_and_set_context_reservation(
33 struct dbg_session_gk20a *dbg_s,
34 struct dbg_profiler_object_data *prof_obj);
35
36void vgpu_release_profiler_reservation(
37 struct dbg_session_gk20a *dbg_s,
38 struct dbg_profiler_object_data *prof_obj);
39int vgpu_perfbuffer_enable(struct gk20a *g, u64 offset, u32 size);
40int vgpu_perfbuffer_disable(struct gk20a *g);
41#endif
diff --git a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/fecs_trace_vgpu.c
index dc7608ff..5007de36 100644
--- a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/fecs_trace_vgpu.c
@@ -1,23 +1,17 @@
1/* 1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include <linux/string.h> 17#include <linux/string.h>
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/fecs_trace_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/fecs_trace_vgpu.h
new file mode 100644
index 00000000..c375b841
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/fecs_trace_vgpu.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __FECS_TRACE_VGPU_H
18#define __FECS_TRACE_VGPU_H
19
20#include <nvgpu/types.h>
21
22struct gk20a;
23struct vm_area_struct;
24struct nvgpu_ctxsw_trace_filter;
25
26void vgpu_fecs_trace_data_update(struct gk20a *g);
27int vgpu_fecs_trace_init(struct gk20a *g);
28int vgpu_fecs_trace_deinit(struct gk20a *g);
29int vgpu_fecs_trace_enable(struct gk20a *g);
30int vgpu_fecs_trace_disable(struct gk20a *g);
31bool vgpu_fecs_trace_is_enabled(struct gk20a *g);
32int vgpu_fecs_trace_poll(struct gk20a *g);
33int vgpu_alloc_user_buffer(struct gk20a *g, void **buf, size_t *size);
34int vgpu_free_user_buffer(struct gk20a *g);
35int vgpu_mmap_user_buffer(struct gk20a *g, struct vm_area_struct *vma);
36int vgpu_fecs_trace_max_entries(struct gk20a *g,
37 struct nvgpu_ctxsw_trace_filter *filter);
38int vgpu_fecs_trace_set_filter(struct gk20a *g,
39 struct nvgpu_ctxsw_trace_filter *filter);
40
41#endif /* __FECS_TRACE_VGPU_H */
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c
index cc56f9f8..cdcecca5 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.c
@@ -3,23 +3,17 @@
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
@@ -32,8 +26,8 @@
32#include <nvgpu/bug.h> 26#include <nvgpu/bug.h>
33#include <nvgpu/barrier.h> 27#include <nvgpu/barrier.h>
34 28
35#include "vgpu/vgpu.h" 29#include "vgpu.h"
36#include "vgpu/fifo_vgpu.h" 30#include "fifo_vgpu.h"
37 31
38#include <nvgpu/hw/gk20a/hw_fifo_gk20a.h> 32#include <nvgpu/hw/gk20a/hw_fifo_gk20a.h>
39#include <nvgpu/hw/gk20a/hw_ram_gk20a.h> 33#include <nvgpu/hw/gk20a/hw_ram_gk20a.h>
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h
index 7633ad95..62a3a256 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.h
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/fifo_vgpu.h
@@ -1,23 +1,17 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#ifndef _FIFO_VGPU_H_ 17#ifndef _FIFO_VGPU_H_
diff --git a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_gr_gm20b.c
index 0e440241..260ce080 100644
--- a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_gr_gm20b.c
@@ -1,30 +1,24 @@
1/* 1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include <nvgpu/enabled.h> 17#include <nvgpu/enabled.h>
24 18
25#include "gk20a/gk20a.h" 19#include "gk20a/gk20a.h"
26#include "gk20a/css_gr_gk20a.h" 20#include "gk20a/css_gr_gk20a.h"
27#include "vgpu/css_vgpu.h" 21#include "common/linux/vgpu/css_vgpu.h"
28#include "vgpu_gr_gm20b.h" 22#include "vgpu_gr_gm20b.h"
29 23
30void vgpu_gr_gm20b_init_cyclestats(struct gk20a *g) 24void vgpu_gr_gm20b_init_cyclestats(struct gk20a *g)
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_gr_gm20b.h b/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_gr_gm20b.h
new file mode 100644
index 00000000..f17de450
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_gr_gm20b.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __VGPU_GR_GM20B_H__
18#define __VGPU_GR_GM20B_H__
19
20#include "gk20a/gk20a.h"
21
22void vgpu_gr_gm20b_init_cyclestats(struct gk20a *g);
23int vgpu_gm20b_init_fs_state(struct gk20a *g);
24
25#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_hal_gm20b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_hal_gm20b.c
index a3eb59ac..1a2d378a 100644
--- a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_hal_gm20b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gm20b/vgpu_hal_gm20b.c
@@ -1,34 +1,28 @@
1/* 1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include "gm20b/hal_gm20b.h" 17#include "gm20b/hal_gm20b.h"
24#include "vgpu/vgpu.h" 18#include "common/linux/vgpu/vgpu.h"
25#include "vgpu/fifo_vgpu.h" 19#include "common/linux/vgpu/fifo_vgpu.h"
26#include "vgpu/gr_vgpu.h" 20#include "common/linux/vgpu/gr_vgpu.h"
27#include "vgpu/ltc_vgpu.h" 21#include "common/linux/vgpu/ltc_vgpu.h"
28#include "vgpu/mm_vgpu.h" 22#include "common/linux/vgpu/mm_vgpu.h"
29#include "vgpu/dbg_vgpu.h" 23#include "common/linux/vgpu/dbg_vgpu.h"
30#include "vgpu/fecs_trace_vgpu.h" 24#include "common/linux/vgpu/fecs_trace_vgpu.h"
31#include "vgpu/css_vgpu.h" 25#include "common/linux/vgpu/css_vgpu.h"
32#include "vgpu_gr_gm20b.h" 26#include "vgpu_gr_gm20b.h"
33 27
34#include "gk20a/bus_gk20a.h" 28#include "gk20a/bus_gk20a.h"
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_fifo_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_fifo_gp10b.c
new file mode 100644
index 00000000..cc006f76
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_fifo_gp10b.c
@@ -0,0 +1,24 @@
1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "vgpu_fifo_gp10b.h"
18
19void vgpu_gp10b_init_fifo_ops(struct gpu_ops *gops)
20{
21 /* syncpoint protection not supported yet */
22 gops->fifo.resetup_ramfc = NULL;
23 gops->fifo.reschedule_runlist = NULL;
24}
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.c
index 8a5130f6..efc9c595 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.c
@@ -1,31 +1,25 @@
1/* 1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include <nvgpu/kmem.h> 17#include <nvgpu/kmem.h>
24#include <nvgpu/dma.h> 18#include <nvgpu/dma.h>
25#include <nvgpu/bug.h> 19#include <nvgpu/bug.h>
26 20
27#include "vgpu/vgpu.h" 21#include "common/linux/vgpu/vgpu.h"
28#include "vgpu/gm20b/vgpu_gr_gm20b.h" 22#include "common/linux/vgpu/gm20b/vgpu_gr_gm20b.h"
29 23
30#include "vgpu_gr_gp10b.h" 24#include "vgpu_gr_gp10b.h"
31 25
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.h b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.h
new file mode 100644
index 00000000..a11dab7d
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_gr_gp10b.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __VGPU_GR_GP10B_H__
18#define __VGPU_GR_GP10B_H__
19
20#include "gk20a/gk20a.h"
21
22void vgpu_gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm,
23 struct gr_ctx_desc *gr_ctx);
24int vgpu_gr_gp10b_alloc_gr_ctx(struct gk20a *g,
25 struct gr_ctx_desc **__gr_ctx,
26 struct vm_gk20a *vm,
27 u32 class,
28 u32 flags);
29int vgpu_gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g,
30 struct gr_ctx_desc *gr_ctx,
31 struct vm_gk20a *vm, u32 class,
32 u32 graphics_preempt_mode,
33 u32 compute_preempt_mode);
34int vgpu_gr_gp10b_set_preemption_mode(struct channel_gk20a *ch,
35 u32 graphics_preempt_mode,
36 u32 compute_preempt_mode);
37int vgpu_gr_gp10b_init_ctx_state(struct gk20a *g);
38
39#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c
index 55448f3b..da4ca10c 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_hal_gp10b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_hal_gp10b.c
@@ -1,36 +1,30 @@
1/* 1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include "vgpu/vgpu.h" 17#include "common/linux/vgpu/vgpu.h"
24#include "vgpu/fifo_vgpu.h" 18#include "common/linux/vgpu/fifo_vgpu.h"
25#include "vgpu/gr_vgpu.h" 19#include "common/linux/vgpu/gr_vgpu.h"
26#include "vgpu/ltc_vgpu.h" 20#include "common/linux/vgpu/ltc_vgpu.h"
27#include "vgpu/mm_vgpu.h" 21#include "common/linux/vgpu/mm_vgpu.h"
28#include "vgpu/dbg_vgpu.h" 22#include "common/linux/vgpu/dbg_vgpu.h"
29#include "vgpu/fecs_trace_vgpu.h" 23#include "common/linux/vgpu/fecs_trace_vgpu.h"
30#include "vgpu/css_vgpu.h" 24#include "common/linux/vgpu/css_vgpu.h"
31#include "gp10b/gp10b.h" 25#include "gp10b/gp10b.h"
32#include "gp10b/hal_gp10b.h" 26#include "gp10b/hal_gp10b.h"
33#include "vgpu/gm20b/vgpu_gr_gm20b.h" 27#include "common/linux/vgpu/gm20b/vgpu_gr_gm20b.h"
34#include "vgpu_gr_gp10b.h" 28#include "vgpu_gr_gp10b.h"
35#include "vgpu_mm_gp10b.h" 29#include "vgpu_mm_gp10b.h"
36 30
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.c
index 5b48cca8..9eb140a3 100644
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.c
@@ -3,28 +3,22 @@
3 * 3 *
4 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#include <uapi/linux/nvgpu.h> 19#include <uapi/linux/nvgpu.h>
26 20
27#include "vgpu/vgpu.h" 21#include "common/linux/vgpu/vgpu.h"
28#include "vgpu_mm_gp10b.h" 22#include "vgpu_mm_gp10b.h"
29#include "gk20a/mm_gk20a.h" 23#include "gk20a/mm_gk20a.h"
30 24
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.h b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.h
new file mode 100644
index 00000000..0a477dd0
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gp10b/vgpu_mm_gp10b.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef __VGPU_MM_GP10B_H__
18#define __VGPU_MM_GP10B_H__
19
20#include "gk20a/gk20a.h"
21
22u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm,
23 u64 map_offset,
24 struct nvgpu_sgt *sgt,
25 u64 buffer_offset,
26 u64 size,
27 int pgsz_idx,
28 u8 kind_v,
29 u32 ctag_offset,
30 u32 flags,
31 int rw_flag,
32 bool clear_ctags,
33 bool sparse,
34 bool priv,
35 struct vm_gk20a_mapping_batch *batch,
36 enum nvgpu_aperture aperture);
37int vgpu_gp10b_init_mm_setup_hw(struct gk20a *g);
38
39#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
index 5dc6f68e..dd2ae306 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.c
@@ -3,23 +3,17 @@
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#include <uapi/linux/nvgpu.h> 19#include <uapi/linux/nvgpu.h>
@@ -27,8 +21,8 @@
27#include <nvgpu/kmem.h> 21#include <nvgpu/kmem.h>
28#include <nvgpu/bug.h> 22#include <nvgpu/bug.h>
29 23
30#include "vgpu/vgpu.h" 24#include "vgpu.h"
31#include "vgpu/gr_vgpu.h" 25#include "gr_vgpu.h"
32#include "gk20a/dbg_gpu_gk20a.h" 26#include "gk20a/dbg_gpu_gk20a.h"
33 27
34#include <nvgpu/hw/gk20a/hw_gr_gk20a.h> 28#include <nvgpu/hw/gk20a/hw_gr_gk20a.h>
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.h
index b43e334a..7815201e 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.h
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gr_vgpu.h
@@ -1,23 +1,17 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#ifndef _GR_VGPU_H_ 17#ifndef _GR_VGPU_H_
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/platform_gv11b_vgpu_tegra.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c
index fea473a7..3b9d63e8 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/platform_gv11b_vgpu_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/platform_gv11b_vgpu_tegra.c
@@ -1,27 +1,21 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include "gk20a/gk20a.h" 17#include "gk20a/gk20a.h"
24#include "vgpu/clk_vgpu.h" 18#include "common/linux/vgpu/clk_vgpu.h"
25#include "common/linux/platform_gk20a.h" 19#include "common/linux/platform_gk20a.h"
26#include "common/linux/os_linux.h" 20#include "common/linux/os_linux.h"
27 21
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_fifo_gv11b.c
index ae9d52a7..710e4b90 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_fifo_gv11b.c
@@ -1,28 +1,22 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include <gk20a/gk20a.h> 17#include <gk20a/gk20a.h>
24 18
25#include "vgpu/vgpu.h" 19#include "common/linux/vgpu/vgpu.h"
26#include "gv11b/fifo_gv11b.h" 20#include "gv11b/fifo_gv11b.h"
27#include <nvgpu/nvhost_t19x.h> 21#include <nvgpu/nvhost_t19x.h>
28 22
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_fifo_gv11b.h b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_fifo_gv11b.h
new file mode 100644
index 00000000..c2e75680
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_fifo_gv11b.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _VGPU_FIFO_GV11B_H_
18#define _VGPU_FIFO_GV11B_H_
19
20struct gk20a;
21
22int vgpu_gv11b_init_fifo_setup_hw(struct gk20a *g);
23int vgpu_gv11b_fifo_alloc_syncpt_buf(struct channel_gk20a *c,
24 u32 syncpt_id, struct nvgpu_mem *syncpt_buf);
25#endif
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gr_gv11b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gr_gv11b.c
new file mode 100644
index 00000000..69e5b2ce
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gr_gv11b.c
@@ -0,0 +1,34 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "gk20a/gk20a.h"
18#include "common/linux/vgpu/gr_vgpu.h"
19#include "vgpu_subctx_gv11b.h"
20
21int vgpu_gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va)
22{
23 int err;
24
25 err = vgpu_gv11b_alloc_subctx_header(c);
26 if (err)
27 return err;
28
29 err = vgpu_gr_commit_inst(c, gpu_va);
30 if (err)
31 vgpu_gv11b_free_subctx_header(c);
32
33 return err;
34}
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gr_gv11b.h b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gr_gv11b.h
new file mode 100644
index 00000000..0208012d
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gr_gv11b.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _VGPU_GR_GV11B_H_
18#define _VGPU_GR_GV11B_H_
19
20struct channel_gk20a;
21
22int vgpu_gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va);
23
24#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gv11b.c
index feac195e..9ba1892b 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gv11b.c
@@ -9,6 +9,9 @@
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details. 11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
12 */ 15 */
13 16
14#include "gk20a/gk20a.h" 17#include "gk20a/gk20a.h"
@@ -16,7 +19,7 @@
16#include <nvgpu/enabled.h> 19#include <nvgpu/enabled.h>
17#include <nvgpu/enabled_t19x.h> 20#include <nvgpu/enabled_t19x.h>
18 21
19#include "vgpu/vgpu.h" 22#include "common/linux/vgpu/vgpu.h"
20#include "vgpu_gv11b.h" 23#include "vgpu_gv11b.h"
21 24
22int vgpu_gv11b_init_gpu_characteristics(struct gk20a *g) 25int vgpu_gv11b_init_gpu_characteristics(struct gk20a *g)
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.h b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gv11b.h
index 9413904b..84ebfa17 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gv11b.h
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_gv11b.h
@@ -9,6 +9,9 @@
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details. 11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
12 */ 15 */
13 16
14#ifndef _VGPU_GV11B_H_ 17#ifndef _VGPU_GV11B_H_
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c
index 17d6f049..6b5a1b0d 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_hal_gv11b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_hal_gv11b.c
@@ -1,39 +1,34 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include <gk20a/gk20a.h> 17#include <gk20a/gk20a.h>
24#include <gv11b/hal_gv11b.h> 18#include <gv11b/hal_gv11b.h>
25#include <vgpu/vgpu.h> 19
26#include <vgpu/fifo_vgpu.h> 20#include "common/linux/vgpu/vgpu.h"
27#include <vgpu/gr_vgpu.h> 21#include "common/linux/vgpu/fifo_vgpu.h"
28#include <vgpu/ltc_vgpu.h> 22#include "common/linux/vgpu/gr_vgpu.h"
29#include <vgpu/mm_vgpu.h> 23#include "common/linux/vgpu/ltc_vgpu.h"
30#include <vgpu/dbg_vgpu.h> 24#include "common/linux/vgpu/mm_vgpu.h"
31#include <vgpu/fecs_trace_vgpu.h> 25#include "common/linux/vgpu/dbg_vgpu.h"
32#include <vgpu/css_vgpu.h> 26#include "common/linux/vgpu/fecs_trace_vgpu.h"
33#include <vgpu/vgpu_t19x.h> 27#include "common/linux/vgpu/css_vgpu.h"
34#include <vgpu/gm20b/vgpu_gr_gm20b.h> 28#include "common/linux/vgpu/vgpu_t19x.h"
35#include <vgpu/gp10b/vgpu_mm_gp10b.h> 29#include "common/linux/vgpu/gm20b/vgpu_gr_gm20b.h"
36#include <vgpu/gp10b/vgpu_gr_gp10b.h> 30#include "common/linux/vgpu/gp10b/vgpu_mm_gp10b.h"
31#include "common/linux/vgpu/gp10b/vgpu_gr_gp10b.h"
37 32
38#include <gk20a/fb_gk20a.h> 33#include <gk20a/fb_gk20a.h>
39#include <gk20a/flcn_gk20a.h> 34#include <gk20a/flcn_gk20a.h>
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_subctx_gv11b.c
index 857e58c4..6d8785e4 100644
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_subctx_gv11b.c
@@ -1,27 +1,21 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include <gk20a/gk20a.h> 17#include "gk20a/gk20a.h"
24#include <vgpu/vgpu.h> 18#include "common/linux/vgpu/vgpu.h"
25#include <linux/tegra_vgpu.h> 19#include <linux/tegra_vgpu.h>
26 20
27int vgpu_gv11b_alloc_subctx_header(struct channel_gk20a *c) 21int vgpu_gv11b_alloc_subctx_header(struct channel_gk20a *c)
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_subctx_gv11b.h b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_subctx_gv11b.h
new file mode 100644
index 00000000..dfd7109e
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_subctx_gv11b.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _VGPU_SUBCTX_GV11B_H_
18#define _VGPU_SUBCTX_GV11B_H_
19
20struct channel_gk20a;
21
22int vgpu_gv11b_alloc_subctx_header(struct channel_gk20a *c);
23void vgpu_gv11b_free_subctx_header(struct channel_gk20a *c);
24
25#endif
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_tsg_gv11b.c b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_tsg_gv11b.c
new file mode 100644
index 00000000..094ccc44
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_tsg_gv11b.c
@@ -0,0 +1,53 @@
1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <linux/tegra_vgpu.h>
18#include "gk20a/gk20a.h"
19#include "common/linux/vgpu/vgpu.h"
20
21#include "vgpu_tsg_gv11b.h"
22
23int vgpu_gv11b_tsg_bind_channel(struct tsg_gk20a *tsg,
24 struct channel_gk20a *ch)
25{
26 struct tegra_vgpu_cmd_msg msg = {};
27 struct tegra_vgpu_tsg_bind_channel_ex_params *p =
28 &msg.params.t19x.tsg_bind_channel_ex;
29 int err;
30
31 gk20a_dbg_fn("");
32
33 err = gk20a_tsg_bind_channel(tsg, ch);
34 if (err)
35 return err;
36
37 msg.cmd = TEGRA_VGPU_CMD_TSG_BIND_CHANNEL_EX;
38 msg.handle = vgpu_get_handle(tsg->g);
39 p->tsg_id = tsg->tsgid;
40 p->ch_handle = ch->virt_ctx;
41 p->subctx_id = ch->t19x.subctx_id;
42 p->runqueue_sel = ch->t19x.runqueue_sel;
43 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
44 err = err ? err : msg.ret;
45 if (err) {
46 nvgpu_err(tsg->g,
47 "vgpu_gv11b_tsg_bind_channel failed, ch %d tsgid %d",
48 ch->chid, tsg->tsgid);
49 gk20a_tsg_unbind_channel(ch);
50 }
51
52 return err;
53}
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_tsg_gv11b.h b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_tsg_gv11b.h
new file mode 100644
index 00000000..6334cdbb
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/gv11b/vgpu_tsg_gv11b.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _VGPU_TSG_GV11B_H_
18#define _VGPU_TSG_GV11B_H_
19
20int vgpu_gv11b_tsg_bind_channel(struct tsg_gk20a *tsg,
21 struct channel_gk20a *ch);
22
23#endif
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/ltc_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/ltc_vgpu.c
new file mode 100644
index 00000000..627ad1a8
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/ltc_vgpu.c
@@ -0,0 +1,61 @@
1/*
2 * Virtualized GPU L2
3 *
4 * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
5 *
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,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "vgpu.h"
20#include "ltc_vgpu.h"
21
22int vgpu_determine_L2_size_bytes(struct gk20a *g)
23{
24 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
25
26 gk20a_dbg_fn("");
27
28 return priv->constants.l2_size;
29}
30
31int vgpu_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr)
32{
33 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
34 u32 max_comptag_lines = 0;
35 int err;
36
37 gk20a_dbg_fn("");
38
39 gr->cacheline_size = priv->constants.cacheline_size;
40 gr->comptags_per_cacheline = priv->constants.comptags_per_cacheline;
41 gr->slices_per_ltc = priv->constants.slices_per_ltc;
42 max_comptag_lines = priv->constants.comptag_lines;
43
44 if (max_comptag_lines < 2)
45 return -ENXIO;
46
47 err = gk20a_comptag_allocator_init(g, &gr->comp_tags, max_comptag_lines);
48 if (err)
49 return err;
50
51 return 0;
52}
53
54void vgpu_ltc_init_fs_state(struct gk20a *g)
55{
56 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
57
58 gk20a_dbg_fn("");
59
60 g->ltc_count = priv->constants.ltc_count;
61}
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/ltc_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/ltc_vgpu.h
new file mode 100644
index 00000000..7b368ef5
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/ltc_vgpu.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _LTC_VGPU_H_
18#define _LTC_VGPU_H_
19
20struct gk20a;
21struct gr_gk20a;
22
23int vgpu_determine_L2_size_bytes(struct gk20a *g);
24int vgpu_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr);
25void vgpu_ltc_init_fs_state(struct gk20a *g);
26
27#endif
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.c
index 79d15d10..f8c5c406 100644
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.c
@@ -3,23 +3,17 @@
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#include <linux/dma-mapping.h> 19#include <linux/dma-mapping.h>
@@ -36,8 +30,8 @@
36#include <nvgpu/linux/vm.h> 30#include <nvgpu/linux/vm.h>
37#include <nvgpu/linux/nvgpu_mem.h> 31#include <nvgpu/linux/nvgpu_mem.h>
38 32
39#include "vgpu/vgpu.h" 33#include "vgpu.h"
40#include "vgpu/mm_vgpu.h" 34#include "mm_vgpu.h"
41#include "gk20a/mm_gk20a.h" 35#include "gk20a/mm_gk20a.h"
42#include "gm20b/mm_gm20b.h" 36#include "gm20b/mm_gm20b.h"
43 37
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.h
new file mode 100644
index 00000000..eee54779
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/mm_vgpu.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _MM_VGPU_H_
18#define _MM_VGPU_H_
19
20u64 vgpu_locked_gmmu_map(struct vm_gk20a *vm,
21 u64 map_offset,
22 struct nvgpu_sgt *sgt,
23 u64 buffer_offset,
24 u64 size,
25 int pgsz_idx,
26 u8 kind_v,
27 u32 ctag_offset,
28 u32 flags,
29 int rw_flag,
30 bool clear_ctags,
31 bool sparse,
32 bool priv,
33 struct vm_gk20a_mapping_batch *batch,
34 enum nvgpu_aperture aperture);
35void vgpu_locked_gmmu_unmap(struct vm_gk20a *vm,
36 u64 vaddr,
37 u64 size,
38 int pgsz_idx,
39 bool va_allocated,
40 int rw_flag,
41 bool sparse,
42 struct vm_gk20a_mapping_batch *batch);
43int vgpu_vm_bind_channel(struct gk20a_as_share *as_share,
44 struct channel_gk20a *ch);
45int vgpu_mm_fb_flush(struct gk20a *g);
46void vgpu_mm_l2_invalidate(struct gk20a *g);
47void vgpu_mm_l2_flush(struct gk20a *g, bool invalidate);
48void vgpu_mm_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb);
49void vgpu_mm_mmu_set_debug_mode(struct gk20a *g, bool enable);
50#endif
diff --git a/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c b/drivers/gpu/nvgpu/common/linux/vgpu/platform_vgpu_tegra.c
index 6209188c..830b04ac 100644
--- a/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/platform_vgpu_tegra.c
@@ -3,28 +3,22 @@
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#include "gk20a.h" 19#include "gk20a/gk20a.h"
26#include "common/linux/platform_gk20a.h" 20#include "common/linux/platform_gk20a.h"
27#include "vgpu/clk_vgpu.h" 21#include "clk_vgpu.h"
28 22
29#include <nvgpu/nvhost.h> 23#include <nvgpu/nvhost.h>
30 24
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/sysfs_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/sysfs_vgpu.c
new file mode 100644
index 00000000..4025aabd
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/sysfs_vgpu.c
@@ -0,0 +1,49 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include <linux/device.h>
18
19#include "vgpu.h"
20
21static ssize_t vgpu_load_show(struct device *dev,
22 struct device_attribute *attr,
23 char *buf)
24{
25 struct gk20a *g = get_gk20a(dev);
26 struct tegra_vgpu_cmd_msg msg = {0};
27 struct tegra_vgpu_gpu_load_params *p = &msg.params.gpu_load;
28 int err;
29
30 msg.cmd = TEGRA_VGPU_CMD_GET_GPU_LOAD;
31 msg.handle = vgpu_get_handle(g);
32 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
33 if (err)
34 return err;
35
36 return snprintf(buf, PAGE_SIZE, "%u\n", p->load);
37}
38static DEVICE_ATTR(load, S_IRUGO, vgpu_load_show, NULL);
39
40void vgpu_create_sysfs(struct device *dev)
41{
42 if (device_create_file(dev, &dev_attr_load))
43 dev_err(dev, "Failed to create vgpu sysfs attributes!\n");
44}
45
46void vgpu_remove_sysfs(struct device *dev)
47{
48 device_remove_file(dev, &dev_attr_load);
49}
diff --git a/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c
index 683317dc..c40e6f90 100644
--- a/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/tsg_vgpu.c
@@ -1,23 +1,17 @@
1/* 1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * This program is free software; you can redistribute it and/or modify it
5 * copy of this software and associated documentation files (the "Software"), 5 * under the terms and conditions of the GNU General Public License,
6 * to deal in the Software without restriction, including without limitation 6 * version 2, as published by the Free Software Foundation.
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 * 7 *
11 * The above copyright notice and this permission notice shall be included in 8 * This program is distributed in the hope it will be useful, but WITHOUT
12 * all copies or substantial portions of the Software. 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
13 * 12 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 * You should have received a copy of the GNU General Public License
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */ 15 */
22 16
23#include <linux/tegra_vgpu.h> 17#include <linux/tegra_vgpu.h>
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c
index 1153b540..7768b21d 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.c
@@ -3,23 +3,17 @@
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#include <linux/delay.h> 19#include <linux/delay.h>
@@ -37,9 +31,9 @@
37#include <nvgpu/soc.h> 31#include <nvgpu/soc.h>
38#include <nvgpu/ctxsw_trace.h> 32#include <nvgpu/ctxsw_trace.h>
39 33
40#include "vgpu/vgpu.h" 34#include "vgpu.h"
41#include "vgpu/fecs_trace_vgpu.h" 35#include "fecs_trace_vgpu.h"
42#include "vgpu/clk_vgpu.h" 36#include "clk_vgpu.h"
43#include "gk20a/tsg_gk20a.h" 37#include "gk20a/tsg_gk20a.h"
44#include "gk20a/channel_gk20a.h" 38#include "gk20a/channel_gk20a.h"
45#include "gm20b/hal_gm20b.h" 39#include "gm20b/hal_gm20b.h"
@@ -51,7 +45,7 @@
51#include "common/linux/driver_common.h" 45#include "common/linux/driver_common.h"
52 46
53#ifdef CONFIG_TEGRA_19x_GPU 47#ifdef CONFIG_TEGRA_19x_GPU
54#include <vgpu/vgpu_t19x.h> 48#include "common/linux/vgpu/vgpu_t19x.h"
55#include <nvgpu_gpuid_t19x.h> 49#include <nvgpu_gpuid_t19x.h>
56#endif 50#endif
57 51
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h
index dcfbddf2..ac65dba3 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.h
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu.h
@@ -3,23 +3,17 @@
3 * 3 *
4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#ifndef _VIRT_H_ 19#ifndef _VIRT_H_
diff --git a/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_t19x.h b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_t19x.h
new file mode 100644
index 00000000..faa5f772
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/vgpu/vgpu_t19x.h
@@ -0,0 +1,30 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
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,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef _VGPU_T19X_H_
18#define _VGPU_T19X_H_
19
20struct gk20a;
21
22int vgpu_gv11b_init_hal(struct gk20a *g);
23
24#define vgpu_t19x_init_hal(g) vgpu_gv11b_init_hal(g)
25
26#define TEGRA_19x_VGPU_COMPAT_TEGRA "nvidia,gv11b-vgpu"
27extern struct gk20a_platform gv11b_vgpu_tegra_platform;
28#define t19x_vgpu_tegra_platform gv11b_vgpu_tegra_platform
29
30#endif
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 5dc60917..5bdd81ac 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -45,7 +45,6 @@
45#include "dbg_gpu_gk20a.h" 45#include "dbg_gpu_gk20a.h"
46#include "mc_gk20a.h" 46#include "mc_gk20a.h"
47#include "hal.h" 47#include "hal.h"
48#include "vgpu/vgpu.h"
49#include "bus_gk20a.h" 48#include "bus_gk20a.h"
50#ifdef CONFIG_ARCH_TEGRA_18x_SOC 49#ifdef CONFIG_ARCH_TEGRA_18x_SOC
51#include "pstate/pstate.h" 50#include "pstate/pstate.h"
diff --git a/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c b/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c
deleted file mode 100644
index bd225f0c..00000000
--- a/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * Virtualized GPU CE2
3 *
4 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#include "vgpu/vgpu.h"
26
27#include <nvgpu/bug.h>
28
29int vgpu_ce2_nonstall_isr(struct gk20a *g,
30 struct tegra_vgpu_ce2_nonstall_intr_info *info)
31{
32 gk20a_dbg_fn("");
33
34 switch (info->type) {
35 case TEGRA_VGPU_CE2_NONSTALL_INTR_NONBLOCKPIPE:
36 gk20a_channel_semaphore_wakeup(g, true);
37 break;
38 default:
39 WARN_ON(1);
40 break;
41 }
42
43 return 0;
44}
45
46u32 vgpu_ce_get_num_pce(struct gk20a *g)
47{
48 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
49
50 return priv->constants.num_pce;
51}
diff --git a/drivers/gpu/nvgpu/vgpu/clk_vgpu.h b/drivers/gpu/nvgpu/vgpu/clk_vgpu.h
deleted file mode 100644
index 58ab5755..00000000
--- a/drivers/gpu/nvgpu/vgpu/clk_vgpu.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Virtualized GPU Clock Interface
3 *
4 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef _CLK_VIRT_H_
26#define _CLK_VIRT_H_
27
28void vgpu_init_clk_support(struct gk20a *g);
29long vgpu_clk_round_rate(struct device *dev, unsigned long rate);
30int vgpu_clk_get_freqs(struct device *dev,
31 unsigned long **freqs, int *num_freqs);
32int vgpu_clk_cap_rate(struct device *dev, unsigned long rate);
33#endif
diff --git a/drivers/gpu/nvgpu/vgpu/css_vgpu.h b/drivers/gpu/nvgpu/vgpu/css_vgpu.h
deleted file mode 100644
index 8c92d571..00000000
--- a/drivers/gpu/nvgpu/vgpu/css_vgpu.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _CSS_VGPU_H_
24#define _CSS_VGPU_H_
25
26#include <nvgpu/types.h>
27
28struct gr_gk20a;
29struct channel_gk20a;
30struct gk20a_cs_snapshot_client;
31
32void vgpu_css_release_snapshot_buffer(struct gr_gk20a *gr);
33int vgpu_css_flush_snapshots(struct channel_gk20a *ch,
34 u32 *pending, bool *hw_overflow);
35int vgpu_css_detach(struct channel_gk20a *ch,
36 struct gk20a_cs_snapshot_client *cs_client);
37int vgpu_css_enable_snapshot_buffer(struct channel_gk20a *ch,
38 struct gk20a_cs_snapshot_client *cs_client);
39u32 vgpu_css_get_buffer_size(struct gk20a *g);
40#endif
diff --git a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.h b/drivers/gpu/nvgpu/vgpu/dbg_vgpu.h
deleted file mode 100644
index b2ca2a7b..00000000
--- a/drivers/gpu/nvgpu/vgpu/dbg_vgpu.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _DBG_VGPU_H_
24#define _DBG_VGPU_H_
25
26struct dbg_session_gk20a;
27struct nvgpu_dbg_gpu_reg_op;
28struct dbg_profiler_object_data;
29struct gk20a;
30
31int vgpu_exec_regops(struct dbg_session_gk20a *dbg_s,
32 struct nvgpu_dbg_gpu_reg_op *ops,
33 u64 num_ops);
34int vgpu_dbg_set_powergate(struct dbg_session_gk20a *dbg_s, bool disable_powergate);
35bool vgpu_check_and_set_global_reservation(
36 struct dbg_session_gk20a *dbg_s,
37 struct dbg_profiler_object_data *prof_obj);
38bool vgpu_check_and_set_context_reservation(
39 struct dbg_session_gk20a *dbg_s,
40 struct dbg_profiler_object_data *prof_obj);
41
42void vgpu_release_profiler_reservation(
43 struct dbg_session_gk20a *dbg_s,
44 struct dbg_profiler_object_data *prof_obj);
45int vgpu_perfbuffer_enable(struct gk20a *g, u64 offset, u32 size);
46int vgpu_perfbuffer_disable(struct gk20a *g);
47#endif
diff --git a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.h b/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.h
deleted file mode 100644
index 392b344c..00000000
--- a/drivers/gpu/nvgpu/vgpu/fecs_trace_vgpu.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef __FECS_TRACE_VGPU_H
24#define __FECS_TRACE_VGPU_H
25
26#include <nvgpu/types.h>
27
28struct gk20a;
29struct vm_area_struct;
30struct nvgpu_ctxsw_trace_filter;
31
32void vgpu_fecs_trace_data_update(struct gk20a *g);
33int vgpu_fecs_trace_init(struct gk20a *g);
34int vgpu_fecs_trace_deinit(struct gk20a *g);
35int vgpu_fecs_trace_enable(struct gk20a *g);
36int vgpu_fecs_trace_disable(struct gk20a *g);
37bool vgpu_fecs_trace_is_enabled(struct gk20a *g);
38int vgpu_fecs_trace_poll(struct gk20a *g);
39int vgpu_alloc_user_buffer(struct gk20a *g, void **buf, size_t *size);
40int vgpu_free_user_buffer(struct gk20a *g);
41int vgpu_mmap_user_buffer(struct gk20a *g, struct vm_area_struct *vma);
42int vgpu_fecs_trace_max_entries(struct gk20a *g,
43 struct nvgpu_ctxsw_trace_filter *filter);
44int vgpu_fecs_trace_set_filter(struct gk20a *g,
45 struct nvgpu_ctxsw_trace_filter *filter);
46
47#endif /* __FECS_TRACE_VGPU_H */
diff --git a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.h b/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.h
deleted file mode 100644
index a0a89579..00000000
--- a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef __VGPU_GR_GM20B_H__
24#define __VGPU_GR_GM20B_H__
25
26#include "gk20a/gk20a.h"
27
28void vgpu_gr_gm20b_init_cyclestats(struct gk20a *g);
29int vgpu_gm20b_init_fs_state(struct gk20a *g);
30
31#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fifo_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fifo_gp10b.c
deleted file mode 100644
index 4348db8e..00000000
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_fifo_gp10b.c
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#include "vgpu_fifo_gp10b.h"
24
25void vgpu_gp10b_init_fifo_ops(struct gpu_ops *gops)
26{
27 /* syncpoint protection not supported yet */
28 gops->fifo.resetup_ramfc = NULL;
29 gops->fifo.reschedule_runlist = NULL;
30}
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.h b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.h
deleted file mode 100644
index baf5a8e9..00000000
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef __VGPU_GR_GP10B_H__
24#define __VGPU_GR_GP10B_H__
25
26#include "gk20a/gk20a.h"
27
28void vgpu_gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm,
29 struct gr_ctx_desc *gr_ctx);
30int vgpu_gr_gp10b_alloc_gr_ctx(struct gk20a *g,
31 struct gr_ctx_desc **__gr_ctx,
32 struct vm_gk20a *vm,
33 u32 class,
34 u32 flags);
35int vgpu_gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g,
36 struct gr_ctx_desc *gr_ctx,
37 struct vm_gk20a *vm, u32 class,
38 u32 graphics_preempt_mode,
39 u32 compute_preempt_mode);
40int vgpu_gr_gp10b_set_preemption_mode(struct channel_gk20a *ch,
41 u32 graphics_preempt_mode,
42 u32 compute_preempt_mode);
43int vgpu_gr_gp10b_init_ctx_state(struct gk20a *g);
44
45#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.h b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.h
deleted file mode 100644
index fd6760ff..00000000
--- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef __VGPU_MM_GP10B_H__
24#define __VGPU_MM_GP10B_H__
25
26#include "gk20a/gk20a.h"
27
28u64 vgpu_gp10b_locked_gmmu_map(struct vm_gk20a *vm,
29 u64 map_offset,
30 struct nvgpu_sgt *sgt,
31 u64 buffer_offset,
32 u64 size,
33 int pgsz_idx,
34 u8 kind_v,
35 u32 ctag_offset,
36 u32 flags,
37 int rw_flag,
38 bool clear_ctags,
39 bool sparse,
40 bool priv,
41 struct vm_gk20a_mapping_batch *batch,
42 enum nvgpu_aperture aperture);
43int vgpu_gp10b_init_mm_setup_hw(struct gk20a *g);
44
45#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.h b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.h
deleted file mode 100644
index bea935d3..00000000
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _VGPU_FIFO_GV11B_H_
24#define _VGPU_FIFO_GV11B_H_
25
26struct gk20a;
27
28int vgpu_gv11b_init_fifo_setup_hw(struct gk20a *g);
29int vgpu_gv11b_fifo_alloc_syncpt_buf(struct channel_gk20a *c,
30 u32 syncpt_id, struct nvgpu_mem *syncpt_buf);
31#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c
deleted file mode 100644
index 89952221..00000000
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.c
+++ /dev/null
@@ -1,41 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#include <gk20a/gk20a.h>
24#include <vgpu/gr_vgpu.h>
25
26#include "vgpu_subctx_gv11b.h"
27
28int vgpu_gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va)
29{
30 int err;
31
32 err = vgpu_gv11b_alloc_subctx_header(c);
33 if (err)
34 return err;
35
36 err = vgpu_gr_commit_inst(c, gpu_va);
37 if (err)
38 vgpu_gv11b_free_subctx_header(c);
39
40 return err;
41}
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.h b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.h
deleted file mode 100644
index 562198ca..00000000
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_gr_gv11b.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _VGPU_GR_GV11B_H_
24#define _VGPU_GR_GV11B_H_
25
26struct channel_gk20a;
27
28int vgpu_gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va);
29
30#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.h b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.h
deleted file mode 100644
index 0e09f4f6..00000000
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _VGPU_SUBCTX_GV11B_H_
24#define _VGPU_SUBCTX_GV11B_H_
25
26struct channel_gk20a;
27
28int vgpu_gv11b_alloc_subctx_header(struct channel_gk20a *c);
29void vgpu_gv11b_free_subctx_header(struct channel_gk20a *c);
30
31#endif
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_tsg_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_tsg_gv11b.c
deleted file mode 100644
index 7e70272a..00000000
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_tsg_gv11b.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#include <linux/tegra_vgpu.h>
24#include <gk20a/gk20a.h>
25#include <vgpu/vgpu.h>
26
27#include "vgpu_tsg_gv11b.h"
28
29int vgpu_gv11b_tsg_bind_channel(struct tsg_gk20a *tsg,
30 struct channel_gk20a *ch)
31{
32 struct tegra_vgpu_cmd_msg msg = {};
33 struct tegra_vgpu_tsg_bind_channel_ex_params *p =
34 &msg.params.t19x.tsg_bind_channel_ex;
35 int err;
36
37 gk20a_dbg_fn("");
38
39 err = gk20a_tsg_bind_channel(tsg, ch);
40 if (err)
41 return err;
42
43 msg.cmd = TEGRA_VGPU_CMD_TSG_BIND_CHANNEL_EX;
44 msg.handle = vgpu_get_handle(tsg->g);
45 p->tsg_id = tsg->tsgid;
46 p->ch_handle = ch->virt_ctx;
47 p->subctx_id = ch->t19x.subctx_id;
48 p->runqueue_sel = ch->t19x.runqueue_sel;
49 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
50 err = err ? err : msg.ret;
51 if (err) {
52 nvgpu_err(tsg->g,
53 "vgpu_gv11b_tsg_bind_channel failed, ch %d tsgid %d",
54 ch->chid, tsg->tsgid);
55 gk20a_tsg_unbind_channel(ch);
56 }
57
58 return err;
59}
diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_tsg_gv11b.h b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_tsg_gv11b.h
deleted file mode 100644
index c7bb2f4e..00000000
--- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_tsg_gv11b.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _VGPU_TSG_GV11B_H_
24#define _VGPU_TSG_GV11B_H_
25
26int vgpu_gv11b_tsg_bind_channel(struct tsg_gk20a *tsg,
27 struct channel_gk20a *ch);
28
29#endif
diff --git a/drivers/gpu/nvgpu/vgpu/ltc_vgpu.c b/drivers/gpu/nvgpu/vgpu/ltc_vgpu.c
deleted file mode 100644
index fb9558e2..00000000
--- a/drivers/gpu/nvgpu/vgpu/ltc_vgpu.c
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * Virtualized GPU L2
3 *
4 * Copyright (c) 2014-2017 NVIDIA CORPORATION. All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#include "vgpu/vgpu.h"
26#include "vgpu/ltc_vgpu.h"
27
28int vgpu_determine_L2_size_bytes(struct gk20a *g)
29{
30 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
31
32 gk20a_dbg_fn("");
33
34 return priv->constants.l2_size;
35}
36
37int vgpu_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr)
38{
39 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
40 u32 max_comptag_lines = 0;
41 int err;
42
43 gk20a_dbg_fn("");
44
45 gr->cacheline_size = priv->constants.cacheline_size;
46 gr->comptags_per_cacheline = priv->constants.comptags_per_cacheline;
47 gr->slices_per_ltc = priv->constants.slices_per_ltc;
48 max_comptag_lines = priv->constants.comptag_lines;
49
50 if (max_comptag_lines < 2)
51 return -ENXIO;
52
53 err = gk20a_comptag_allocator_init(g, &gr->comp_tags, max_comptag_lines);
54 if (err)
55 return err;
56
57 return 0;
58}
59
60void vgpu_ltc_init_fs_state(struct gk20a *g)
61{
62 struct vgpu_priv_data *priv = vgpu_get_priv_data(g);
63
64 gk20a_dbg_fn("");
65
66 g->ltc_count = priv->constants.ltc_count;
67}
diff --git a/drivers/gpu/nvgpu/vgpu/ltc_vgpu.h b/drivers/gpu/nvgpu/vgpu/ltc_vgpu.h
deleted file mode 100644
index 3437b4cb..00000000
--- a/drivers/gpu/nvgpu/vgpu/ltc_vgpu.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _LTC_VGPU_H_
24#define _LTC_VGPU_H_
25
26struct gk20a;
27struct gr_gk20a;
28
29int vgpu_determine_L2_size_bytes(struct gk20a *g);
30int vgpu_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr);
31void vgpu_ltc_init_fs_state(struct gk20a *g);
32
33#endif
diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.h b/drivers/gpu/nvgpu/vgpu/mm_vgpu.h
deleted file mode 100644
index ed66282c..00000000
--- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _MM_VGPU_H_
24#define _MM_VGPU_H_
25
26u64 vgpu_locked_gmmu_map(struct vm_gk20a *vm,
27 u64 map_offset,
28 struct nvgpu_sgt *sgt,
29 u64 buffer_offset,
30 u64 size,
31 int pgsz_idx,
32 u8 kind_v,
33 u32 ctag_offset,
34 u32 flags,
35 int rw_flag,
36 bool clear_ctags,
37 bool sparse,
38 bool priv,
39 struct vm_gk20a_mapping_batch *batch,
40 enum nvgpu_aperture aperture);
41void vgpu_locked_gmmu_unmap(struct vm_gk20a *vm,
42 u64 vaddr,
43 u64 size,
44 int pgsz_idx,
45 bool va_allocated,
46 int rw_flag,
47 bool sparse,
48 struct vm_gk20a_mapping_batch *batch);
49int vgpu_vm_bind_channel(struct gk20a_as_share *as_share,
50 struct channel_gk20a *ch);
51int vgpu_mm_fb_flush(struct gk20a *g);
52void vgpu_mm_l2_invalidate(struct gk20a *g);
53void vgpu_mm_l2_flush(struct gk20a *g, bool invalidate);
54void vgpu_mm_tlb_invalidate(struct gk20a *g, struct nvgpu_mem *pdb);
55void vgpu_mm_mmu_set_debug_mode(struct gk20a *g, bool enable);
56#endif
diff --git a/drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c b/drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c
deleted file mode 100644
index 30b503db..00000000
--- a/drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#include <linux/device.h>
24
25#include "vgpu/vgpu.h"
26
27static ssize_t vgpu_load_show(struct device *dev,
28 struct device_attribute *attr,
29 char *buf)
30{
31 struct gk20a *g = get_gk20a(dev);
32 struct tegra_vgpu_cmd_msg msg = {0};
33 struct tegra_vgpu_gpu_load_params *p = &msg.params.gpu_load;
34 int err;
35
36 msg.cmd = TEGRA_VGPU_CMD_GET_GPU_LOAD;
37 msg.handle = vgpu_get_handle(g);
38 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
39 if (err)
40 return err;
41
42 return snprintf(buf, PAGE_SIZE, "%u\n", p->load);
43}
44static DEVICE_ATTR(load, S_IRUGO, vgpu_load_show, NULL);
45
46void vgpu_create_sysfs(struct device *dev)
47{
48 if (device_create_file(dev, &dev_attr_load))
49 dev_err(dev, "Failed to create vgpu sysfs attributes!\n");
50}
51
52void vgpu_remove_sysfs(struct device *dev)
53{
54 device_remove_file(dev, &dev_attr_load);
55}
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu_t19x.h b/drivers/gpu/nvgpu/vgpu/vgpu_t19x.h
deleted file mode 100644
index 8c020f80..00000000
--- a/drivers/gpu/nvgpu/vgpu/vgpu_t19x.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22
23#ifndef _VGPU_T19X_H_
24#define _VGPU_T19X_H_
25
26struct gk20a;
27
28int vgpu_gv11b_init_hal(struct gk20a *g);
29
30#define vgpu_t19x_init_hal(g) vgpu_gv11b_init_hal(g)
31
32#define TEGRA_19x_VGPU_COMPAT_TEGRA "nvidia,gv11b-vgpu"
33extern struct gk20a_platform gv11b_vgpu_tegra_platform;
34#define t19x_vgpu_tegra_platform gv11b_vgpu_tegra_platform
35
36#endif