From 8737d17a45e04d7c111abb5e79e48577b224fae6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <deathsimple@vodafone.de>
Date: Sun, 9 Sep 2012 11:45:19 +0200
Subject: [PATCH] drm/radeon: make 64bit fences more robust v2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Only increase the higher 32bits if we really detect a wrap around.
v2: instead of increasing the higher 32bits just use the higher
32bits from the last emitted fence.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Cc: stable@vger.kernel.org
---
drivers/gpu/drm/radeon/radeon_fence.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
@@ -161,10 +161,12 @@ void radeon_fence_process(struct radeon_device *rdev, int ring)
seq = radeon_fence_read(rdev, ring);
seq |= last_seq & 0xffffffff00000000LL;
if (seq < last_seq) {
- seq += 0x100000000LL;
+ seq &= 0xffffffff;
+ seq |= rdev->fence_drv[ring].sync_seq[ring] &
+ 0xffffffff00000000LL;
}
- if (seq == last_seq) {
+ if (seq <= last_seq) {
break;
}
/* If we loop over we don't want to return without
--
1.7.9.5