From b88d1c5a3e7b0bc79f84cbf2e376066db933bd0a Mon Sep 17 00:00:00 2001 From: Shashank Singh Date: Tue, 20 Feb 2018 17:13:44 +0530 Subject: gpu: nvgpu: vgpu: change commit_inst sequence in gr_alloc Since rm-server is going to use gr sources from linux including the subctx_gv11b.c. commit_inst should be done after global_ctx_buffer map and commit. gv11b_update_subctx_header is called from rm-server for alloc_subctx_header which is using global_ctx_buffer_va[PRIV_ACCESS_MAP_VA]. Jira VQRM-2982 Change-Id: Iff953bf0a12db2c6d69d35094969ab9485858025 Signed-off-by: Shashank Singh Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1661187 Reviewed-by: svc-mobile-coverity Reviewed-by: Sourab Gupta Reviewed-by: Thomas Fleury GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index e61996a1..4a3cf075 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c @@ -523,13 +523,6 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags) goto out; } - /* commit gr ctx buffer */ - err = g->ops.gr.commit_inst(c, gr_ctx->mem.gpu_va); - if (err) { - nvgpu_err(g, "fail to commit gr ctx buffer"); - goto out; - } - /* allocate patch buffer */ err = vgpu_gr_alloc_channel_patch_ctx(g, c); if (err) { @@ -550,6 +543,13 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags) goto out; } + /* commit gr ctx buffer */ + err = g->ops.gr.commit_inst(c, gr_ctx->mem.gpu_va); + if (err) { + nvgpu_err(g, "fail to commit gr ctx buffer"); + goto out; + } + /* load golden image */ err = gr_gk20a_elpg_protected_call(g, vgpu_gr_load_golden_ctx_image(g, c)); -- cgit v1.2.2