diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 48253e59..c7db67fe 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -2808,6 +2808,41 @@ clean_up: | |||
2808 | return err; | 2808 | return err; |
2809 | } | 2809 | } |
2810 | 2810 | ||
2811 | int gk20a_fifo_disable_all_engine_activity(struct gk20a *g, | ||
2812 | bool wait_for_idle) | ||
2813 | { | ||
2814 | unsigned int i; | ||
2815 | int err = 0, ret = 0; | ||
2816 | u32 active_engine_id; | ||
2817 | |||
2818 | for (i = 0; i < g->fifo.num_engines; i++) { | ||
2819 | active_engine_id = g->fifo.active_engines_list[i]; | ||
2820 | err = gk20a_fifo_disable_engine_activity(g, | ||
2821 | &g->fifo.engine_info[active_engine_id], | ||
2822 | wait_for_idle); | ||
2823 | if (err) { | ||
2824 | nvgpu_err(g, "failed to disable engine %d activity\n", | ||
2825 | active_engine_id); | ||
2826 | ret = err; | ||
2827 | break; | ||
2828 | } | ||
2829 | } | ||
2830 | |||
2831 | if (err) { | ||
2832 | while (i-- != 0) { | ||
2833 | active_engine_id = g->fifo.active_engines_list[i]; | ||
2834 | err = gk20a_fifo_enable_engine_activity(g, | ||
2835 | &g->fifo.engine_info[active_engine_id]); | ||
2836 | if (err) | ||
2837 | nvgpu_err(g, | ||
2838 | "failed to re-enable engine %d activity\n", | ||
2839 | active_engine_id); | ||
2840 | } | ||
2841 | } | ||
2842 | |||
2843 | return ret; | ||
2844 | } | ||
2845 | |||
2811 | static void gk20a_fifo_runlist_reset_engines(struct gk20a *g, u32 runlist_id) | 2846 | static void gk20a_fifo_runlist_reset_engines(struct gk20a *g, u32 runlist_id) |
2812 | { | 2847 | { |
2813 | struct fifo_gk20a *f = &g->fifo; | 2848 | struct fifo_gk20a *f = &g->fifo; |