summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/sync_gk20a.h
diff options
context:
space:
mode:
authorDebarshi Dutta <ddutta@nvidia.com>2018-03-23 06:02:27 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-04-23 00:04:48 -0400
commitd0e4dfd6efd651abc431aba9cfae5907638f8172 (patch)
tree1a412eaa4636ff2e2862c1623bad3a5ea6883d4e /drivers/gpu/nvgpu/gk20a/sync_gk20a.h
parentc918c42a4a3651f757c6966aead4b07eb4b56697 (diff)
gpu: nvgpu: sync_framework cleanups
This patch deals with cleanups meant to make things simpler for the upcoming os abstraction patches for the sync framework. This patch causes some substantial changes which are listed out as follows. 1) sync_timeline is moved out of gk20a_fence into struct nvgpu_channel_linux. New function pointers are created to facilitate os independent methods for enabling/disabling timeline and are now named as os_fence_framework. These function pointers are located in the struct os_channel under struct gk20a. 2) construction of the channel_sync require nvgpu_finalize_poweron_linux() to be invoked before invocations to nvgpu_init_mm_ce_context(). Hence, these methods are now moved away from gk20a_finalize_poweron() and invoked after nvgpu_finalize_poweron_linux(). 3) sync_fence creation is now delinked from fence construction and move to the channel_sync_gk20a's channel_incr methods. These sync_fences are mainly associated with post_fences. 4) In case userspace requires the sync_fences to be constructed, we try to obtain an fd before the gk20a_channel_submit_gpfifo() instead of trying to do that later. This is used to avoid potential after effects of duplicate work submission due to failure to obtain an unused fd. JIRA NVGPU-66 Change-Id: I42a3e4e2e692a113b1b36d2b48ab107ae4444dfa Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1678400 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/sync_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/sync_gk20a.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/sync_gk20a.h
index 8a6439ab..ffdfaec3 100644
--- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.h
@@ -34,12 +34,11 @@ struct nvgpu_semaphore;
34struct fence; 34struct fence;
35 35
36#ifdef CONFIG_SYNC 36#ifdef CONFIG_SYNC
37struct sync_timeline *gk20a_sync_timeline_create(const char *fmt, ...); 37struct sync_timeline *gk20a_sync_timeline_create(const char *name);
38void gk20a_sync_timeline_destroy(struct sync_timeline *); 38void gk20a_sync_timeline_destroy(struct sync_timeline *);
39void gk20a_sync_timeline_signal(struct sync_timeline *); 39void gk20a_sync_timeline_signal(struct sync_timeline *);
40struct sync_fence *gk20a_sync_fence_create( 40struct sync_fence *gk20a_sync_fence_create(
41 struct gk20a *g, 41 struct channel_gk20a *c,
42 struct sync_timeline *,
43 struct nvgpu_semaphore *, 42 struct nvgpu_semaphore *,
44 const char *fmt, ...); 43 const char *fmt, ...);
45struct sync_fence *gk20a_sync_fence_fdget(int fd); 44struct sync_fence *gk20a_sync_fence_fdget(int fd);
@@ -51,6 +50,10 @@ static inline struct sync_fence *gk20a_sync_fence_fdget(int fd)
51{ 50{
52 return NULL; 51 return NULL;
53} 52}
53static inline struct sync_timeline *gk20a_sync_timeline_create(
54 const char *name) {
55 return NULL;
56}
54#endif 57#endif
55 58
56#endif 59#endif