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>
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;
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),