winsys/radeon: do the CS cleanup in the CS ioctl thread
authorMarek Olšák <maraeo@gmail.com>
Wed, 3 Aug 2011 19:01:31 +0000 (21:01 +0200)
committerMarek Olšák <maraeo@gmail.com>
Fri, 5 Aug 2011 05:08:18 +0000 (07:08 +0200)
src/gallium/winsys/radeon/drm/radeon_drm_cs.c

index fec660d4cc8ba6f9cf1c1ef70b235c9193fbda08..1b30b95a318eed67303a2103861a96e02324fe24 100644 (file)
@@ -380,6 +380,8 @@ static PIPE_THREAD_ROUTINE(radeon_drm_cs_emit_ioctl, param)
 
     for (i = 0; i < csc->crelocs; i++)
         p_atomic_dec(&csc->relocs_bo[i]->num_active_ioctls);
+
+    radeon_cs_context_cleanup(csc);
     return NULL;
 }
 
@@ -424,6 +426,8 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs, unsigned flags)
         } else {
             radeon_drm_cs_emit_ioctl(cs->csc);
         }
+    } else {
+        radeon_cs_context_cleanup(cs->csc);
     }
 
     /* Flip command streams. */
@@ -432,8 +436,6 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs, unsigned flags)
     cs->cst = tmp;
 
     /* Prepare a new CS. */
-    radeon_cs_context_cleanup(cs->csc);
-
     cs->base.buf = cs->csc->buf;
     cs->base.cdw = 0;
 }