summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/drm/radeon
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2009-12-02 17:15:27 +0100
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-12-04 09:23:59 -0800
commit7679447b5835fd73ab44b3d77b12a034c95af5c5 (patch)
treeb057715b502d4df1c52da20719cd85535b7cc1b8 /src/gallium/winsys/drm/radeon
parent3da8265cd3233e2b22ab0f8a28fbba892984e399 (diff)
r300g, radeong: fix the CS overflow
Diffstat (limited to 'src/gallium/winsys/drm/radeon')
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_r300.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
index 7362279b77..ba0596c30d 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
@@ -52,8 +52,9 @@ static boolean radeon_validate(struct radeon_winsys* winsys)
static boolean radeon_check_cs(struct radeon_winsys* winsys, int size)
{
- /* XXX check size here, lazy ass! */
- return radeon_validate(winsys);
+ struct radeon_cs* cs = winsys->priv->cs;
+
+ return radeon_validate(winsys) && cs->cdw + size <= cs->ndw;
}
static void radeon_begin_cs(struct radeon_winsys* winsys,