From 54bc32abd5b84db4214d4e6339b4b7bd7fc9b798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Sun, 9 Sep 2012 11:45:19 +0200 Subject: [PATCH] drm/radeon: make 64bit fences more robust v2 (backported) 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 Cc: stable@vger.kernel.org [Tormod: attempted port to 3.5 kernel] Signed-off-by: Tormod Volden --- drivers/gpu/drm/radeon/radeon_fence.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 11f5f40..a8f1ff9 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -105,10 +105,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].seq & + 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