diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c index f7d5535d..603ed6f5 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | |||
@@ -114,6 +114,16 @@ int gk20a_tsg_bind_channel(struct tsg_gk20a *tsg, | |||
114 | 114 | ||
115 | ch->tsgid = tsg->tsgid; | 115 | ch->tsgid = tsg->tsgid; |
116 | 116 | ||
117 | /* all the channel part of TSG should need to be same runlist_id */ | ||
118 | if (tsg->runlist_id == ~0) | ||
119 | tsg->runlist_id = ch->runlist_id; | ||
120 | else if (tsg->runlist_id != ch->runlist_id) { | ||
121 | gk20a_err(dev_from_gk20a(tsg->g), | ||
122 | "Error: TSG channel should be share same runlist ch[%d] tsg[%d]\n", | ||
123 | ch->runlist_id, tsg->runlist_id); | ||
124 | return -EINVAL; | ||
125 | } | ||
126 | |||
117 | mutex_lock(&tsg->ch_list_lock); | 127 | mutex_lock(&tsg->ch_list_lock); |
118 | list_add_tail(&ch->ch_entry, &tsg->ch_list); | 128 | list_add_tail(&ch->ch_entry, &tsg->ch_list); |
119 | mutex_unlock(&tsg->ch_list_lock); | 129 | mutex_unlock(&tsg->ch_list_lock); |
@@ -185,7 +195,7 @@ static int gk20a_tsg_set_priority(struct gk20a *g, struct tsg_gk20a *tsg, | |||
185 | gk20a_channel_get_timescale_from_timeslice(g, tsg->timeslice_us, | 195 | gk20a_channel_get_timescale_from_timeslice(g, tsg->timeslice_us, |
186 | &tsg->timeslice_timeout, &tsg->timeslice_scale); | 196 | &tsg->timeslice_timeout, &tsg->timeslice_scale); |
187 | 197 | ||
188 | g->ops.fifo.update_runlist(g, 0, ~0, true, true); | 198 | g->ops.fifo.update_runlist(g, tsg->runlist_id, ~0, true, true); |
189 | 199 | ||
190 | return 0; | 200 | return 0; |
191 | } | 201 | } |
@@ -346,7 +356,7 @@ static int gk20a_tsg_set_runlist_interleave(struct tsg_gk20a *tsg, u32 level) | |||
346 | break; | 356 | break; |
347 | } | 357 | } |
348 | 358 | ||
349 | return ret ? ret : g->ops.fifo.update_runlist(g, 0, ~0, true, true); | 359 | return ret ? ret : g->ops.fifo.update_runlist(g, tsg->runlist_id, ~0, true, true); |
350 | } | 360 | } |
351 | 361 | ||
352 | static int gk20a_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice) | 362 | static int gk20a_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice) |
@@ -360,7 +370,7 @@ static int gk20a_tsg_set_timeslice(struct tsg_gk20a *tsg, u32 timeslice) | |||
360 | gk20a_channel_get_timescale_from_timeslice(g, timeslice, | 370 | gk20a_channel_get_timescale_from_timeslice(g, timeslice, |
361 | &tsg->timeslice_timeout, &tsg->timeslice_scale); | 371 | &tsg->timeslice_timeout, &tsg->timeslice_scale); |
362 | 372 | ||
363 | return g->ops.fifo.update_runlist(g, 0, ~0, true, true); | 373 | return g->ops.fifo.update_runlist(g, tsg->runlist_id, ~0, true, true); |
364 | } | 374 | } |
365 | 375 | ||
366 | static void release_used_tsg(struct fifo_gk20a *f, struct tsg_gk20a *tsg) | 376 | static void release_used_tsg(struct fifo_gk20a *f, struct tsg_gk20a *tsg) |
@@ -411,6 +421,7 @@ int gk20a_tsg_open(struct gk20a *g, struct file *filp) | |||
411 | tsg->timeslice_us = 0; | 421 | tsg->timeslice_us = 0; |
412 | tsg->timeslice_timeout = 0; | 422 | tsg->timeslice_timeout = 0; |
413 | tsg->timeslice_scale = 0; | 423 | tsg->timeslice_scale = 0; |
424 | tsg->runlist_id = ~0; | ||
414 | 425 | ||
415 | filp->private_data = tsg; | 426 | filp->private_data = tsg; |
416 | 427 | ||
@@ -448,6 +459,8 @@ static void gk20a_tsg_release(struct kref *ref) | |||
448 | 459 | ||
449 | release_used_tsg(&g->fifo, tsg); | 460 | release_used_tsg(&g->fifo, tsg); |
450 | 461 | ||
462 | tsg->runlist_id = ~0; | ||
463 | |||
451 | gk20a_dbg(gpu_dbg_fn, "tsg released %d\n", tsg->tsgid); | 464 | gk20a_dbg(gpu_dbg_fn, "tsg released %d\n", tsg->tsgid); |
452 | } | 465 | } |
453 | 466 | ||