summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
index 90b61bfd..baa4a151 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
@@ -23,11 +23,13 @@
23struct gk20a_channel_sync; 23struct gk20a_channel_sync;
24struct priv_cmd_entry; 24struct priv_cmd_entry;
25struct channel_gk20a; 25struct channel_gk20a;
26struct gk20a_semaphore;
26 27
27struct gk20a_channel_fence { 28struct gk20a_channel_fence {
28 bool valid; 29 bool valid;
29 bool wfi; /* was issued with preceding wfi */ 30 bool wfi; /* was issued with preceding wfi */
30 u32 thresh; /* either semaphore or syncpoint value */ 31 u32 thresh; /* syncpoint fences only */
32 struct gk20a_semaphore *semaphore; /* semaphore fences only */
31}; 33};
32 34
33struct gk20a_channel_sync { 35struct gk20a_channel_sync {
@@ -43,11 +45,13 @@ struct gk20a_channel_sync {
43 45
44 /* Generate a gpu wait cmdbuf from syncpoint. */ 46 /* Generate a gpu wait cmdbuf from syncpoint. */
45 int (*wait_syncpt)(struct gk20a_channel_sync *s, u32 id, u32 thresh, 47 int (*wait_syncpt)(struct gk20a_channel_sync *s, u32 id, u32 thresh,
46 struct priv_cmd_entry **entry); 48 struct priv_cmd_entry **entry,
49 struct gk20a_channel_fence *fence);
47 50
48 /* Generate a gpu wait cmdbuf from sync fd. */ 51 /* Generate a gpu wait cmdbuf from sync fd. */
49 int (*wait_fd)(struct gk20a_channel_sync *s, int fd, 52 int (*wait_fd)(struct gk20a_channel_sync *s, int fd,
50 struct priv_cmd_entry **entry); 53 struct priv_cmd_entry **entry,
54 struct gk20a_channel_fence *fence);
51 55
52 /* Increment syncpoint/semaphore. 56 /* Increment syncpoint/semaphore.
53 * Returns 57 * Returns
@@ -88,6 +92,7 @@ struct gk20a_channel_sync {
88 * - a sync fd that can be returned to user space. 92 * - a sync fd that can be returned to user space.
89 */ 93 */
90 int (*incr_user_fd)(struct gk20a_channel_sync *s, 94 int (*incr_user_fd)(struct gk20a_channel_sync *s,
95 int wait_fence_fd,
91 struct priv_cmd_entry **entry, 96 struct priv_cmd_entry **entry,
92 struct gk20a_channel_fence *fence, 97 struct gk20a_channel_fence *fence,
93 bool wfi, 98 bool wfi,
@@ -96,12 +101,16 @@ struct gk20a_channel_sync {
96 /* Reset the channel syncpoint/semaphore. */ 101 /* Reset the channel syncpoint/semaphore. */
97 void (*set_min_eq_max)(struct gk20a_channel_sync *s); 102 void (*set_min_eq_max)(struct gk20a_channel_sync *s);
98 103
99 /* flag to set syncpt destroy aggressiveness */ 104 /* flag to set sync destroy aggressiveness */
100 bool syncpt_aggressive_destroy; 105 bool aggressive_destroy;
101 106
102 /* Free the resources allocated by gk20a_channel_sync_create. */ 107 /* Free the resources allocated by gk20a_channel_sync_create. */
103 void (*destroy)(struct gk20a_channel_sync *s); 108 void (*destroy)(struct gk20a_channel_sync *s);
104}; 109};
105 110
106struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c); 111struct gk20a_channel_sync *gk20a_channel_sync_create(struct channel_gk20a *c);
112
113void gk20a_channel_fence_close(struct gk20a_channel_fence *f);
114void gk20a_channel_fence_dup(struct gk20a_channel_fence *from,
115 struct gk20a_channel_fence *to);
107#endif 116#endif