radeong: do not emit a zero-sized command stream
authorMarek Olšák <maraeo@gmail.com>
Sat, 23 Jan 2010 16:19:44 +0000 (17:19 +0100)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 25 Jan 2010 07:03:29 +0000 (23:03 -0800)
Fixing a hardlock introduced in fcbd285e421903ee0a65f19f5d633b25b5923c24 and
reproducible with piglit/bugs/fdo23489.

src/gallium/winsys/drm/radeon/core/radeon_r300.c

index 0875ee41cbfd76d0311258cd5871331f44bff330..0253bc2527e5974e83f0310c8a750535585c000b 100644 (file)
@@ -108,6 +108,11 @@ static void radeon_flush_cs(struct radeon_winsys* winsys)
 {
     int retval;
 
+    /* Don't flush a zero-sized CS. */
+    if (!winsys->priv->cs->cdw) {
+        return;
+    }
+
     /* Emit the CS. */
     retval = radeon_cs_emit(winsys->priv->cs);
     if (retval) {