summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/fifo_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/fifo_vgpu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
index 027a92fc..0655ea15 100644
--- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c
@@ -405,6 +405,7 @@ int vgpu_init_fifo_support(struct gk20a *g)
405static int vgpu_fifo_preempt_channel(struct gk20a *g, u32 hw_chid) 405static int vgpu_fifo_preempt_channel(struct gk20a *g, u32 hw_chid)
406{ 406{
407 struct fifo_gk20a *f = &g->fifo; 407 struct fifo_gk20a *f = &g->fifo;
408 struct channel_gk20a *ch = &f->channel[hw_chid];
408 struct tegra_vgpu_cmd_msg msg; 409 struct tegra_vgpu_cmd_msg msg;
409 struct tegra_vgpu_channel_config_params *p = 410 struct tegra_vgpu_channel_config_params *p =
410 &msg.params.channel_config; 411 &msg.params.channel_config;
@@ -412,9 +413,12 @@ static int vgpu_fifo_preempt_channel(struct gk20a *g, u32 hw_chid)
412 413
413 gk20a_dbg_fn(""); 414 gk20a_dbg_fn("");
414 415
416 if (!atomic_read(&ch->bound))
417 return 0;
418
415 msg.cmd = TEGRA_VGPU_CMD_CHANNEL_PREEMPT; 419 msg.cmd = TEGRA_VGPU_CMD_CHANNEL_PREEMPT;
416 msg.handle = vgpu_get_handle(g); 420 msg.handle = vgpu_get_handle(g);
417 p->handle = f->channel[hw_chid].virt_ctx; 421 p->handle = ch->virt_ctx;
418 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg)); 422 err = vgpu_comm_sendrecv(&msg, sizeof(msg), sizeof(msg));
419 423
420 if (err || msg.ret) { 424 if (err || msg.ret) {