summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2014-07-14 06:41:27 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:32 -0400
commit5312fd2a1852cd965c8aea473aa357f4d9d65318 (patch)
treec43f00797db1ce93854676d8fed82b9721931e31 /drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
parent4cb6f6b357963b2eab6a0d02974a6f64c874bd89 (diff)
gpu: nvgpu: Double syncpoint increments
gm20b/gm20x requires incrementing syncpoints twice to ensure that the data has reached memory in all cases. This patch modifies increment push buffer to account this requirement. Bug 1491360 Change-Id: I5c2899b26ce0e1cdf9408bb9aaa576fc3054480f Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: http://git-master/r/437675 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index a6ca8214..0dcc5abb 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -192,7 +192,7 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s,
192 container_of(s, struct gk20a_channel_syncpt, ops); 192 container_of(s, struct gk20a_channel_syncpt, ops);
193 struct channel_gk20a *c = sp->c; 193 struct channel_gk20a *c = sp->c;
194 194
195 incr_cmd_size = 4; 195 incr_cmd_size = 6;
196 if (wfi_cmd) 196 if (wfi_cmd)
197 incr_cmd_size += 2; 197 incr_cmd_size += 2;
198 198
@@ -203,6 +203,8 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s,
203 return -EAGAIN; 203 return -EAGAIN;
204 } 204 }
205 205
206 /* WAR for hw bug 1491360: syncpt needs to be incremented twice */
207
206 if (gfx_class) { 208 if (gfx_class) {
207 WARN_ON(wfi_cmd); /* No sense to use gfx class + wfi. */ 209 WARN_ON(wfi_cmd); /* No sense to use gfx class + wfi. */
208 /* setobject KEPLER_C */ 210 /* setobject KEPLER_C */
@@ -212,6 +214,10 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s,
212 incr_cmd->ptr[j++] = 0x200100B2; 214 incr_cmd->ptr[j++] = 0x200100B2;
213 incr_cmd->ptr[j++] = sp->id | 215 incr_cmd->ptr[j++] = sp->id |
214 (0x1 << 20) | (0x1 << 16); 216 (0x1 << 20) | (0x1 << 16);
217 /* syncpt incr */
218 incr_cmd->ptr[j++] = 0x200100B2;
219 incr_cmd->ptr[j++] = sp->id |
220 (0x1 << 20) | (0x1 << 16);
215 } else { 221 } else {
216 if (wfi_cmd) { 222 if (wfi_cmd) {
217 /* wfi */ 223 /* wfi */
@@ -227,10 +233,14 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s,
227 incr_cmd->ptr[j++] = 0x2001001D; 233 incr_cmd->ptr[j++] = 0x2001001D;
228 /* syncpt_id, incr */ 234 /* syncpt_id, incr */
229 incr_cmd->ptr[j++] = (sp->id << 8) | 0x1; 235 incr_cmd->ptr[j++] = (sp->id << 8) | 0x1;
236 /* syncpoint_b */
237 incr_cmd->ptr[j++] = 0x2001001D;
238 /* syncpt_id, incr */
239 incr_cmd->ptr[j++] = (sp->id << 8) | 0x1;
230 } 240 }
231 WARN_ON(j != incr_cmd_size); 241 WARN_ON(j != incr_cmd_size);
232 242
233 thresh = nvhost_syncpt_incr_max_ext(sp->host1x_pdev, sp->id, 1); 243 thresh = nvhost_syncpt_incr_max_ext(sp->host1x_pdev, sp->id, 2);
234 244
235 if (register_irq) { 245 if (register_irq) {
236 err = nvhost_intr_register_notifier(sp->host1x_pdev, 246 err = nvhost_intr_register_notifier(sp->host1x_pdev,