summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
diff options
context:
space:
mode:
authorSachit Kadle <skadle@nvidia.com>2016-08-22 21:06:30 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-20 11:14:04 -0400
commit63e8592e06939e20c7b9e56b430353ebbee31ad6 (patch)
treeb91247eebf886f4e987d38eb4069aceace284ecf /drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
parent3c2656c8c6ebf7cef7376d3a28451249643121c4 (diff)
gpu: nvgpu: use inplace allocation in sync framework
This change is the first of a series of changes to support the usage of pre-allocated job tracking resources in the submit path. With this change, we still maintain a dynamically-allocated joblist, but make the necessary changes in the channel_sync & fence framework to use in-place allocations. Specifically, we: 1) Update channel sync framework routines to take in pre-allocated priv_cmd_entry(s) & gk20a_fence(s) rather than dynamically allocating themselves 2) Move allocation of priv_cmd_entry(s) & gk20a_fence(s) to gk20a_submit_prepare_syncs 3) Modify fence framework to have seperate allocation and init APIs. We expose allocation as a seperate API, so the client can allocate the object before passing it into the channel sync framework. 4) Fix clean_up logic in channel sync framework Bug 1795076 Change-Id: I96db457683cd207fd029c31c45f548f98055e844 Signed-off-by: Sachit Kadle <skadle@nvidia.com> Reviewed-on: http://git-master/r/1206725 (cherry picked from commit 9d196fd10db6c2f934c2a53b1fc0500eb4626624) Reviewed-on: http://git-master/r/1223933 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
index 4b0918de..c3a92ad2 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
@@ -36,8 +36,8 @@ struct gk20a_channel_sync {
36 * cmdbuf is executed. 36 * cmdbuf is executed.
37 */ 37 */
38 int (*wait_syncpt)(struct gk20a_channel_sync *s, u32 id, u32 thresh, 38 int (*wait_syncpt)(struct gk20a_channel_sync *s, u32 id, u32 thresh,
39 struct priv_cmd_entry **entry, 39 struct priv_cmd_entry *entry,
40 struct gk20a_fence **fence); 40 struct gk20a_fence *fence);
41 41
42 /* Generate a gpu wait cmdbuf from sync fd. 42 /* Generate a gpu wait cmdbuf from sync fd.
43 * Returns 43 * Returns
@@ -46,8 +46,8 @@ struct gk20a_channel_sync {
46 * cmdbuf is executed. 46 * cmdbuf is executed.
47 */ 47 */
48 int (*wait_fd)(struct gk20a_channel_sync *s, int fd, 48 int (*wait_fd)(struct gk20a_channel_sync *s, int fd,
49 struct priv_cmd_entry **entry, 49 struct priv_cmd_entry *entry,
50 struct gk20a_fence **fence); 50 struct gk20a_fence *fence);
51 51
52 /* Increment syncpoint/semaphore. 52 /* Increment syncpoint/semaphore.
53 * Returns 53 * Returns
@@ -55,8 +55,8 @@ struct gk20a_channel_sync {
55 * - a fence that can be passed to wait_cpu() and is_expired(). 55 * - a fence that can be passed to wait_cpu() and is_expired().
56 */ 56 */
57 int (*incr)(struct gk20a_channel_sync *s, 57 int (*incr)(struct gk20a_channel_sync *s,
58 struct priv_cmd_entry **entry, 58 struct priv_cmd_entry *entry,
59 struct gk20a_fence **fence, 59 struct gk20a_fence *fence,
60 bool need_sync_fence); 60 bool need_sync_fence);
61 61
62 /* Increment syncpoint/semaphore, preceded by a wfi. 62 /* Increment syncpoint/semaphore, preceded by a wfi.
@@ -65,8 +65,8 @@ struct gk20a_channel_sync {
65 * - a fence that can be passed to wait_cpu() and is_expired(). 65 * - a fence that can be passed to wait_cpu() and is_expired().
66 */ 66 */
67 int (*incr_wfi)(struct gk20a_channel_sync *s, 67 int (*incr_wfi)(struct gk20a_channel_sync *s,
68 struct priv_cmd_entry **entry, 68 struct priv_cmd_entry *entry,
69 struct gk20a_fence **fence); 69 struct gk20a_fence *fence);
70 70
71 /* Increment syncpoint/semaphore, so that the returned fence represents 71 /* Increment syncpoint/semaphore, so that the returned fence represents
72 * work completion (may need wfi) and can be returned to user space. 72 * work completion (may need wfi) and can be returned to user space.
@@ -77,8 +77,8 @@ struct gk20a_channel_sync {
77 */ 77 */
78 int (*incr_user)(struct gk20a_channel_sync *s, 78 int (*incr_user)(struct gk20a_channel_sync *s,
79 int wait_fence_fd, 79 int wait_fence_fd,
80 struct priv_cmd_entry **entry, 80 struct priv_cmd_entry *entry,
81 struct gk20a_fence **fence, 81 struct gk20a_fence *fence,
82 bool wfi, 82 bool wfi,
83 bool need_sync_fence); 83 bool need_sync_fence);
84 84