summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.c6
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c26
-rw-r--r--drivers/gpu/nvgpu/gv11b/subctx_gv11b.c3
3 files changed, 27 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index 4929f4d1..7f2f5a65 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -185,7 +185,6 @@ static u32 gv11b_userd_gp_get(struct gk20a *g, struct channel_gk20a *c)
185 185
186 return gk20a_mem_rd32(g, userd_mem, 186 return gk20a_mem_rd32(g, userd_mem,
187 offset + ram_userd_gp_get_w()); 187 offset + ram_userd_gp_get_w());
188
189} 188}
190 189
191static void gv11b_userd_gp_put(struct gk20a *g, struct channel_gk20a *c) 190static void gv11b_userd_gp_put(struct gk20a *g, struct channel_gk20a *c)
@@ -199,17 +198,13 @@ static void gv11b_userd_gp_put(struct gk20a *g, struct channel_gk20a *c)
199 smp_mb(); 198 smp_mb();
200 199
201 gv11b_ring_channel_doorbell(c); 200 gv11b_ring_channel_doorbell(c);
202
203} 201}
204 202
205static void channel_gv11b_unbind(struct channel_gk20a *ch) 203static void channel_gv11b_unbind(struct channel_gk20a *ch)
206{ 204{
207 gk20a_dbg_fn(""); 205 gk20a_dbg_fn("");
208 206
209 gv11b_free_subctx_header(ch);
210
211 channel_gk20a_unbind(ch); 207 channel_gk20a_unbind(ch);
212
213} 208}
214 209
215static u32 gv11b_fifo_get_num_fifos(struct gk20a *g) 210static u32 gv11b_fifo_get_num_fifos(struct gk20a *g)
@@ -231,4 +226,5 @@ void gv11b_init_fifo(struct gpu_ops *gops)
231 gops->fifo.setup_ramfc = channel_gv11b_setup_ramfc; 226 gops->fifo.setup_ramfc = channel_gv11b_setup_ramfc;
232 gops->fifo.unbind_channel = channel_gv11b_unbind; 227 gops->fifo.unbind_channel = channel_gv11b_unbind;
233 gops->fifo.eng_runlist_base_size = fifo_eng_runlist_base__size_1_v; 228 gops->fifo.eng_runlist_base_size = fifo_eng_runlist_base__size_1_v;
229 gops->fifo.free_channel_ctx_header = gv11b_free_subctx_header;
234} 230}
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
index 10b1aebb..dfb46701 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
@@ -1853,8 +1853,6 @@ static int gr_gv11b_commit_inst(struct channel_gk20a *c, u64 gpu_va)
1853 /* point this address to engine_wfi_ptr */ 1853 /* point this address to engine_wfi_ptr */
1854 gk20a_mem_wr32(c->g, &c->inst_block, ram_in_engine_wfi_target_w(), 1854 gk20a_mem_wr32(c->g, &c->inst_block, ram_in_engine_wfi_target_w(),
1855 ram_in_engine_cs_wfi_v() | 1855 ram_in_engine_cs_wfi_v() |
1856 ram_in_engine_wfi_target_f(
1857 ram_in_engine_wfi_target_sys_mem_ncoh_v()) |
1858 ram_in_engine_wfi_mode_f(ram_in_engine_wfi_mode_virtual_v()) | 1856 ram_in_engine_wfi_mode_f(ram_in_engine_wfi_mode_virtual_v()) |
1859 ram_in_engine_wfi_ptr_lo_f(addr_lo)); 1857 ram_in_engine_wfi_ptr_lo_f(addr_lo));
1860 1858
@@ -1919,6 +1917,29 @@ static int gr_gv11b_commit_global_timeslice(struct gk20a *g,
1919 return 0; 1917 return 0;
1920} 1918}
1921 1919
1920static void gv11b_restore_context_header(struct gk20a *g,
1921 struct mem_desc *ctxheader)
1922{
1923 u32 va_lo, va_hi;
1924 struct gr_gk20a *gr = &g->gr;
1925
1926 va_hi = gk20a_mem_rd(g, ctxheader,
1927 ctxsw_prog_main_image_context_buffer_ptr_hi_o());
1928 va_lo = gk20a_mem_rd(g, ctxheader,
1929 ctxsw_prog_main_image_context_buffer_ptr_o());
1930 gk20a_mem_wr_n(g, ctxheader, 0,
1931 gr->ctx_vars.local_golden_image,
1932 gr->ctx_vars.golden_image_size);
1933 gk20a_mem_wr(g, ctxheader,
1934 ctxsw_prog_main_image_context_buffer_ptr_hi_o(), va_hi);
1935 gk20a_mem_wr(g, ctxheader,
1936 ctxsw_prog_main_image_context_buffer_ptr_o(), va_lo);
1937 gk20a_mem_wr(g, ctxheader,
1938 ctxsw_prog_main_image_num_restore_ops_o(), 0);
1939 gk20a_mem_wr(g, ctxheader,
1940 ctxsw_prog_main_image_num_save_ops_o(), 0);
1941}
1942
1922void gv11b_init_gr(struct gpu_ops *gops) 1943void gv11b_init_gr(struct gpu_ops *gops)
1923{ 1944{
1924 gp10b_init_gr(gops); 1945 gp10b_init_gr(gops);
@@ -1971,5 +1992,6 @@ void gv11b_init_gr(struct gpu_ops *gops)
1971 gops->gr.program_sm_id_numbering = 1992 gops->gr.program_sm_id_numbering =
1972 gr_gv11b_program_sm_id_numbering; 1993 gr_gv11b_program_sm_id_numbering;
1973 gops->gr.commit_inst = gr_gv11b_commit_inst; 1994 gops->gr.commit_inst = gr_gv11b_commit_inst;
1995 gops->gr.restore_context_header = gv11b_restore_context_header;
1974 1996
1975} 1997}
diff --git a/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c
index 3acc53f6..b0d0a192 100644
--- a/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c
@@ -44,6 +44,7 @@ int gv11b_alloc_subctx_header(struct channel_gk20a *c)
44{ 44{
45 struct ctx_header_desc *ctx = &c->ch_ctx.ctx_header; 45 struct ctx_header_desc *ctx = &c->ch_ctx.ctx_header;
46 struct gk20a *g = c->g; 46 struct gk20a *g = c->g;
47 struct gr_gk20a *gr = &g->gr;
47 int ret = 0; 48 int ret = 0;
48 49
49 gk20a_dbg_fn(""); 50 gk20a_dbg_fn("");
@@ -51,7 +52,7 @@ int gv11b_alloc_subctx_header(struct channel_gk20a *c)
51 if (ctx->mem.gpu_va == 0) { 52 if (ctx->mem.gpu_va == 0) {
52 ret = gk20a_gmmu_alloc_attr_sys(g, 53 ret = gk20a_gmmu_alloc_attr_sys(g,
53 DMA_ATTR_NO_KERNEL_MAPPING, 54 DMA_ATTR_NO_KERNEL_MAPPING,
54 ctxsw_prog_fecs_header_v(), 55 gr->ctx_vars.golden_image_size,
55 &ctx->mem); 56 &ctx->mem);
56 if (ret) { 57 if (ret) {
57 gk20a_err(dev_from_gk20a(g), 58 gk20a_err(dev_from_gk20a(g),