summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/tegra/host/host1x/host1x_syncpt.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/video/tegra/host/host1x/host1x_syncpt.c b/drivers/video/tegra/host/host1x/host1x_syncpt.c
index 14ee3c0bd663..b0fd9970aaa0 100644
--- a/drivers/video/tegra/host/host1x/host1x_syncpt.c
+++ b/drivers/video/tegra/host/host1x/host1x_syncpt.c
@@ -97,19 +97,6 @@ static void t20_syncpt_cpu_incr(struct nvhost_syncpt *sp, u32 id)
wmb();
}
-/* returns true, if a <= b < c using wrapping comparison */
-static inline bool nvhost_syncpt_is_between(u32 a, u32 b, u32 c)
-{
- return b-a < c-a;
-}
-
-/* returns true, if syncpt >= threshold (mod 1 << 32) */
-static bool nvhost_syncpt_wrapping_comparison(u32 syncpt, u32 threshold)
-{
- return nvhost_syncpt_is_between(threshold, syncpt,
- (1UL<<31UL)+threshold);
-}
-
/* check for old WAITs to be removed (avoiding a wrap) */
static int t20_syncpt_wait_check(struct nvhost_syncpt *sp,
struct nvmap_client *nvmap,
@@ -130,12 +117,11 @@ static int t20_syncpt_wait_check(struct nvhost_syncpt *sp,
/* compare syncpt vs wait threshold */
while (num_waitchk) {
- u32 syncpt, override;
+ u32 override;
BUG_ON(wait->syncpt_id >= NV_HOST1X_SYNCPT_NB_PTS);
-
- syncpt = atomic_read(&sp->min_val[wait->syncpt_id]);
- if (nvhost_syncpt_wrapping_comparison(syncpt, wait->thresh)) {
+ if (nvhost_syncpt_is_expired(sp,
+ wait->syncpt_id, wait->thresh)) {
/*
* NULL an already satisfied WAIT_SYNCPT host method,
* by patching its args in the command stream. The
@@ -145,10 +131,11 @@ static int t20_syncpt_wait_check(struct nvhost_syncpt *sp,
* is guaranteed to be popped by the host HW.
*/
dev_dbg(&syncpt_to_dev(sp)->dev->dev,
- "drop WAIT id %d (%s) thresh 0x%x, syncpt 0x%x\n",
+ "drop WAIT id %d (%s) thresh 0x%x, min 0x%x\n",
wait->syncpt_id,
syncpt_op(sp).name(sp, wait->syncpt_id),
- wait->thresh, syncpt);
+ wait->thresh,
+ nvhost_syncpt_read_min(sp, wait->syncpt_id));
/* patch the wait */
override = nvhost_class_host_wait_syncpt(