summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/Makefile1
-rw-r--r--drivers/gpu/nvgpu/vgpu/ce2_vgpu.c33
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c17
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c24
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c7
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.h6
-rw-r--r--include/linux/tegra_vgpu.h27
7 files changed, 112 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile
index 053cdde3..4ae636fa 100644
--- a/drivers/gpu/nvgpu/Makefile
+++ b/drivers/gpu/nvgpu/Makefile
@@ -71,6 +71,7 @@ nvgpu-$(CONFIG_TEGRA_GR_VIRTUALIZATION) += \
71 vgpu/ltc_vgpu.o \ 71 vgpu/ltc_vgpu.o \
72 vgpu/gr_vgpu.o \ 72 vgpu/gr_vgpu.o \
73 vgpu/fifo_vgpu.o \ 73 vgpu/fifo_vgpu.o \
74 vgpu/ce2_vgpu.o \
74 vgpu/mm_vgpu.o \ 75 vgpu/mm_vgpu.o \
75 vgpu/debug_vgpu.o \ 76 vgpu/debug_vgpu.o \
76 vgpu/vgpu.o 77 vgpu/vgpu.o
diff --git a/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c b/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c
new file mode 100644
index 00000000..631461f9
--- /dev/null
+++ b/drivers/gpu/nvgpu/vgpu/ce2_vgpu.c
@@ -0,0 +1,33 @@
1/*
2 * Virtualized GPU CE2
3 *
4 * Copyright (c) 2015, 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
16#include "vgpu/vgpu.h"
17
18int vgpu_ce2_nonstall_isr(struct gk20a *g,
19 struct tegra_vgpu_ce2_nonstall_intr_info *info)
20{
21 gk20a_dbg_fn("");
22
23 switch (info->type) {
24 case TEGRA_VGPU_CE2_NONSTALL_INTR_NONBLOCKPIPE:
25 gk20a_channel_semaphore_wakeup(g);
26 break;
27 default:
28 WARN_ON(1);
29 break;
30 }
31
32 return 0;
33}
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index 23ff8677..84bb3646 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -566,6 +566,23 @@ int vgpu_fifo_isr(struct gk20a *g, struct tegra_vgpu_fifo_intr_info *info)
566 return 0; 566 return 0;
567} 567}
568 568
569int vgpu_fifo_nonstall_isr(struct gk20a *g,
570 struct tegra_vgpu_fifo_nonstall_intr_info *info)
571{
572 gk20a_dbg_fn("");
573
574 switch (info->type) {
575 case TEGRA_VGPU_FIFO_NONSTALL_INTR_CHANNEL:
576 gk20a_channel_semaphore_wakeup(g);
577 break;
578 default:
579 WARN_ON(1);
580 break;
581 }
582
583 return 0;
584}
585
569void vgpu_init_fifo_ops(struct gpu_ops *gops) 586void vgpu_init_fifo_ops(struct gpu_ops *gops)
570{ 587{
571 gops->fifo.bind_channel = vgpu_channel_bind; 588 gops->fifo.bind_channel = vgpu_channel_bind;
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index f6f12c7b..99754cae 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -803,7 +803,8 @@ int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info)
803 struct channel_gk20a *ch = &f->channel[info->chid]; 803 struct channel_gk20a *ch = &f->channel[info->chid];
804 804
805 gk20a_dbg_fn(""); 805 gk20a_dbg_fn("");
806 if (info->type != TEGRA_VGPU_GR_INTR_NOTIFY) 806 if (info->type != TEGRA_VGPU_GR_INTR_NOTIFY &&
807 info->type != TEGRA_VGPU_GR_INTR_SEMAPHORE)
807 gk20a_err(dev_from_gk20a(g), "gr intr (%d) on ch %u", 808 gk20a_err(dev_from_gk20a(g), "gr intr (%d) on ch %u",
808 info->type, info->chid); 809 info->type, info->chid);
809 810
@@ -811,6 +812,10 @@ int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info)
811 case TEGRA_VGPU_GR_INTR_NOTIFY: 812 case TEGRA_VGPU_GR_INTR_NOTIFY:
812 wake_up(&ch->notifier_wq); 813 wake_up(&ch->notifier_wq);
813 break; 814 break;
815 case TEGRA_VGPU_GR_INTR_SEMAPHORE:
816 gk20a_channel_event(ch);
817 wake_up(&ch->semaphore_wq);
818 break;
814 case TEGRA_VGPU_GR_INTR_SEMAPHORE_TIMEOUT: 819 case TEGRA_VGPU_GR_INTR_SEMAPHORE_TIMEOUT:
815 gk20a_set_error_notifier(ch, 820 gk20a_set_error_notifier(ch,
816 NVGPU_CHANNEL_GR_SEMAPHORE_TIMEOUT); 821 NVGPU_CHANNEL_GR_SEMAPHORE_TIMEOUT);
@@ -846,6 +851,23 @@ int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info)
846 return 0; 851 return 0;
847} 852}
848 853
854int vgpu_gr_nonstall_isr(struct gk20a *g,
855 struct tegra_vgpu_gr_nonstall_intr_info *info)
856{
857 gk20a_dbg_fn("");
858
859 switch (info->type) {
860 case TEGRA_VGPU_GR_NONSTALL_INTR_SEMAPHORE:
861 gk20a_channel_semaphore_wakeup(g);
862 break;
863 default:
864 WARN_ON(1);
865 break;
866 }
867
868 return 0;
869}
870
849void vgpu_init_gr_ops(struct gpu_ops *gops) 871void vgpu_init_gr_ops(struct gpu_ops *gops)
850{ 872{
851 gops->gr.free_channel_ctx = vgpu_gr_free_channel_ctx; 873 gops->gr.free_channel_ctx = vgpu_gr_free_channel_ctx;
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index c998b10b..b16fe47c 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -114,8 +114,15 @@ static int vgpu_intr_thread(void *dev_id)
114 114
115 if (msg->unit == TEGRA_VGPU_INTR_GR) 115 if (msg->unit == TEGRA_VGPU_INTR_GR)
116 vgpu_gr_isr(g, &msg->info.gr_intr); 116 vgpu_gr_isr(g, &msg->info.gr_intr);
117 else if (msg->unit == TEGRA_VGPU_NONSTALL_INTR_GR)
118 vgpu_gr_nonstall_isr(g, &msg->info.gr_nonstall_intr);
117 else if (msg->unit == TEGRA_VGPU_INTR_FIFO) 119 else if (msg->unit == TEGRA_VGPU_INTR_FIFO)
118 vgpu_fifo_isr(g, &msg->info.fifo_intr); 120 vgpu_fifo_isr(g, &msg->info.fifo_intr);
121 else if (msg->unit == TEGRA_VGPU_NONSTALL_INTR_FIFO)
122 vgpu_fifo_nonstall_isr(g,
123 &msg->info.fifo_nonstall_intr);
124 else if (msg->unit == TEGRA_VGPU_NONSTALL_INTR_CE2)
125 vgpu_ce2_nonstall_isr(g, &msg->info.ce2_nonstall_intr);
119 126
120 tegra_gr_comm_release(handle); 127 tegra_gr_comm_release(handle);
121 } 128 }
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/vgpu/vgpu.h
index 1a7ef7ba..d577f32e 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.h
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.h
@@ -27,7 +27,13 @@ int vgpu_probe(struct platform_device *dev);
27int vgpu_remove(struct platform_device *dev); 27int vgpu_remove(struct platform_device *dev);
28u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size); 28u64 vgpu_bar1_map(struct gk20a *g, struct sg_table **sgt, u64 size);
29int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info); 29int vgpu_gr_isr(struct gk20a *g, struct tegra_vgpu_gr_intr_info *info);
30int vgpu_gr_nonstall_isr(struct gk20a *g,
31 struct tegra_vgpu_gr_nonstall_intr_info *info);
30int vgpu_fifo_isr(struct gk20a *g, struct tegra_vgpu_fifo_intr_info *info); 32int vgpu_fifo_isr(struct gk20a *g, struct tegra_vgpu_fifo_intr_info *info);
33int vgpu_fifo_nonstall_isr(struct gk20a *g,
34 struct tegra_vgpu_fifo_nonstall_intr_info *info);
35int vgpu_ce2_nonstall_isr(struct gk20a *g,
36 struct tegra_vgpu_ce2_nonstall_intr_info *info);
31void vgpu_init_fifo_ops(struct gpu_ops *gops); 37void vgpu_init_fifo_ops(struct gpu_ops *gops);
32void vgpu_init_gr_ops(struct gpu_ops *gops); 38void vgpu_init_gr_ops(struct gpu_ops *gops);
33void vgpu_init_ltc_ops(struct gpu_ops *gops); 39void vgpu_init_ltc_ops(struct gpu_ops *gops);
diff --git a/include/linux/tegra_vgpu.h b/include/linux/tegra_vgpu.h
index a295c9ef..7c4aa323 100644
--- a/include/linux/tegra_vgpu.h
+++ b/include/linux/tegra_vgpu.h
@@ -251,9 +251,13 @@ enum {
251 TEGRA_VGPU_GR_INTR_CLASS_ERROR, 251 TEGRA_VGPU_GR_INTR_CLASS_ERROR,
252 TEGRA_VGPU_GR_INTR_FIRMWARE_METHOD, 252 TEGRA_VGPU_GR_INTR_FIRMWARE_METHOD,
253 TEGRA_VGPU_GR_INTR_EXCEPTION, 253 TEGRA_VGPU_GR_INTR_EXCEPTION,
254 TEGRA_VGPU_GR_INTR_SEMAPHORE,
254 TEGRA_VGPU_FIFO_INTR_PBDMA, 255 TEGRA_VGPU_FIFO_INTR_PBDMA,
255 TEGRA_VGPU_FIFO_INTR_CTXSW_TIMEOUT, 256 TEGRA_VGPU_FIFO_INTR_CTXSW_TIMEOUT,
256 TEGRA_VGPU_FIFO_INTR_MMU_FAULT 257 TEGRA_VGPU_FIFO_INTR_MMU_FAULT,
258 TEGRA_VGPU_GR_NONSTALL_INTR_SEMAPHORE,
259 TEGRA_VGPU_FIFO_NONSTALL_INTR_CHANNEL,
260 TEGRA_VGPU_CE2_NONSTALL_INTR_NONBLOCKPIPE
257}; 261};
258 262
259struct tegra_vgpu_gr_intr_info { 263struct tegra_vgpu_gr_intr_info {
@@ -261,14 +265,30 @@ struct tegra_vgpu_gr_intr_info {
261 u32 chid; 265 u32 chid;
262}; 266};
263 267
268struct tegra_vgpu_gr_nonstall_intr_info {
269 u32 type;
270};
271
264struct tegra_vgpu_fifo_intr_info { 272struct tegra_vgpu_fifo_intr_info {
265 u32 type; 273 u32 type;
266 u32 chid; 274 u32 chid;
267}; 275};
268 276
277struct tegra_vgpu_fifo_nonstall_intr_info {
278 u32 type;
279};
280
281struct tegra_vgpu_ce2_nonstall_intr_info {
282 u32 type;
283};
284
269enum { 285enum {
270 TEGRA_VGPU_INTR_GR = 0, 286 TEGRA_VGPU_INTR_GR = 0,
271 TEGRA_VGPU_INTR_FIFO 287 TEGRA_VGPU_INTR_FIFO,
288 TEGRA_VGPU_INTR_CE2,
289 TEGRA_VGPU_NONSTALL_INTR_GR,
290 TEGRA_VGPU_NONSTALL_INTR_FIFO,
291 TEGRA_VGPU_NONSTALL_INTR_CE2
272}; 292};
273 293
274enum { 294enum {
@@ -281,7 +301,10 @@ struct tegra_vgpu_intr_msg {
281 u32 unit; 301 u32 unit;
282 union { 302 union {
283 struct tegra_vgpu_gr_intr_info gr_intr; 303 struct tegra_vgpu_gr_intr_info gr_intr;
304 struct tegra_vgpu_gr_nonstall_intr_info gr_nonstall_intr;
284 struct tegra_vgpu_fifo_intr_info fifo_intr; 305 struct tegra_vgpu_fifo_intr_info fifo_intr;
306 struct tegra_vgpu_fifo_nonstall_intr_info fifo_nonstall_intr;
307 struct tegra_vgpu_ce2_nonstall_intr_info ce2_nonstall_intr;
285 } info; 308 } info;
286}; 309};
287 310