From c624f35383ab15f86d6a4ecac751d0836f154acf Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Thu, 26 May 2016 16:34:38 -0700 Subject: gpu: nvgpu: vgpu: add channel enable support Bug 200173403 VFND-1568 Change-Id: I3636a77bbbbd719e961dce5ca7ca7bdd5aa33881 Signed-off-by: Richard Zhao Reviewed-on: http://git-master/r/1159620 (cherry picked from commit b22fb6518da15a09c3e298213af5e60b8e6907a2) Reviewed-on: http://git-master/r/1155403 Reviewed-by: Aingara Paramakuru GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | 19 ++++++++++++++++++- include/linux/tegra_vgpu.h | 1 + 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c index dad9464a..9591c72a 100644 --- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c @@ -102,6 +102,23 @@ static void vgpu_channel_free_inst(struct gk20a *g, struct channel_gk20a *ch) WARN_ON(err || msg.ret); } +static void vgpu_channel_enable(struct channel_gk20a *ch) +{ + struct gk20a_platform *platform = gk20a_get_platform(ch->g->dev); + struct tegra_vgpu_cmd_msg msg; + struct tegra_vgpu_channel_config_params *p = + &msg.params.channel_config; + int err; + + gk20a_dbg_fn(""); + + msg.cmd = TEGRA_VGPU_CMD_CHANNEL_ENABLE; + msg.handle = platform->virt_handle; + p->handle = ch->virt_ctx; + err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); + WARN_ON(err || msg.ret); +} + static void vgpu_channel_disable(struct channel_gk20a *ch) { struct gk20a_platform *platform = gk20a_get_platform(ch->g->dev); @@ -741,7 +758,7 @@ void vgpu_init_fifo_ops(struct gpu_ops *gops) { gops->fifo.bind_channel = vgpu_channel_bind; gops->fifo.unbind_channel = vgpu_channel_unbind; - gops->fifo.enable_channel = NULL; + gops->fifo.enable_channel = vgpu_channel_enable; gops->fifo.disable_channel = vgpu_channel_disable; gops->fifo.alloc_inst = vgpu_channel_alloc_inst; gops->fifo.free_inst = vgpu_channel_free_inst; diff --git a/include/linux/tegra_vgpu.h b/include/linux/tegra_vgpu.h index d3af4a07..e6e03459 100644 --- a/include/linux/tegra_vgpu.h +++ b/include/linux/tegra_vgpu.h @@ -94,6 +94,7 @@ enum { TEGRA_VGPU_CMD_TSG_SET_TIMESLICE, TEGRA_VGPU_CMD_TSG_SET_RUNLIST_INTERLEAVE, TEGRA_VGPU_CMD_CHANNEL_FORCE_RESET, + TEGRA_VGPU_CMD_CHANNEL_ENABLE, }; struct tegra_vgpu_connect_params { -- cgit v1.2.2