aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_fence.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fence.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_fence.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 01a89633e26..3beb26d7471 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -171,17 +171,8 @@ bool radeon_fence_signaled(struct radeon_fence *fence)
171int r600_fence_wait(struct radeon_fence *fence, bool intr, bool lazy) 171int r600_fence_wait(struct radeon_fence *fence, bool intr, bool lazy)
172{ 172{
173 struct radeon_device *rdev; 173 struct radeon_device *rdev;
174 unsigned long cur_jiffies;
175 unsigned long timeout;
176 int ret = 0; 174 int ret = 0;
177 175
178 cur_jiffies = jiffies;
179 timeout = HZ / 100;
180
181 if (time_after(fence->timeout, cur_jiffies)) {
182 timeout = fence->timeout - cur_jiffies;
183 }
184
185 rdev = fence->rdev; 176 rdev = fence->rdev;
186 177
187 __set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); 178 __set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
@@ -190,7 +181,7 @@ int r600_fence_wait(struct radeon_fence *fence, bool intr, bool lazy)
190 if (radeon_fence_signaled(fence)) 181 if (radeon_fence_signaled(fence))
191 break; 182 break;
192 183
193 if (time_after_eq(jiffies, timeout)) { 184 if (time_after_eq(jiffies, fence->timeout)) {
194 ret = -EBUSY; 185 ret = -EBUSY;
195 break; 186 break;
196 } 187 }