summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index 6a86c9a0..e3b1888e 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -501,7 +501,6 @@ static int vgpu_gr_tsg_bind_gr_ctx(struct tsg_gk20a *tsg)
501int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags) 501int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags)
502{ 502{
503 struct gk20a *g = c->g; 503 struct gk20a *g = c->g;
504 struct fifo_gk20a *f = &g->fifo;
505 struct nvgpu_gr_ctx *gr_ctx = NULL; 504 struct nvgpu_gr_ctx *gr_ctx = NULL;
506 struct tsg_gk20a *tsg = NULL; 505 struct tsg_gk20a *tsg = NULL;
507 int err = 0; 506 int err = 0;
@@ -522,10 +521,11 @@ int vgpu_gr_alloc_obj_ctx(struct channel_gk20a *c, u32 class_num, u32 flags)
522 } 521 }
523 c->obj_class = class_num; 522 c->obj_class = class_num;
524 523
525 if (!gk20a_is_channel_marked_as_tsg(c)) 524 tsg = tsg_gk20a_from_ch(c);
525 if (tsg == NULL) {
526 return -EINVAL; 526 return -EINVAL;
527 }
527 528
528 tsg = &f->tsg[c->tsgid];
529 gr_ctx = &tsg->gr_ctx; 529 gr_ctx = &tsg->gr_ctx;
530 530
531 if (!nvgpu_mem_is_valid(&gr_ctx->mem)) { 531 if (!nvgpu_mem_is_valid(&gr_ctx->mem)) {