summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2012-08-04 20:02:30 +0200
committerMarek Olšák <[email protected]>2012-08-15 19:20:57 +0200
commita7f4d3b740d4c85b0dc2b006c30c2bc4a3ed8597 (patch)
treedfe2f17582d9bbf716b66c06e61b11ae1348099a /src
parentdc5e61d8842501e0b67907e360392eb355c8b73d (diff)
winsys/radeon: print error if CS is overflowed
and don't submit the CS to the kernel.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_cs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index 186c5bce9ca..7e0f2f98a3b 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -438,6 +438,10 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs, unsigned flags)
struct radeon_drm_cs *cs = radeon_drm_cs(rcs);
struct radeon_cs_context *tmp;
+ if (rcs->cdw > RADEON_MAX_CMDBUF_DWORDS) {
+ fprintf(stderr, "radeon: command stream overflowed\n");
+ }
+
radeon_drm_cs_sync_flush(cs);
/* Flip command streams. */
@@ -445,8 +449,8 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs, unsigned flags)
cs->csc = cs->cst;
cs->cst = tmp;
- /* If the CS is not empty, emit it in a separate thread. */
- if (cs->base.cdw) {
+ /* If the CS is not empty or overflowed, emit it in a separate thread. */
+ if (cs->base.cdw && cs->base.cdw <= RADEON_MAX_CMDBUF_DWORDS) {
unsigned i, crelocs = cs->cst->crelocs;
cs->cst->chunks[0].length_dw = cs->base.cdw;