summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorSam Payne <spayne@nvidia.com>2015-01-26 17:02:25 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:08:17 -0400
commitce3afaaaf6092f46b2db0f8835e4d4b9b46ef1a4 (patch)
treebd06822411f5601c5ea5c7a9059c1d2c7710c64e /drivers/gpu
parentf3a920cb01d1517db5432c8062b660d6b60eb4de (diff)
gpu: nvgpu: disable ce2 interrupts when unhandled
ce2 interrupts enabled only on gk20a and gm20b when interrupts are handled through hal Change-Id: Ib570db8f5f41e71e768b95e781153ec8a5d20015 Signed-off-by: Sam Payne <spayne@nvidia.com> Reviewed-on: http://git-master/r/677447 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/Makefile1
-rw-r--r--drivers/gpu/nvgpu/gk20a/ce2_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/ce2_gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gk20a/hal_gk20a.c3
-rw-r--r--drivers/gpu/nvgpu/gk20a/mc_gk20a.c10
-rw-r--r--drivers/gpu/nvgpu/gm20b/ce2_gm20b.c28
-rw-r--r--drivers/gpu/nvgpu/gm20b/ce2_gm20b.h29
-rw-r--r--drivers/gpu/nvgpu/gm20b/fifo_gm20b.c2
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c4
11 files changed, 83 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile
index 6632a43a..f20e67b2 100644
--- a/drivers/gpu/nvgpu/Makefile
+++ b/drivers/gpu/nvgpu/Makefile
@@ -49,6 +49,7 @@ nvgpu-y := \
49 gk20a/mc_gk20a.o \ 49 gk20a/mc_gk20a.o \
50 gm20b/hal_gm20b.o \ 50 gm20b/hal_gm20b.o \
51 gm20b/ltc_gm20b.o \ 51 gm20b/ltc_gm20b.o \
52 gm20b/ce2_gm20b.o \
52 gm20b/gr_gm20b.o \ 53 gm20b/gr_gm20b.o \
53 gm20b/gr_gm20b.o \ 54 gm20b/gr_gm20b.o \
54 gm20b/fb_gm20b.o \ 55 gm20b/fb_gm20b.o \
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
index 75df4ce5..ce23c59a 100644
--- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c
@@ -92,4 +92,8 @@ void gk20a_ce2_nonstall_isr(struct gk20a *g)
92 92
93 return; 93 return;
94} 94}
95 95void gk20a_init_ce2(struct gpu_ops *gops)
96{
97 gops->ce2.isr_stall = gk20a_ce2_isr;
98 gops->ce2.isr_nonstall = gk20a_ce2_nonstall_isr;
99}
diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h
index 0a9ec62a..bf4e3066 100644
--- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h
@@ -24,6 +24,7 @@
24#include "channel_gk20a.h" 24#include "channel_gk20a.h"
25#include "tsg_gk20a.h" 25#include "tsg_gk20a.h"
26 26
27void gk20a_init_ce2(struct gpu_ops *gops);
27void gk20a_ce2_isr(struct gk20a *g); 28void gk20a_ce2_isr(struct gk20a *g);
28void gk20a_ce2_nonstall_isr(struct gk20a *g); 29void gk20a_ce2_nonstall_isr(struct gk20a *g);
29 30
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index b9183e76..cf1242ab 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -145,6 +145,9 @@ u32 gk20a_fifo_engine_interrupt_mask(struct gk20a *g)
145 145
146 for (i = 0; i < g->fifo.max_engines; i++) { 146 for (i = 0; i < g->fifo.max_engines; i++) {
147 u32 intr_id = g->fifo.engine_info[i].intr_id; 147 u32 intr_id = g->fifo.engine_info[i].intr_id;
148 if (i == ENGINE_CE2_GK20A &&
149 (!g->ops.ce2.isr_stall || !g->ops.ce2.isr_nonstall))
150 continue;
148 151
149 if (intr_id) 152 if (intr_id)
150 eng_intr_mask |= BIT(intr_id); 153 eng_intr_mask |= BIT(intr_id);
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index ef8068e5..1157390a 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -88,6 +88,10 @@ struct gpu_ops {
88 void (*flush)(struct gk20a *g); 88 void (*flush)(struct gk20a *g);
89 } ltc; 89 } ltc;
90 struct { 90 struct {
91 void (*isr_stall)(struct gk20a *g);
92 void (*isr_nonstall)(struct gk20a *g);
93 } ce2;
94 struct {
91 int (*init_fs_state)(struct gk20a *g); 95 int (*init_fs_state)(struct gk20a *g);
92 void (*access_smpc_reg)(struct gk20a *g, u32 quad, u32 offset); 96 void (*access_smpc_reg)(struct gk20a *g, u32 quad, u32 offset);
93 void (*bundle_cb_defaults)(struct gk20a *g); 97 void (*bundle_cb_defaults)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c
index 0e97d551..5a9c38ea 100644
--- a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c
@@ -42,7 +42,7 @@ static struct gpu_ops gk20a_ops = {
42 gr_gk20a_pg_gr_load_gating_prod, 42 gr_gk20a_pg_gr_load_gating_prod,
43 .slcg_therm_load_gating_prod = 43 .slcg_therm_load_gating_prod =
44 gr_gk20a_slcg_therm_load_gating_prod, 44 gr_gk20a_slcg_therm_load_gating_prod,
45 } 45 },
46}; 46};
47 47
48int gk20a_init_hal(struct gk20a *g) 48int gk20a_init_hal(struct gk20a *g)
@@ -57,6 +57,7 @@ int gk20a_init_hal(struct gk20a *g)
57 gk20a_init_gr_ops(gops); 57 gk20a_init_gr_ops(gops);
58 gk20a_init_fb(gops); 58 gk20a_init_fb(gops);
59 gk20a_init_fifo(gops); 59 gk20a_init_fifo(gops);
60 gk20a_init_ce2(gops);
60 gk20a_init_gr_ctx(gops); 61 gk20a_init_gr_ctx(gops);
61 gk20a_init_mm(gops); 62 gk20a_init_mm(gops);
62 gk20a_init_pmu_ops(gops); 63 gk20a_init_pmu_ops(gops);
diff --git a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c
index 86fea3a1..4aca3424 100644
--- a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c
@@ -80,8 +80,9 @@ irqreturn_t mc_gk20a_intr_thread_stall(struct gk20a *g)
80 80
81 if (mc_intr_0 & BIT(g->fifo.engine_info[ENGINE_GR_GK20A].intr_id)) 81 if (mc_intr_0 & BIT(g->fifo.engine_info[ENGINE_GR_GK20A].intr_id))
82 gr_gk20a_elpg_protected_call(g, gk20a_gr_isr(g)); 82 gr_gk20a_elpg_protected_call(g, gk20a_gr_isr(g));
83 if (mc_intr_0 & BIT(g->fifo.engine_info[ENGINE_CE2_GK20A].intr_id)) 83 if (mc_intr_0 & BIT(g->fifo.engine_info[ENGINE_CE2_GK20A].intr_id)
84 gk20a_ce2_isr(g); 84 && g->ops.ce2.isr_stall)
85 g->ops.ce2.isr_stall(g);
85 if (mc_intr_0 & mc_intr_0_pfifo_pending_f()) 86 if (mc_intr_0 & mc_intr_0_pfifo_pending_f())
86 gk20a_fifo_isr(g); 87 gk20a_fifo_isr(g);
87 if (mc_intr_0 & mc_intr_0_pmu_pending_f()) 88 if (mc_intr_0 & mc_intr_0_pmu_pending_f())
@@ -118,8 +119,9 @@ irqreturn_t mc_gk20a_intr_thread_nonstall(struct gk20a *g)
118 gk20a_fifo_nonstall_isr(g); 119 gk20a_fifo_nonstall_isr(g);
119 if (mc_intr_1 & BIT(g->fifo.engine_info[ENGINE_GR_GK20A].intr_id)) 120 if (mc_intr_1 & BIT(g->fifo.engine_info[ENGINE_GR_GK20A].intr_id))
120 gk20a_gr_nonstall_isr(g); 121 gk20a_gr_nonstall_isr(g);
121 if (mc_intr_1 & BIT(g->fifo.engine_info[ENGINE_CE2_GK20A].intr_id)) 122 if (mc_intr_1 & BIT(g->fifo.engine_info[ENGINE_CE2_GK20A].intr_id)
122 gk20a_ce2_nonstall_isr(g); 123 && g->ops.ce2.isr_nonstall)
124 g->ops.ce2.isr_nonstall(g);
123 125
124 gk20a_writel(g, mc_intr_en_1_r(), 126 gk20a_writel(g, mc_intr_en_1_r(),
125 mc_intr_en_1_inta_hardware_f()); 127 mc_intr_en_1_inta_hardware_f());
diff --git a/drivers/gpu/nvgpu/gm20b/ce2_gm20b.c b/drivers/gpu/nvgpu/gm20b/ce2_gm20b.c
new file mode 100644
index 00000000..a90a9b5b
--- /dev/null
+++ b/drivers/gpu/nvgpu/gm20b/ce2_gm20b.c
@@ -0,0 +1,28 @@
1/*
2 * GK20A Graphics Copy Engine (gr host)
3 *
4 * Copyright (c) 2011-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 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20/*TODO: remove uncecessary */
21#include "gk20a/gk20a.h"
22#include "ce2_gm20b.h"
23
24void gm20b_init_ce2(struct gpu_ops *gops)
25{
26 gops->ce2.isr_stall = gk20a_ce2_isr;
27 gops->ce2.isr_nonstall = gk20a_ce2_nonstall_isr;
28}
diff --git a/drivers/gpu/nvgpu/gm20b/ce2_gm20b.h b/drivers/gpu/nvgpu/gm20b/ce2_gm20b.h
new file mode 100644
index 00000000..10d7ef8c
--- /dev/null
+++ b/drivers/gpu/nvgpu/gm20b/ce2_gm20b.h
@@ -0,0 +1,29 @@
1/*
2 * drivers/video/tegra/host/gk20a/fifo_gk20a.h
3 *
4 * GK20A graphics copy engine (gr host)
5 *
6 * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21#ifndef __CE2_GM20B_H__
22#define __CE2_GM20B_H__
23
24#include "gk20a/channel_gk20a.h"
25#include "gk20a/tsg_gk20a.h"
26
27void gm20b_init_ce2(struct gpu_ops *gops);
28
29#endif /*__CE2_GM20B_H__*/
diff --git a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
index 640448cb..6d186c10 100644
--- a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * GM20B Fifo 2 * GM20B Fifo
3 * 3 *
4 * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index 5dc0c212..d5a6e422 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -18,6 +18,7 @@
18#include "gk20a/gk20a.h" 18#include "gk20a/gk20a.h"
19 19
20#include "ltc_gm20b.h" 20#include "ltc_gm20b.h"
21#include "ce2_gm20b.h"
21#include "gr_gm20b.h" 22#include "gr_gm20b.h"
22#include "ltc_gm20b.h" 23#include "ltc_gm20b.h"
23#include "fb_gm20b.h" 24#include "fb_gm20b.h"
@@ -81,7 +82,7 @@ static struct gpu_ops gm20b_ops = {
81 gm20b_blcg_pmu_load_gating_prod, 82 gm20b_blcg_pmu_load_gating_prod,
82 .pg_gr_load_gating_prod = 83 .pg_gr_load_gating_prod =
83 gr_gm20b_pg_gr_load_gating_prod, 84 gr_gm20b_pg_gr_load_gating_prod,
84 } 85 },
85}; 86};
86 87
87int gm20b_init_hal(struct gk20a *g) 88int gm20b_init_hal(struct gk20a *g)
@@ -124,6 +125,7 @@ int gm20b_init_hal(struct gk20a *g)
124 gm20b_init_ltc(gops); 125 gm20b_init_ltc(gops);
125 gm20b_init_fb(gops); 126 gm20b_init_fb(gops);
126 gm20b_init_fifo(gops); 127 gm20b_init_fifo(gops);
128 gm20b_init_ce2(gops);
127 gm20b_init_gr_ctx(gops); 129 gm20b_init_gr_ctx(gops);
128 gm20b_init_mm(gops); 130 gm20b_init_mm(gops);
129 gm20b_init_pmu_ops(gops); 131 gm20b_init_pmu_ops(gops);