gpu: nvgpu: vgpu: add channel enable support

Bug 200173403
VFND-1568

Change-Id: I3636a77bbbbd719e961dce5ca7ca7bdd5aa33881
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: http://git-master/r/1159620
(cherry picked from commit b22fb6518da15a09c3e298213af5e60b8e6907a2)
Reviewed-on: http://git-master/r/1155403
Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Richard Zhao
2016-05-26 16:34:38 -07:00
committed by Terje Bergstrom
parent e8b20c12cd
commit c624f35383
2 changed files with 19 additions and 1 deletions

View File

@@ -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;

View File

@@ -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 {