From eb03270ff65b0fa52d080c2e8700acdf42b9ddee Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Thu, 8 Feb 2018 18:50:58 -0800 Subject: gpu: nvgpu: gv11b: update subctx pdb info Updated subctx pdb info for all instblks created. Earlier subctx pdb info was getting updated during instblk commit. But some instblks like pmu instblk are never committed. Missing subctx pdb info in instblk is creating issues accessing subctx info. So, by filling subctx pdb info during instblk creation fixed all these issues. Also as part of re-org of the function gv11b_init_subcontext_pdb, moved setting subctx info in ram_in_engine_wfi_veid_w() to channel_gv11b_setup_ramfc. Bug 2051863 Change-Id: Ida96118e8f86b638fa6a8586d026ad2617ebbf64 Signed-off-by: seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/1654678 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/subctx_gv11b.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) (limited to 'drivers/gpu/nvgpu/gv11b/subctx_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c b/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c index 4f98d82a..05d7dee0 100644 --- a/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/subctx_gv11b.c @@ -33,12 +33,9 @@ #include #include -static void gv11b_init_subcontext_pdb(struct channel_gk20a *c, +static void gv11b_subctx_commit_valid_mask(struct vm_gk20a *vm, struct nvgpu_mem *inst_block); - -static void gv11b_subctx_commit_valid_mask(struct channel_gk20a *c, - struct nvgpu_mem *inst_block); -static void gv11b_subctx_commit_pdb(struct channel_gk20a *c, +static void gv11b_subctx_commit_pdb(struct vm_gk20a *vm, struct nvgpu_mem *inst_block); void gv11b_free_subctx_header(struct channel_gk20a *c) @@ -89,23 +86,15 @@ int gv11b_alloc_subctx_header(struct channel_gk20a *c) nvgpu_memset(g, &ctx->mem, 0, 0, ctx->mem.size); nvgpu_mem_end(g, &ctx->mem); - - gv11b_init_subcontext_pdb(c, &c->inst_block); } return ret; } -static void gv11b_init_subcontext_pdb(struct channel_gk20a *c, +void gv11b_init_subcontext_pdb(struct vm_gk20a *vm, struct nvgpu_mem *inst_block) { - struct gk20a *g = c->g; - - gv11b_subctx_commit_pdb(c, inst_block); - gv11b_subctx_commit_valid_mask(c, inst_block); - - nvgpu_log(g, gpu_dbg_info, " subctx %d instblk set", c->subctx_id); - nvgpu_mem_wr32(g, inst_block, ram_in_engine_wfi_veid_w(), - ram_in_engine_wfi_veid_f(c->subctx_id)); + gv11b_subctx_commit_pdb(vm, inst_block); + gv11b_subctx_commit_valid_mask(vm, inst_block); } @@ -167,22 +156,21 @@ int gv11b_update_subctx_header(struct channel_gk20a *c, u64 gpu_va) return ret; } -void gv11b_subctx_commit_valid_mask(struct channel_gk20a *c, +void gv11b_subctx_commit_valid_mask(struct vm_gk20a *vm, struct nvgpu_mem *inst_block) { - struct gk20a *g = c->g; + struct gk20a *g = gk20a_from_vm(vm); /* Make all subctx pdbs valid */ nvgpu_mem_wr32(g, inst_block, 166, 0xffffffff); nvgpu_mem_wr32(g, inst_block, 167, 0xffffffff); } -void gv11b_subctx_commit_pdb(struct channel_gk20a *c, +void gv11b_subctx_commit_pdb(struct vm_gk20a *vm, struct nvgpu_mem *inst_block) { - struct gk20a *g = c->g; + struct gk20a *g = gk20a_from_vm(vm); struct fifo_gk20a *f = &g->fifo; - struct vm_gk20a *vm = c->vm; u32 lo, hi; u32 subctx_id = 0; u32 format_word; -- cgit v1.2.2