From 28093a374bef54b9b68fcb2f00ae7d0529e33a3f Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Mon, 10 Apr 2017 15:29:36 -0700 Subject: gpu: nvgpu: vgpu: add t19x support - add commit_inst hal ops - add t19x cmds to cmd big union - add t19x vgpu driver and call t19x hal init - get guest channel_base to calculate hw channel id Jira VFND-3796 Change-Id: Ic2431233fd174afc2c84c4794e20552e6e88b1dc Signed-off-by: Richard Zhao Reviewed-on: https://git-master/r/1474715 GVS: Gerrit_Virtual_Submit Reviewed-by: Aingara Paramakuru Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 a001b54e..e3dfb874 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c @@ -35,7 +35,7 @@ static void vgpu_gr_detect_sm_arch(struct gk20a *g) priv->constants.sm_arch_warp_count; } -static int vgpu_gr_commit_inst(struct channel_gk20a *c, u64 gpu_va) +int vgpu_gr_commit_inst(struct channel_gk20a *c, u64 gpu_va) { struct tegra_vgpu_cmd_msg msg; struct tegra_vgpu_ch_ctx_params *p = &msg.params.ch_ctx; @@ -422,6 +422,8 @@ static void vgpu_gr_free_channel_ctx(struct channel_gk20a *c) { gk20a_dbg_fn(""); + if (c->g->ops.fifo.free_channel_ctx_header) + c->g->ops.fifo.free_channel_ctx_header(c); vgpu_gr_unmap_global_ctx_buffers(c); vgpu_gr_free_channel_patch_ctx(c); vgpu_gr_free_channel_pm_ctx(c); @@ -551,7 +553,7 @@ static int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, } /* commit gr ctx buffer */ - err = vgpu_gr_commit_inst(c, ch_ctx->gr_ctx->mem.gpu_va); + err = g->ops.gr.commit_inst(c, ch_ctx->gr_ctx->mem.gpu_va); if (err) { nvgpu_err(g, "fail to commit gr ctx buffer"); goto out; @@ -1227,6 +1229,7 @@ void vgpu_init_gr_ops(struct gpu_ops *gops) gops->gr.clear_sm_error_state = vgpu_gr_clear_sm_error_state; gops->gr.suspend_contexts = vgpu_gr_suspend_contexts; gops->gr.resume_contexts = vgpu_gr_resume_contexts; + gops->gr.commit_inst = vgpu_gr_commit_inst; gops->gr.dump_gr_regs = NULL; gops->gr.set_boosted_ctx = NULL; gops->gr.update_boosted_ctx = NULL; -- cgit v1.2.2