diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index a7aa4003..e680e753 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |||
@@ -2060,6 +2060,49 @@ clean_up: | |||
2060 | return err; | 2060 | return err; |
2061 | } | 2061 | } |
2062 | 2062 | ||
2063 | static int gr_gp10b_set_boosted_ctx(struct channel_gk20a *ch, | ||
2064 | bool boost) | ||
2065 | { | ||
2066 | struct gr_ctx_desc *gr_ctx = ch->ch_ctx.gr_ctx; | ||
2067 | struct gk20a *g = ch->g; | ||
2068 | struct mem_desc *mem = &gr_ctx->mem; | ||
2069 | int err = 0; | ||
2070 | |||
2071 | gr_ctx->boosted_ctx = boost; | ||
2072 | |||
2073 | if (gk20a_mem_begin(g, mem)) | ||
2074 | return -ENOMEM; | ||
2075 | |||
2076 | err = gk20a_disable_channel_tsg(g, ch); | ||
2077 | if (err) | ||
2078 | goto unmap_ctx; | ||
2079 | |||
2080 | err = gk20a_fifo_preempt(g, ch); | ||
2081 | if (err) | ||
2082 | goto enable_ch; | ||
2083 | |||
2084 | if (g->ops.gr.update_boosted_ctx) | ||
2085 | g->ops.gr.update_boosted_ctx(g, mem, gr_ctx); | ||
2086 | else | ||
2087 | err = -ENOSYS; | ||
2088 | |||
2089 | enable_ch: | ||
2090 | gk20a_enable_channel_tsg(g, ch); | ||
2091 | unmap_ctx: | ||
2092 | gk20a_mem_end(g, mem); | ||
2093 | |||
2094 | return err; | ||
2095 | } | ||
2096 | |||
2097 | static void gr_gp10b_update_boosted_ctx(struct gk20a *g, struct mem_desc *mem, | ||
2098 | struct gr_ctx_desc *gr_ctx) { | ||
2099 | u32 v; | ||
2100 | |||
2101 | v = ctxsw_prog_main_image_pmu_options_boost_clock_frequencies_f( | ||
2102 | gr_ctx->boosted_ctx); | ||
2103 | gk20a_mem_wr(g, mem, ctxsw_prog_main_image_pmu_options_o(), v); | ||
2104 | } | ||
2105 | |||
2063 | static int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, | 2106 | static int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, |
2064 | u32 graphics_preempt_mode, | 2107 | u32 graphics_preempt_mode, |
2065 | u32 compute_preempt_mode) | 2108 | u32 compute_preempt_mode) |
@@ -2271,4 +2314,6 @@ void gp10b_init_gr(struct gpu_ops *gops) | |||
2271 | gops->gr.get_preemption_mode_flags = gr_gp10b_get_preemption_mode_flags; | 2314 | gops->gr.get_preemption_mode_flags = gr_gp10b_get_preemption_mode_flags; |
2272 | gops->gr.fuse_override = gp10b_gr_fuse_override; | 2315 | gops->gr.fuse_override = gp10b_gr_fuse_override; |
2273 | gops->gr.load_smid_config = gr_gp10b_load_smid_config; | 2316 | gops->gr.load_smid_config = gr_gp10b_load_smid_config; |
2317 | gops->gr.set_boosted_ctx = gr_gp10b_set_boosted_ctx; | ||
2318 | gops->gr.update_boosted_ctx = gr_gp10b_update_boosted_ctx; | ||
2274 | } | 2319 | } |