]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: Skip expired pre-fences
authorArto Merilainen <amerilainen@nvidia.com>
Mon, 10 Mar 2014 14:51:44 +0000 (16:51 +0200)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Wed, 12 Mar 2014 06:34:37 +0000 (23:34 -0700)
Currently, nvhost pushes pre-fence waits always to the channel -
even if the fence would already be passed. In rare cases this causes
a wrapping issue when the hardware does not recognise that the
syncpoint threshold has already passed.

This patch modifies the code so that we check the fence value before
pushing the wait to the push buffer.

Bug 1477471

Change-Id: Ifdc62fd417c50ee321a0e07621a612d0787920d5
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/379573
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/host1x/host1x_channel.c

index 3160bfb4a51aa023a77510b5124f9b42b4239e13..3896e2c6347dc22cf1c2e9561d15cd7316bba953 100644 (file)
@@ -116,6 +116,8 @@ static void submit_ctxsave(struct nvhost_job *job, struct nvhost_hwctx *cur_ctx)
 
 static void add_sync_waits(struct nvhost_channel *ch, int fd)
 {
+       struct nvhost_master *host = nvhost_get_host(ch->dev);
+       struct nvhost_syncpt *sp = &host->syncpt;
        struct sync_fence *fence;
        struct sync_pt *_pt;
        struct nvhost_sync_pt *pt;
@@ -146,6 +148,9 @@ static void add_sync_waits(struct nvhost_channel *ch, int fd)
                id = nvhost_sync_pt_id(pt);
                thresh = nvhost_sync_pt_thresh(pt);
 
+               if (nvhost_syncpt_is_expired(sp, id, thresh))
+                       continue;
+
                nvhost_cdma_push(&ch->cdma,
                        nvhost_opcode_setclass(NV_HOST1X_CLASS_ID,
                                host1x_uclass_wait_syncpt_r(), 1),