From 78bfe292b1604ea114c88edc55c852b78cd15269 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Mon, 10 Sep 2012 17:00:30 +0200 Subject: [PATCH] drm/radeon: make 64bit fences more robust (backported) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of Christian König's patch 09e3cdb92c73a3c77a4f9f3b8f9c2d24be47fe89 from https://bugs.freedesktop.org/show_bug.cgi?id=54129#c11 Signed-off-by: Tormod Volden --- drivers/gpu/drm/radeon/radeon_fence.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 11f5f40..7dd2fd5 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c @@ -104,7 +104,7 @@ void radeon_fence_process(struct radeon_device *rdev, int ring) do { seq = radeon_fence_read(rdev, ring); seq |= last_seq & 0xffffffff00000000LL; - if (seq < last_seq) { + if (seq < (last_seq - 0x80000000LL)) { seq += 0x100000000LL; } @@ -549,8 +549,8 @@ static void radeon_fence_driver_init_ring(struct radeon_device *rdev, int ring) rdev->fence_drv[ring].scratch_reg = -1; rdev->fence_drv[ring].cpu_addr = NULL; rdev->fence_drv[ring].gpu_addr = 0; - rdev->fence_drv[ring].seq = 0; - atomic64_set(&rdev->fence_drv[ring].last_seq, 0); + rdev->fence_drv[ring].seq = 0x100000000LL; + atomic64_set(&rdev->fence_drv[ring].last_seq, 0x100000000LL); rdev->fence_drv[ring].last_activity = jiffies; rdev->fence_drv[ring].initialized = false; } -- 1.7.9.5