diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 10 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 11 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/fifo_gm20b.c | 1 |
6 files changed, 24 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 4ee1ab43..ab6b8ec1 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1482,6 +1482,7 @@ static void trace_write_pushbuffer_range(struct channel_gk20a *c, | |||
1482 | static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) | 1482 | static void __gk20a_channel_timeout_start(struct channel_gk20a *ch) |
1483 | { | 1483 | { |
1484 | ch->timeout.gp_get = ch->g->ops.fifo.userd_gp_get(ch->g, ch); | 1484 | ch->timeout.gp_get = ch->g->ops.fifo.userd_gp_get(ch->g, ch); |
1485 | ch->timeout.pb_get = ch->g->ops.fifo.userd_pb_get(ch->g, ch); | ||
1485 | ch->timeout.running = true; | 1486 | ch->timeout.running = true; |
1486 | nvgpu_timeout_init(ch->g, &ch->timeout.timer, | 1487 | nvgpu_timeout_init(ch->g, &ch->timeout.timer, |
1487 | gk20a_get_channel_watchdog_timeout(ch), | 1488 | gk20a_get_channel_watchdog_timeout(ch), |
@@ -1602,16 +1603,23 @@ static void gk20a_channel_timeout_handler(struct channel_gk20a *ch) | |||
1602 | { | 1603 | { |
1603 | struct gk20a *g = ch->g; | 1604 | struct gk20a *g = ch->g; |
1604 | u32 gp_get; | 1605 | u32 gp_get; |
1606 | u32 new_gp_get; | ||
1607 | u64 pb_get; | ||
1608 | u64 new_pb_get; | ||
1605 | 1609 | ||
1606 | gk20a_dbg_fn(""); | 1610 | gk20a_dbg_fn(""); |
1607 | 1611 | ||
1608 | /* Get status and clear the timer */ | 1612 | /* Get status and clear the timer */ |
1609 | nvgpu_raw_spinlock_acquire(&ch->timeout.lock); | 1613 | nvgpu_raw_spinlock_acquire(&ch->timeout.lock); |
1610 | gp_get = ch->timeout.gp_get; | 1614 | gp_get = ch->timeout.gp_get; |
1615 | pb_get = ch->timeout.pb_get; | ||
1611 | ch->timeout.running = false; | 1616 | ch->timeout.running = false; |
1612 | nvgpu_raw_spinlock_release(&ch->timeout.lock); | 1617 | nvgpu_raw_spinlock_release(&ch->timeout.lock); |
1613 | 1618 | ||
1614 | if (g->ops.fifo.userd_gp_get(ch->g, ch) != gp_get) { | 1619 | new_gp_get = g->ops.fifo.userd_gp_get(ch->g, ch); |
1620 | new_pb_get = g->ops.fifo.userd_pb_get(ch->g, ch); | ||
1621 | |||
1622 | if (new_gp_get != gp_get || new_pb_get != pb_get) { | ||
1615 | /* Channel has advanced, reschedule */ | 1623 | /* Channel has advanced, reschedule */ |
1616 | gk20a_channel_timeout_start(ch); | 1624 | gk20a_channel_timeout_start(ch); |
1617 | return; | 1625 | return; |
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h index d3ab9b27..4bca4edb 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h | |||
@@ -104,6 +104,7 @@ struct channel_gk20a_timeout { | |||
104 | struct nvgpu_timeout timer; | 104 | struct nvgpu_timeout timer; |
105 | bool running; | 105 | bool running; |
106 | u32 gp_get; | 106 | u32 gp_get; |
107 | u64 pb_get; | ||
107 | }; | 108 | }; |
108 | 109 | ||
109 | struct gk20a_event_id_data { | 110 | struct gk20a_event_id_data { |
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index f536b374..f2fc6234 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -4212,6 +4212,16 @@ u32 gk20a_fifo_userd_gp_get(struct gk20a *g, struct channel_gk20a *c) | |||
4212 | c->userd_gpu_va + sizeof(u32) * ram_userd_gp_get_w()); | 4212 | c->userd_gpu_va + sizeof(u32) * ram_userd_gp_get_w()); |
4213 | } | 4213 | } |
4214 | 4214 | ||
4215 | u64 gk20a_fifo_userd_pb_get(struct gk20a *g, struct channel_gk20a *c) | ||
4216 | { | ||
4217 | u32 lo = gk20a_bar1_readl(g, | ||
4218 | c->userd_gpu_va + sizeof(u32) * ram_userd_get_w()); | ||
4219 | u32 hi = gk20a_bar1_readl(g, | ||
4220 | c->userd_gpu_va + sizeof(u32) * ram_userd_get_hi_w()); | ||
4221 | |||
4222 | return ((u64)hi << 32) | lo; | ||
4223 | } | ||
4224 | |||
4215 | void gk20a_fifo_userd_gp_put(struct gk20a *g, struct channel_gk20a *c) | 4225 | void gk20a_fifo_userd_gp_put(struct gk20a *g, struct channel_gk20a *c) |
4216 | { | 4226 | { |
4217 | gk20a_bar1_writel(g, | 4227 | gk20a_bar1_writel(g, |
@@ -4297,6 +4307,7 @@ void gk20a_init_fifo(struct gpu_ops *gops) | |||
4297 | gops->fifo.setup_userd = gk20a_fifo_setup_userd; | 4307 | gops->fifo.setup_userd = gk20a_fifo_setup_userd; |
4298 | gops->fifo.userd_gp_get = gk20a_fifo_userd_gp_get; | 4308 | gops->fifo.userd_gp_get = gk20a_fifo_userd_gp_get; |
4299 | gops->fifo.userd_gp_put = gk20a_fifo_userd_gp_put; | 4309 | gops->fifo.userd_gp_put = gk20a_fifo_userd_gp_put; |
4310 | gops->fifo.userd_pb_get = gk20a_fifo_userd_pb_get; | ||
4300 | gops->fifo.pbdma_acquire_val = gk20a_fifo_pbdma_acquire_val; | 4311 | gops->fifo.pbdma_acquire_val = gk20a_fifo_pbdma_acquire_val; |
4301 | gops->fifo.teardown_ch_tsg = gk20a_fifo_teardown_ch_tsg; | 4312 | gops->fifo.teardown_ch_tsg = gk20a_fifo_teardown_ch_tsg; |
4302 | gops->fifo.handle_sched_error = gk20a_fifo_handle_sched_error; | 4313 | gops->fifo.handle_sched_error = gk20a_fifo_handle_sched_error; |
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h index b09fde65..7351478a 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.h | |||
@@ -343,6 +343,7 @@ void gk20a_fifo_set_runlist_state(struct gk20a *g, u32 runlists_mask, | |||
343 | 343 | ||
344 | u32 gk20a_fifo_userd_gp_get(struct gk20a *g, struct channel_gk20a *c); | 344 | u32 gk20a_fifo_userd_gp_get(struct gk20a *g, struct channel_gk20a *c); |
345 | void gk20a_fifo_userd_gp_put(struct gk20a *g, struct channel_gk20a *c); | 345 | void gk20a_fifo_userd_gp_put(struct gk20a *g, struct channel_gk20a *c); |
346 | u64 gk20a_fifo_userd_pb_get(struct gk20a *g, struct channel_gk20a *c); | ||
346 | 347 | ||
347 | bool gk20a_is_fault_engine_subid_gpc(struct gk20a *g, u32 engine_subid); | 348 | bool gk20a_is_fault_engine_subid_gpc(struct gk20a *g, u32 engine_subid); |
348 | #ifdef CONFIG_DEBUG_FS | 349 | #ifdef CONFIG_DEBUG_FS |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 68c10284..a8837433 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -471,6 +471,7 @@ struct gpu_ops { | |||
471 | u32 *runlist); | 471 | u32 *runlist); |
472 | u32 (*userd_gp_get)(struct gk20a *g, struct channel_gk20a *ch); | 472 | u32 (*userd_gp_get)(struct gk20a *g, struct channel_gk20a *ch); |
473 | void (*userd_gp_put)(struct gk20a *g, struct channel_gk20a *ch); | 473 | void (*userd_gp_put)(struct gk20a *g, struct channel_gk20a *ch); |
474 | u64 (*userd_pb_get)(struct gk20a *g, struct channel_gk20a *ch); | ||
474 | void (*free_channel_ctx_header)(struct channel_gk20a *ch); | 475 | void (*free_channel_ctx_header)(struct channel_gk20a *ch); |
475 | bool (*is_fault_engine_subid_gpc)(struct gk20a *g, | 476 | bool (*is_fault_engine_subid_gpc)(struct gk20a *g, |
476 | u32 engine_subid); | 477 | u32 engine_subid); |
diff --git a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c index 513f250d..0931d226 100644 --- a/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/fifo_gm20b.c | |||
@@ -199,6 +199,7 @@ void gm20b_init_fifo(struct gpu_ops *gops) | |||
199 | gops->fifo.setup_userd = gk20a_fifo_setup_userd; | 199 | gops->fifo.setup_userd = gk20a_fifo_setup_userd; |
200 | gops->fifo.userd_gp_get = gk20a_fifo_userd_gp_get; | 200 | gops->fifo.userd_gp_get = gk20a_fifo_userd_gp_get; |
201 | gops->fifo.userd_gp_put = gk20a_fifo_userd_gp_put; | 201 | gops->fifo.userd_gp_put = gk20a_fifo_userd_gp_put; |
202 | gops->fifo.userd_pb_get = gk20a_fifo_userd_pb_get; | ||
202 | gops->fifo.pbdma_acquire_val = gk20a_fifo_pbdma_acquire_val; | 203 | gops->fifo.pbdma_acquire_val = gk20a_fifo_pbdma_acquire_val; |
203 | 204 | ||
204 | gops->fifo.preempt_channel = gk20a_fifo_preempt_channel; | 205 | gops->fifo.preempt_channel = gk20a_fifo_preempt_channel; |