summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2017-09-18 14:39:32 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-09-19 20:45:29 -0400
commit1132fd2a12a48271f94e995c0466c48b8228c185 (patch)
treeeaa69417b39f228995dad657146776eec4884ee3 /drivers/gpu/nvgpu/gp10b
parentc4370d7deff6e3545157e06f51df2fef605a18cc (diff)
gpu: nvgpu: changes related handling ctx header
ctx header holds only gpu va for each address space. All other information will be held in main context. Ctx header will have gpu va for following fields: ctxsw_prog_main_image_context_buffer_ptr ctxsw_prog_main_image_context_buffer_ptr_hi ctxsw_prog_main_image_zcull_ptr ctxsw_prog_main_image_zcull_ptr ctxsw_prog_main_image_pm_ptr ctxsw_prog_main_image_pm_ptr_hi ctxsw_prog_main_image_full_preemption_ptr_hi ctxsw_prog_main_image_full_preemption_ptr ctxsw_prog_main_image_full_preemption_ptr_xxxx0 ctxsw_prog_main_image_full_preemption_ptr_xxxx0_v ctxsw_prog_main_image_patch_adr_lo ctxsw_prog_main_image_patch_adr_hi Changes done as part of this CL: - Read ctx_id from from main context header - Golden context creation: Use gold_mem for for golden context creation and copy golden context from save gold local memory to main context. No need to restore golden context to context header. - Write ctx_patch_count and smpc_ctxsw_mode in main context header only. - Update preemption mode in main context header and preemption buffer va in context header. - Updated image patch buffer va in context header. Bug 1958308 Change-Id: Ic076aad8b1802f76f941d2d15cb9a8c07308e3e8 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1562680 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r--drivers/gpu/nvgpu/gp10b/gr_gp10b.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
index d3e45f55..fc27b120 100644
--- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c
@@ -1168,6 +1168,9 @@ void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g,
1168 struct nvgpu_mem *mem) 1168 struct nvgpu_mem *mem)
1169{ 1169{
1170 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx; 1170 struct gr_ctx_desc *gr_ctx = ch_ctx->gr_ctx;
1171 struct ctx_header_desc *ctx = &ch_ctx->ctx_header;
1172 struct nvgpu_mem *ctxheader = &ctx->mem;
1173
1171 u32 gfxp_preempt_option = 1174 u32 gfxp_preempt_option =
1172 ctxsw_prog_main_image_graphics_preemption_options_control_gfxp_f(); 1175 ctxsw_prog_main_image_graphics_preemption_options_control_gfxp_f();
1173 u32 cilp_preempt_option = 1176 u32 cilp_preempt_option =
@@ -1204,9 +1207,14 @@ void gr_gp10b_update_ctxsw_preemption_mode(struct gk20a *g,
1204 u32 size; 1207 u32 size;
1205 u32 cbes_reserve; 1208 u32 cbes_reserve;
1206 1209
1207 if (g->ops.gr.set_preemption_buffer_va) 1210 if (g->ops.gr.set_preemption_buffer_va) {
1208 g->ops.gr.set_preemption_buffer_va(g, mem, 1211 if (ctxheader->gpu_va)
1212 g->ops.gr.set_preemption_buffer_va(g, ctxheader,
1209 gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va); 1213 gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va);
1214 else
1215 g->ops.gr.set_preemption_buffer_va(g, mem,
1216 gr_ctx->t18x.preempt_ctxsw_buffer.gpu_va);
1217 }
1210 1218
1211 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); 1219 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
1212 if (err) { 1220 if (err) {
@@ -2247,12 +2255,8 @@ int gr_gp10b_set_preemption_mode(struct channel_gk20a *ch,
2247 goto enable_ch; 2255 goto enable_ch;
2248 2256
2249 if (g->ops.gr.update_ctxsw_preemption_mode) { 2257 if (g->ops.gr.update_ctxsw_preemption_mode) {
2250 if (ctxheader->gpu_va) 2258 g->ops.gr.update_ctxsw_preemption_mode(ch->g,
2251 g->ops.gr.update_ctxsw_preemption_mode(ch->g, 2259 ch_ctx, mem);
2252 ch_ctx, ctxheader);
2253 else
2254 g->ops.gr.update_ctxsw_preemption_mode(ch->g,
2255 ch_ctx, mem);
2256 2260
2257 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx); 2261 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx);
2258 if (err) { 2262 if (err) {