From 5312fd2a1852cd965c8aea473aa357f4d9d65318 Mon Sep 17 00:00:00 2001 From: Arto Merilainen Date: Mon, 14 Jul 2014 13:41:27 +0300 Subject: 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 Reviewed-on: http://git-master/r/437675 Reviewed-by: Automatic_Commit_Validation_User --- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 14 ++++++++++++-- 1 file 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, container_of(s, struct gk20a_channel_syncpt, ops); struct channel_gk20a *c = sp->c; - incr_cmd_size = 4; + incr_cmd_size = 6; if (wfi_cmd) incr_cmd_size += 2; @@ -203,6 +203,8 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s, return -EAGAIN; } + /* WAR for hw bug 1491360: syncpt needs to be incremented twice */ + if (gfx_class) { WARN_ON(wfi_cmd); /* No sense to use gfx class + wfi. */ /* setobject KEPLER_C */ @@ -212,6 +214,10 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s, incr_cmd->ptr[j++] = 0x200100B2; incr_cmd->ptr[j++] = sp->id | (0x1 << 20) | (0x1 << 16); + /* syncpt incr */ + incr_cmd->ptr[j++] = 0x200100B2; + incr_cmd->ptr[j++] = sp->id | + (0x1 << 20) | (0x1 << 16); } else { if (wfi_cmd) { /* wfi */ @@ -227,10 +233,14 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s, incr_cmd->ptr[j++] = 0x2001001D; /* syncpt_id, incr */ incr_cmd->ptr[j++] = (sp->id << 8) | 0x1; + /* syncpoint_b */ + incr_cmd->ptr[j++] = 0x2001001D; + /* syncpt_id, incr */ + incr_cmd->ptr[j++] = (sp->id << 8) | 0x1; } WARN_ON(j != incr_cmd_size); - thresh = nvhost_syncpt_incr_max_ext(sp->host1x_pdev, sp->id, 1); + thresh = nvhost_syncpt_incr_max_ext(sp->host1x_pdev, sp->id, 2); if (register_irq) { err = nvhost_intr_register_notifier(sp->host1x_pdev, -- cgit v1.2.2