summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-07-28 14:22:53 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-16 00:58:37 -0400
commit7b8cbd2be37643e755ccb204e38c20b17aac28bd (patch)
tree9605958d7a7de7762276c8f1c3be5e44dc2567b4 /drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
parent9bd76b7fa08672181c2a0cce747a59664e226964 (diff)
gpu: nvgpu: Greatly simplify the semaphore detection
Greatly simplify and make more robust the gpu semaphore detection in sync_fences. Instead of using a magic number use the parent timeline of sync_pts. This will also work with multi-GPU setups using nvgpu since the timeline ops pointer will be the same across all instances of nvgpu. Bug 1732449 Reviewed-on: http://git-master/r/1203834 (cherry picked from commit 66eeb577eae5d10741fd15f3659e843c70792cd6) Change-Id: I4c6619d70b5531e2676e18d1330724e8f8b9bcb3 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1221042 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index 98363c88..0eff4e2f 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -510,24 +510,7 @@ static int gk20a_channel_semaphore_wait_syncpt(
510 return -ENODEV; 510 return -ENODEV;
511} 511}
512 512
513/*
514 * UGHHH - the sync_fence underlying implementation changes from 3.10 to 3.18.
515 * But since there's no API for getting the underlying sync_pts we have to do
516 * some conditional compilation.
517 */
518#ifdef CONFIG_SYNC 513#ifdef CONFIG_SYNC
519static struct gk20a_semaphore *sema_from_sync_fence(struct sync_fence *f)
520{
521#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
522 struct sync_pt *pt;
523
524 pt = list_first_entry(&f->pt_list_head, struct sync_pt, pt_list);
525 return gk20a_sync_pt_inst_get_sema(pt);
526#else
527 return gk20a_sync_pt_inst_get_sema(f->cbs[0].sync_pt);
528#endif
529}
530
531/* 514/*
532 * Attempt a fast path for waiting on a sync_fence. Basically if the passed 515 * Attempt a fast path for waiting on a sync_fence. Basically if the passed
533 * sync_fence is backed by a gk20a_semaphore then there's no reason to go 516 * sync_fence is backed by a gk20a_semaphore then there's no reason to go
@@ -551,7 +534,7 @@ static int __semaphore_wait_fd_fast_path(struct channel_gk20a *c,
551 if (!gk20a_is_sema_backed_sync_fence(fence)) 534 if (!gk20a_is_sema_backed_sync_fence(fence))
552 return -ENODEV; 535 return -ENODEV;
553 536
554 sema = sema_from_sync_fence(fence); 537 sema = gk20a_sync_fence_get_sema(fence);
555 538
556 /* 539 /*
557 * If there's no underlying sema then that means the underlying sema has 540 * If there's no underlying sema then that means the underlying sema has