summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_tsg_t19x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_tsg_t19x.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_tsg_t19x.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_tsg_t19x.c b/drivers/gpu/nvgpu/common/linux/ioctl_tsg_t19x.c
index 797115ac..ec7501ce 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_tsg_t19x.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_tsg_t19x.c
@@ -28,6 +28,7 @@ static int gv11b_tsg_ioctl_bind_channel_ex(struct gk20a *g,
28 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); 28 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
29 struct gk20a_sched_ctrl *sched = &l->sched_ctrl; 29 struct gk20a_sched_ctrl *sched = &l->sched_ctrl;
30 struct channel_gk20a *ch; 30 struct channel_gk20a *ch;
31 struct gr_gk20a *gr = &g->gr;
31 int err = 0; 32 int err = 0;
32 33
33 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_sched, "tsgid=%u", tsg->tsgid); 34 nvgpu_log(g, gpu_dbg_fn | gpu_dbg_sched, "tsgid=%u", tsg->tsgid);
@@ -48,6 +49,22 @@ static int gv11b_tsg_ioctl_bind_channel_ex(struct gk20a *g,
48 err = -EINVAL; 49 err = -EINVAL;
49 goto idle; 50 goto idle;
50 } 51 }
52
53 if (arg->tpc_pg_enabled && (!tsg->t19x.tpc_num_initialized)) {
54 if ((arg->num_active_tpcs > gr->max_tpc_count) ||
55 !(arg->num_active_tpcs)) {
56 nvgpu_err(g, "Invalid num of active TPCs");
57 err = -EINVAL;
58 goto ch_put;
59 }
60 tsg->t19x.tpc_num_initialized = true;
61 tsg->t19x.num_active_tpcs = arg->num_active_tpcs;
62 tsg->t19x.tpc_pg_enabled = true;
63 } else {
64 tsg->t19x.tpc_pg_enabled = false;
65 nvgpu_log(g, gpu_dbg_info, "dynamic TPC-PG not enabled");
66 }
67
51 if (arg->subcontext_id < g->fifo.t19x.max_subctx_count) { 68 if (arg->subcontext_id < g->fifo.t19x.max_subctx_count) {
52 ch->t19x.subctx_id = arg->subcontext_id; 69 ch->t19x.subctx_id = arg->subcontext_id;
53 } else { 70 } else {