diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gv100')
-rw-r--r-- | drivers/gpu/nvgpu/gv100/fifo_gv100.c | 14 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv100/fifo_gv100.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv100/hal_gv100.c | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gv100/fifo_gv100.c b/drivers/gpu/nvgpu/gv100/fifo_gv100.c index 79862f6b..0227720d 100644 --- a/drivers/gpu/nvgpu/gv100/fifo_gv100.c +++ b/drivers/gpu/nvgpu/gv100/fifo_gv100.c | |||
@@ -22,9 +22,12 @@ | |||
22 | * DEALINGS IN THE SOFTWARE. | 22 | * DEALINGS IN THE SOFTWARE. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "gk20a/gk20a.h" | ||
25 | #include "fifo_gv100.h" | 26 | #include "fifo_gv100.h" |
27 | #include <nvgpu/timers.h> | ||
26 | 28 | ||
27 | #include <nvgpu/hw/gv100/hw_ccsr_gv100.h> | 29 | #include <nvgpu/hw/gv100/hw_ccsr_gv100.h> |
30 | #include <nvgpu/hw/gk20a/hw_fifo_gk20a.h> | ||
28 | 31 | ||
29 | #define DEFAULT_FIFO_PREEMPT_TIMEOUT 0x3FFFFFUL | 32 | #define DEFAULT_FIFO_PREEMPT_TIMEOUT 0x3FFFFFUL |
30 | 33 | ||
@@ -38,3 +41,14 @@ u32 gv100_fifo_get_preempt_timeout(struct gk20a *g) | |||
38 | return DEFAULT_FIFO_PREEMPT_TIMEOUT; | 41 | return DEFAULT_FIFO_PREEMPT_TIMEOUT; |
39 | } | 42 | } |
40 | 43 | ||
44 | void gv100_apply_ctxsw_timeout_intr(struct gk20a *g) | ||
45 | { | ||
46 | u32 timeout; | ||
47 | |||
48 | timeout = g->ch_wdt_timeout_ms*1000; | ||
49 | timeout = scale_ptimer(timeout, | ||
50 | ptimer_scalingfactor10x(g->ptimer_src_freq)); | ||
51 | timeout |= fifo_eng_timeout_detection_enabled_f(); | ||
52 | gk20a_writel(g, fifo_eng_timeout_r(), timeout); | ||
53 | } | ||
54 | |||
diff --git a/drivers/gpu/nvgpu/gv100/fifo_gv100.h b/drivers/gpu/nvgpu/gv100/fifo_gv100.h index af6ad030..0af3fcce 100644 --- a/drivers/gpu/nvgpu/gv100/fifo_gv100.h +++ b/drivers/gpu/nvgpu/gv100/fifo_gv100.h | |||
@@ -30,4 +30,5 @@ struct gk20a; | |||
30 | 30 | ||
31 | u32 gv100_fifo_get_num_fifos(struct gk20a *g); | 31 | u32 gv100_fifo_get_num_fifos(struct gk20a *g); |
32 | u32 gv100_fifo_get_preempt_timeout(struct gk20a *g); | 32 | u32 gv100_fifo_get_preempt_timeout(struct gk20a *g); |
33 | void gv100_apply_ctxsw_timeout_intr(struct gk20a *g); | ||
33 | #endif | 34 | #endif |
diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index d2136466..a03ae03e 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c | |||
@@ -509,6 +509,7 @@ static const struct gpu_ops gv100_ops = { | |||
509 | .free_channel_ctx_header = gv11b_free_subctx_header, | 509 | .free_channel_ctx_header = gv11b_free_subctx_header, |
510 | .preempt_ch_tsg = gv11b_fifo_preempt_ch_tsg, | 510 | .preempt_ch_tsg = gv11b_fifo_preempt_ch_tsg, |
511 | .handle_ctxsw_timeout = gv11b_fifo_handle_ctxsw_timeout, | 511 | .handle_ctxsw_timeout = gv11b_fifo_handle_ctxsw_timeout, |
512 | .apply_ctxsw_timeout_intr = gv100_apply_ctxsw_timeout_intr, | ||
512 | }, | 513 | }, |
513 | .gr_ctx = { | 514 | .gr_ctx = { |
514 | .get_netlist_name = gr_gv100_get_netlist_name, | 515 | .get_netlist_name = gr_gv100_get_netlist_name, |