diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2018-04-25 06:08:49 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-05-07 12:45:14 -0400 |
commit | 15ec5722be8f483f6d9c1cd0bfd61a7e2bcbfca2 (patch) | |
tree | 8bc083a63442113d8a9773b555ae3d1bff8958df /drivers/gpu/nvgpu/gk20a/mc_gk20a.c | |
parent | bb7ed28ab17ce68c71838bc2aa3fd6e2a0a71a15 (diff) |
gpu: nvgpu: add HAL to handle nonstall interrupts
Add new HAL gops.mc.isr_nonstall() to handle nonstall interrupts
We already handle nonstall interrupts in nvgpu_intr_nonstall()
But this API is completely in linux specific code
Separate out os-independent code to handle nonstall interrupts in new API
mc_gk20a_isr_nonstall() and set it to HAL gops.mc.isr_nonstall() for all
existing chips
Call this HAL from nvgpu_intr_nonstall()
Jira NVGPUT-8
Change-Id: Iec6a56db03158a72a256f7eee8989a0a8a42ae2f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1706589
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mc_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mc_gk20a.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c index e6d81a87..7fed410e 100644 --- a/drivers/gpu/nvgpu/gk20a/mc_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mc_gk20a.c | |||
@@ -74,6 +74,45 @@ void mc_gk20a_isr_stall(struct gk20a *g) | |||
74 | g->ops.bus.isr(g); | 74 | g->ops.bus.isr(g); |
75 | } | 75 | } |
76 | 76 | ||
77 | int mc_gk20a_isr_nonstall(struct gk20a *g) | ||
78 | { | ||
79 | int ops = 0; | ||
80 | u32 mc_intr_1; | ||
81 | u32 engine_id_idx; | ||
82 | u32 active_engine_id = 0; | ||
83 | u32 engine_enum = ENGINE_INVAL_GK20A; | ||
84 | |||
85 | mc_intr_1 = g->ops.mc.intr_nonstall(g); | ||
86 | |||
87 | if (g->ops.mc.is_intr1_pending(g, NVGPU_UNIT_FIFO, mc_intr_1)) | ||
88 | ops |= gk20a_fifo_nonstall_isr(g); | ||
89 | |||
90 | for (engine_id_idx = 0; engine_id_idx < g->fifo.num_engines; | ||
91 | engine_id_idx++) { | ||
92 | struct fifo_engine_info_gk20a *engine_info; | ||
93 | |||
94 | active_engine_id = g->fifo.active_engines_list[engine_id_idx]; | ||
95 | engine_info = &g->fifo.engine_info[active_engine_id]; | ||
96 | |||
97 | if (mc_intr_1 & engine_info->intr_mask) { | ||
98 | engine_enum = engine_info->engine_enum; | ||
99 | /* GR Engine */ | ||
100 | if (engine_enum == ENGINE_GR_GK20A) | ||
101 | ops |= gk20a_gr_nonstall_isr(g); | ||
102 | |||
103 | /* CE Engine */ | ||
104 | if (((engine_enum == ENGINE_GRCE_GK20A) || | ||
105 | (engine_enum == ENGINE_ASYNC_CE_GK20A)) && | ||
106 | g->ops.ce2.isr_nonstall) | ||
107 | ops |= g->ops.ce2.isr_nonstall(g, | ||
108 | engine_info->inst_id, | ||
109 | engine_info->pri_base); | ||
110 | } | ||
111 | } | ||
112 | |||
113 | return ops; | ||
114 | } | ||
115 | |||
77 | void mc_gk20a_intr_enable(struct gk20a *g) | 116 | void mc_gk20a_intr_enable(struct gk20a *g) |
78 | { | 117 | { |
79 | u32 eng_intr_mask = gk20a_fifo_engine_interrupt_mask(g); | 118 | u32 eng_intr_mask = gk20a_fifo_engine_interrupt_mask(g); |