From 85059964307c3f10e4a328d82af2bb791a5a4927 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 23 Jan 2010 17:19:44 +0100 Subject: [PATCH] radeong: do not emit a zero-sized command stream Fixing a hardlock introduced in fcbd285e421903ee0a65f19f5d633b25b5923c24 and reproducible with piglit/bugs/fdo23489. --- src/gallium/winsys/drm/radeon/core/radeon_r300.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c index 0875ee41cbf..0253bc2527e 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c @@ -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) { -- 2.11.0