aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-26 04:23:54 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-08-01 20:12:26 -0400
commit05991110cf94117dd488f6d64dabdea56ff35107 (patch)
tree723b3fdb4ae0c9cca37049524dfdcd2142895882
parent0ccb3a75fe81ec3c4ceb7344c34d0497cbabb369 (diff)
drm/nouveau: set TASK_(UN)INTERRUPTIBLE before schedule_timeout()
set_current_state() is called only once before the first iteration. After return from schedule_timeout() current state is TASK_RUNNING. If we are going to wait again, set_current_state() must be called. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fence.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c
index 813d853b741b..6b208ffafa8d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fence.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fence.c
@@ -186,8 +186,6 @@ nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
186 unsigned long timeout = jiffies + (3 * DRM_HZ); 186 unsigned long timeout = jiffies + (3 * DRM_HZ);
187 int ret = 0; 187 int ret = 0;
188 188
189 __set_current_state(intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
190
191 while (1) { 189 while (1) {
192 if (nouveau_fence_signalled(sync_obj, sync_arg)) 190 if (nouveau_fence_signalled(sync_obj, sync_arg))
193 break; 191 break;
@@ -197,6 +195,8 @@ nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
197 break; 195 break;
198 } 196 }
199 197
198 __set_current_state(intr ? TASK_INTERRUPTIBLE
199 : TASK_UNINTERRUPTIBLE);
200 if (lazy) 200 if (lazy)
201 schedule_timeout(1); 201 schedule_timeout(1);
202 202