diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/sync_gk20a.c | 14 |
2 files changed, 13 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 746a2de3..622f438c 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -91,7 +91,6 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, | |||
91 | #ifdef CONFIG_SYNC | 91 | #ifdef CONFIG_SYNC |
92 | int i; | 92 | int i; |
93 | int num_wait_cmds; | 93 | int num_wait_cmds; |
94 | struct sync_pt *pt; | ||
95 | struct sync_fence *sync_fence; | 94 | struct sync_fence *sync_fence; |
96 | struct priv_cmd_entry *wait_cmd = NULL; | 95 | struct priv_cmd_entry *wait_cmd = NULL; |
97 | struct gk20a_channel_syncpt *sp = | 96 | struct gk20a_channel_syncpt *sp = |
@@ -103,7 +102,8 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, | |||
103 | return -EINVAL; | 102 | return -EINVAL; |
104 | 103 | ||
105 | /* validate syncpt ids */ | 104 | /* validate syncpt ids */ |
106 | list_for_each_entry(pt, &sync_fence->pt_list_head, pt_list) { | 105 | for (i = 0; i < sync_fence->num_fences; i++) { |
106 | struct sync_pt *pt = sync_pt_from_fence(sync_fence->cbs[i].sync_pt); | ||
107 | u32 wait_id = nvhost_sync_pt_id(pt); | 107 | u32 wait_id = nvhost_sync_pt_id(pt); |
108 | if (!wait_id || | 108 | if (!wait_id || |
109 | wait_id >= nvhost_syncpt_nb_pts_ext(sp->host1x_pdev)) { | 109 | wait_id >= nvhost_syncpt_nb_pts_ext(sp->host1x_pdev)) { |
@@ -122,7 +122,9 @@ static int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, | |||
122 | } | 122 | } |
123 | 123 | ||
124 | i = 0; | 124 | i = 0; |
125 | list_for_each_entry(pt, &sync_fence->pt_list_head, pt_list) { | 125 | for (i = 0; i < sync_fence->num_fences; i++) { |
126 | struct fence *f = sync_fence->cbs[i].sync_pt; | ||
127 | struct sync_pt *pt = sync_pt_from_fence(f); | ||
126 | u32 wait_id = nvhost_sync_pt_id(pt); | 128 | u32 wait_id = nvhost_sync_pt_id(pt); |
127 | u32 wait_value = nvhost_sync_pt_thresh(pt); | 129 | u32 wait_value = nvhost_sync_pt_thresh(pt); |
128 | 130 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c index 46d0addf..5e15cd5f 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c | |||
@@ -141,7 +141,7 @@ static struct gk20a_sync_pt *gk20a_sync_pt_create_shared( | |||
141 | 141 | ||
142 | /* Store the dependency fence for this pt. */ | 142 | /* Store the dependency fence for this pt. */ |
143 | if (dependency) { | 143 | if (dependency) { |
144 | if (dependency->status == 0) { | 144 | if (!atomic_read(&dependency->status)) { |
145 | shared->dep = dependency; | 145 | shared->dep = dependency; |
146 | } else { | 146 | } else { |
147 | shared->dep_timestamp = ktime_get(); | 147 | shared->dep_timestamp = ktime_get(); |
@@ -198,7 +198,6 @@ static int gk20a_sync_pt_has_signaled(struct sync_pt *sync_pt) | |||
198 | { | 198 | { |
199 | struct gk20a_sync_pt *pt = to_gk20a_sync_pt(sync_pt); | 199 | struct gk20a_sync_pt *pt = to_gk20a_sync_pt(sync_pt); |
200 | struct gk20a_sync_timeline *obj = pt->obj; | 200 | struct gk20a_sync_timeline *obj = pt->obj; |
201 | struct sync_pt *pos; | ||
202 | bool signaled; | 201 | bool signaled; |
203 | 202 | ||
204 | if (!pt->sema) | 203 | if (!pt->sema) |
@@ -217,9 +216,12 @@ static int gk20a_sync_pt_has_signaled(struct sync_pt *sync_pt) | |||
217 | * first.*/ | 216 | * first.*/ |
218 | if (pt->dep) { | 217 | if (pt->dep) { |
219 | s64 ns = 0; | 218 | s64 ns = 0; |
220 | struct list_head *dep_pts = &pt->dep->pt_list_head; | 219 | struct fence *fence; |
221 | list_for_each_entry(pos, dep_pts, pt_list) { | 220 | int i; |
222 | ns = max(ns, ktime_to_ns(pos->timestamp)); | 221 | |
222 | for (i = 0; i < pt->dep->num_fences; i++) { | ||
223 | fence = pt->dep->cbs[i].sync_pt; | ||
224 | ns = max(ns, ktime_to_ns(fence->timestamp)); | ||
223 | } | 225 | } |
224 | pt->dep_timestamp = ns_to_ktime(ns); | 226 | pt->dep_timestamp = ns_to_ktime(ns); |
225 | sync_fence_put(pt->dep); | 227 | sync_fence_put(pt->dep); |
@@ -238,7 +240,7 @@ static inline ktime_t gk20a_sync_pt_duration(struct sync_pt *sync_pt) | |||
238 | struct gk20a_sync_pt *pt = to_gk20a_sync_pt(sync_pt); | 240 | struct gk20a_sync_pt *pt = to_gk20a_sync_pt(sync_pt); |
239 | if (!gk20a_sync_pt_has_signaled(sync_pt) || !pt->dep_timestamp.tv64) | 241 | if (!gk20a_sync_pt_has_signaled(sync_pt) || !pt->dep_timestamp.tv64) |
240 | return ns_to_ktime(0); | 242 | return ns_to_ktime(0); |
241 | return ktime_sub(sync_pt->timestamp, pt->dep_timestamp); | 243 | return ktime_sub(sync_pt->base.timestamp, pt->dep_timestamp); |
242 | } | 244 | } |
243 | 245 | ||
244 | static int gk20a_sync_pt_compare(struct sync_pt *a, struct sync_pt *b) | 246 | static int gk20a_sync_pt_compare(struct sync_pt *a, struct sync_pt *b) |