diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index e4972610e..98363c88b 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c @@ -605,7 +605,7 @@ static int gk20a_channel_semaphore_wait_fd( *fence = gk20a_fence_from_semaphore(sema->timeline, fp_sema, &c->semaphore_wq, - NULL, false); + NULL, false, false); else /* * Allocate an empty fence. It will instantly return @@ -676,7 +676,7 @@ static int gk20a_channel_semaphore_wait_fd( semaphore while the job is in flight. */ *fence = gk20a_fence_from_semaphore(sema->timeline, w->sema, &c->semaphore_wq, - NULL, false); + NULL, false, false); skip_slow_path: *entry = wait_cmd; @@ -734,7 +734,8 @@ static int __gk20a_channel_semaphore_incr( *fence = gk20a_fence_from_semaphore(sp->timeline, semaphore, &c->semaphore_wq, - dependency, wfi_cmd); + dependency, wfi_cmd, + need_sync_fence); *entry = incr_cmd; return 0; } diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index fbbaa2a7a..596dc549c 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c @@ -148,17 +148,19 @@ struct gk20a_fence *gk20a_fence_from_semaphore( struct gk20a_semaphore *semaphore, wait_queue_head_t *semaphore_wq, struct sync_fence *dependency, - bool wfi) + bool wfi, bool need_sync_fence) { struct gk20a_fence *f; struct sync_fence *sync_fence = NULL; #ifdef CONFIG_SYNC - sync_fence = gk20a_sync_fence_create(timeline, semaphore, + if (need_sync_fence) { + sync_fence = gk20a_sync_fence_create(timeline, semaphore, dependency, "f-gk20a-0x%04x", gk20a_semaphore_gpu_ro_va(semaphore)); - if (!sync_fence) - return NULL; + if (!sync_fence) + return NULL; + } #endif f = gk20a_alloc_fence(&gk20a_semaphore_fence_ops, sync_fence, wfi); diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.h b/drivers/gpu/nvgpu/gk20a/fence_gk20a.h index ff00bcf1a..35488ea36 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.h @@ -52,7 +52,7 @@ struct gk20a_fence *gk20a_fence_from_semaphore( struct gk20a_semaphore *semaphore, wait_queue_head_t *semaphore_wq, struct sync_fence *dependency, - bool wfi); + bool wfi, bool need_sync_fence); struct gk20a_fence *gk20a_fence_from_syncpt( struct platform_device *host1x_pdev,