diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/fifo_gp10b.c | 27 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h | 4 |
2 files changed, 19 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c index 3a6c3c23..8c53978b 100644 --- a/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/fifo_gp10b.c | |||
@@ -150,31 +150,34 @@ static u32 gp10b_fifo_get_pbdma_signature(struct gk20a *g) | |||
150 | 150 | ||
151 | static int gp10b_fifo_resetup_ramfc(struct channel_gk20a *c) | 151 | static int gp10b_fifo_resetup_ramfc(struct channel_gk20a *c) |
152 | { | 152 | { |
153 | int syncpt_id; | 153 | u32 new_syncpt = 0, old_syncpt; |
154 | void *inst_ptr; | 154 | void *inst_ptr; |
155 | u32 v; | ||
155 | 156 | ||
156 | gk20a_dbg_fn(""); | 157 | gk20a_dbg_fn(""); |
157 | 158 | ||
158 | inst_ptr = c->inst_block.cpu_va; | 159 | inst_ptr = c->inst_block.cpu_va; |
159 | 160 | ||
160 | /* disable channel */ | 161 | v = gk20a_mem_rd32(inst_ptr, ram_fc_allowed_syncpoints_w()); |
161 | c->g->ops.fifo.disable_channel(c); | 162 | old_syncpt = pbdma_allowed_syncpoints_0_index_v(v); |
163 | if (c->sync) | ||
164 | new_syncpt = c->sync->syncpt_id(c->sync); | ||
162 | 165 | ||
163 | /* preempt the channel */ | 166 | if (new_syncpt && new_syncpt != old_syncpt) { |
164 | WARN_ON(c->g->ops.fifo.preempt_channel(c->g, c->hw_chid)); | 167 | /* disable channel */ |
168 | c->g->ops.fifo.disable_channel(c); | ||
165 | 169 | ||
166 | if (c->sync) { | 170 | /* preempt the channel */ |
167 | u32 v = pbdma_allowed_syncpoints_0_valid_f(1); | 171 | WARN_ON(c->g->ops.fifo.preempt_channel(c->g, c->hw_chid)); |
172 | |||
173 | v = pbdma_allowed_syncpoints_0_valid_f(1); | ||
168 | 174 | ||
169 | syncpt_id = c->sync->syncpt_id(c->sync); | ||
170 | gk20a_dbg_info("Channel %d, syncpt id %d\n", | 175 | gk20a_dbg_info("Channel %d, syncpt id %d\n", |
171 | c->hw_chid, syncpt_id); | 176 | c->hw_chid, new_syncpt); |
172 | 177 | ||
173 | v |= pbdma_allowed_syncpoints_0_index_f(syncpt_id); | 178 | v |= pbdma_allowed_syncpoints_0_index_f(new_syncpt); |
174 | 179 | ||
175 | gk20a_mem_wr32(inst_ptr, ram_fc_allowed_syncpoints_w(), v); | 180 | gk20a_mem_wr32(inst_ptr, ram_fc_allowed_syncpoints_w(), v); |
176 | } else { | ||
177 | gk20a_mem_wr32(inst_ptr, ram_fc_allowed_syncpoints_w(), 0); | ||
178 | } | 181 | } |
179 | 182 | ||
180 | /* enable channel */ | 183 | /* enable channel */ |
diff --git a/drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h index 18db8595..977a8ee2 100644 --- a/drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/hw_pbdma_gp10b.h | |||
@@ -454,6 +454,10 @@ static inline u32 pbdma_allowed_syncpoints_0_index_f(u32 v) | |||
454 | { | 454 | { |
455 | return (v & 0x7fff) << 16; | 455 | return (v & 0x7fff) << 16; |
456 | } | 456 | } |
457 | static inline u32 pbdma_allowed_syncpoints_0_index_v(u32 r) | ||
458 | { | ||
459 | return (r >> 16) & 0x7fff; | ||
460 | } | ||
457 | static inline u32 pbdma_allowed_syncpoints_1_valid_f(u32 v) | 461 | static inline u32 pbdma_allowed_syncpoints_1_valid_f(u32 v) |
458 | { | 462 | { |
459 | return (v & 0x1) << 15; | 463 | return (v & 0x1) << 15; |