summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c21
-rw-r--r--drivers/gpu/nvgpu/gk20a/sync_gk20a.c4
3 files changed, 17 insertions, 14 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 5cd7223f..fb7406da 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -215,7 +215,8 @@ void gk20a_channel_abort_clean_up(struct channel_gk20a *ch)
215 job = &ch->joblist.pre_alloc.jobs[tmp_get]; 215 job = &ch->joblist.pre_alloc.jobs[tmp_get];
216 if (job->post_fence->semaphore) { 216 if (job->post_fence->semaphore) {
217 __nvgpu_semaphore_release( 217 __nvgpu_semaphore_release(
218 job->post_fence->semaphore, true); 218 job->post_fence->semaphore, true,
219 ch->hw_sema);
219 released_job_semaphore = true; 220 released_job_semaphore = true;
220 } 221 }
221 tmp_get = (tmp_get + 1) % ch->joblist.pre_alloc.length; 222 tmp_get = (tmp_get + 1) % ch->joblist.pre_alloc.length;
@@ -226,7 +227,8 @@ void gk20a_channel_abort_clean_up(struct channel_gk20a *ch)
226 channel_gk20a_job, list) { 227 channel_gk20a_job, list) {
227 if (job->post_fence->semaphore) { 228 if (job->post_fence->semaphore) {
228 __nvgpu_semaphore_release( 229 __nvgpu_semaphore_release(
229 job->post_fence->semaphore, true); 230 job->post_fence->semaphore, true,
231 ch->hw_sema);
230 released_job_semaphore = true; 232 released_job_semaphore = true;
231 } 233 }
232 } 234 }
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index 45d9ae9c..4b1be8b9 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -494,7 +494,7 @@ static void gk20a_channel_semaphore_launcher(
494 "wait completed (%d) for fence %p '%s', triggering gpu work", 494 "wait completed (%d) for fence %p '%s', triggering gpu work",
495 err, fence, fence->name); 495 err, fence, fence->name);
496 sync_fence_put(fence); 496 sync_fence_put(fence);
497 nvgpu_semaphore_release(w->sema); 497 nvgpu_semaphore_release(w->sema, w->ch->hw_sema);
498 nvgpu_semaphore_put(w->sema); 498 nvgpu_semaphore_put(w->sema);
499 nvgpu_kfree(g, w); 499 nvgpu_kfree(g, w);
500} 500}
@@ -522,7 +522,7 @@ static void add_sema_cmd(struct gk20a *g, struct channel_gk20a *c,
522 * incr the underlying sema next_value. 522 * incr the underlying sema next_value.
523 */ 523 */
524 if (!acquire) 524 if (!acquire)
525 nvgpu_semaphore_incr(s); 525 nvgpu_semaphore_incr(s, c->hw_sema);
526 526
527 /* semaphore_a */ 527 /* semaphore_a */
528 nvgpu_mem_wr32(g, cmd->mem, off++, 0x20010004); 528 nvgpu_mem_wr32(g, cmd->mem, off++, 0x20010004);
@@ -561,17 +561,18 @@ static void add_sema_cmd(struct gk20a *g, struct channel_gk20a *c,
561 } 561 }
562 562
563 if (acquire) 563 if (acquire)
564 gpu_sema_verbose_dbg(g, "(A) c=%d ACQ_GE %-4u owner=%-3d" 564 gpu_sema_verbose_dbg(g, "(A) c=%d ACQ_GE %-4u pool=%-3d"
565 "va=0x%llx cmd_mem=0x%llx b=0x%llx off=%u", 565 "va=0x%llx cmd_mem=0x%llx b=0x%llx off=%u",
566 ch, nvgpu_semaphore_get_value(s), 566 ch, nvgpu_semaphore_get_value(s),
567 s->hw_sema->ch->chid, va, cmd->gva, 567 s->location.pool->page_idx, va, cmd->gva,
568 cmd->mem->gpu_va, ob); 568 cmd->mem->gpu_va, ob);
569 else 569 else
570 gpu_sema_verbose_dbg(g, "(R) c=%d INCR %u (%u) va=0x%llx " 570 gpu_sema_verbose_dbg(g, "(R) c=%d INCR %u (%u) pool=%-3d"
571 "cmd_mem=0x%llx b=0x%llx off=%u", 571 "va=0x%llx cmd_mem=0x%llx b=0x%llx off=%u",
572 ch, nvgpu_semaphore_get_value(s), 572 ch, nvgpu_semaphore_get_value(s),
573 nvgpu_semaphore_read(s), va, cmd->gva, 573 nvgpu_semaphore_read(s),
574 cmd->mem->gpu_va, ob); 574 s->location.pool->page_idx,
575 va, cmd->gva, cmd->mem->gpu_va, ob);
575} 576}
576 577
577static int gk20a_channel_semaphore_wait_syncpt( 578static int gk20a_channel_semaphore_wait_syncpt(
@@ -714,7 +715,7 @@ static int gk20a_channel_semaphore_wait_fd(
714 715
715 /* worker takes one reference */ 716 /* worker takes one reference */
716 nvgpu_semaphore_get(w->sema); 717 nvgpu_semaphore_get(w->sema);
717 nvgpu_semaphore_incr(w->sema); 718 nvgpu_semaphore_incr(w->sema, c->hw_sema);
718 719
719 /* GPU unblocked when the semaphore value increments. */ 720 /* GPU unblocked when the semaphore value increments. */
720 add_sema_cmd(c->g, c, w->sema, wait_cmd, 8, true, false); 721 add_sema_cmd(c->g, c, w->sema, wait_cmd, 8, true, false);
@@ -740,7 +741,7 @@ static int gk20a_channel_semaphore_wait_fd(
740 */ 741 */
741 if (ret == 1) { 742 if (ret == 1) {
742 sync_fence_put(sync_fence); 743 sync_fence_put(sync_fence);
743 nvgpu_semaphore_release(w->sema); 744 nvgpu_semaphore_release(w->sema, c->hw_sema);
744 nvgpu_semaphore_put(w->sema); 745 nvgpu_semaphore_put(w->sema);
745 } 746 }
746 747
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c
index cd0c094f..f6d16b90 100644
--- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c
@@ -338,8 +338,8 @@ static void gk20a_sync_pt_value_str_for_sema(struct gk20a_sync_pt *pt,
338{ 338{
339 struct nvgpu_semaphore *s = pt->sema; 339 struct nvgpu_semaphore *s = pt->sema;
340 340
341 snprintf(str, size, "S: c=%d [v=%u,r_v=%u]", 341 snprintf(str, size, "S: pool=%d [v=%u,r_v=%u]",
342 s->hw_sema->ch->chid, 342 s->location.pool->page_idx,
343 nvgpu_semaphore_get_value(s), 343 nvgpu_semaphore_get_value(s),
344 nvgpu_semaphore_read(s)); 344 nvgpu_semaphore_read(s));
345} 345}