summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-08-11 19:40:35 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-16 00:58:36 -0400
commit9bd76b7fa08672181c2a0cce747a59664e226964 (patch)
tree3439f5e1354d5e23bcb7da98773f123e815eb9fe /drivers/gpu/nvgpu/gk20a/fence_gk20a.c
parentf919aab509aea3753785c2e1481b96d4daf7e4a8 (diff)
gpu: nvgpu: Optimize sync fence creation
Only create sync-fences in the semaphore synchronization path when they are actually needed (i.e requested by userspace). Bug 1795076 Reviewed-on: http://git-master/r/1201564 (cherry picked from commit dc52d424a839e6c064c02b7f02905dd6a59a50af) Change-Id: Ieac6aef415678d4ea982683a955897c64959436e Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1221041 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fence_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
index fbbaa2a7..596dc549 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(
148 struct gk20a_semaphore *semaphore, 148 struct gk20a_semaphore *semaphore,
149 wait_queue_head_t *semaphore_wq, 149 wait_queue_head_t *semaphore_wq,
150 struct sync_fence *dependency, 150 struct sync_fence *dependency,
151 bool wfi) 151 bool wfi, bool need_sync_fence)
152{ 152{
153 struct gk20a_fence *f; 153 struct gk20a_fence *f;
154 struct sync_fence *sync_fence = NULL; 154 struct sync_fence *sync_fence = NULL;
155 155
156#ifdef CONFIG_SYNC 156#ifdef CONFIG_SYNC
157 sync_fence = gk20a_sync_fence_create(timeline, semaphore, 157 if (need_sync_fence) {
158 sync_fence = gk20a_sync_fence_create(timeline, semaphore,
158 dependency, "f-gk20a-0x%04x", 159 dependency, "f-gk20a-0x%04x",
159 gk20a_semaphore_gpu_ro_va(semaphore)); 160 gk20a_semaphore_gpu_ro_va(semaphore));
160 if (!sync_fence) 161 if (!sync_fence)
161 return NULL; 162 return NULL;
163 }
162#endif 164#endif
163 165
164 f = gk20a_alloc_fence(&gk20a_semaphore_fence_ops, sync_fence, wfi); 166 f = gk20a_alloc_fence(&gk20a_semaphore_fence_ops, sync_fence, wfi);