From 34323b559590ed8f1c64ecbb7ffbd838a6478594 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 13 Mar 2018 16:58:01 +0200 Subject: gpu: nvgpu: wait for all prefence semas on gpu The pre-fence wait for semaphores in the submit path has supported a fast path for fences that have only one underlying semaphore. The fast path just inserts the wait on this sema to the pushbuffer directly. For other fences, the path has been using a CPU wait indirection, signaling another semaphore when we get the CPU-side callback. Instead of only supporting prefences with one sema, unroll all the individual semaphores and insert waits for each to a pushbuffer, like we've already been doing with syncpoints. Now all sema-backed syncs get the fast path. This simplifies the logic and makes it more explicit that only foreign fences need the CPU wait. There is no need to hold references to the sync fence or the semas inside: this submitted job only needs the global read-only sema mapping that is guaranteed to stay alive while the VM of this channel stays alive, and the job does not outlive this channel. Jira NVGPU-43 Jira NVGPU-66 Jira NVGPU-513 Change-Id: I7cfbb510001d998a864aed8d6afd1582b9adb80d Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1636345 Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/sync_gk20a.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/sync_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/sync_gk20a.h index 7d7aff6d..8a6439ab 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.h @@ -3,7 +3,7 @@ * * GK20A Sync Framework Integration * - * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -33,9 +33,6 @@ struct sync_pt; struct nvgpu_semaphore; struct fence; -int gk20a_is_sema_backed_sync_fence(struct sync_fence *fence); -struct nvgpu_semaphore *gk20a_sync_fence_get_sema(struct sync_fence *f); - #ifdef CONFIG_SYNC struct sync_timeline *gk20a_sync_timeline_create(const char *fmt, ...); void gk20a_sync_timeline_destroy(struct sync_timeline *); @@ -46,6 +43,7 @@ struct sync_fence *gk20a_sync_fence_create( struct nvgpu_semaphore *, const char *fmt, ...); struct sync_fence *gk20a_sync_fence_fdget(int fd); +struct nvgpu_semaphore *gk20a_sync_pt_sema(struct sync_pt *spt); #else static inline void gk20a_sync_timeline_destroy(struct sync_timeline *obj) {} static inline void gk20a_sync_timeline_signal(struct sync_timeline *obj) {} -- cgit v1.2.2