summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r600/r600_cmdbuf.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-09-10 15:33:45 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-09-10 15:33:45 -0700
commitb8e1e8d2d8ae6ffbf8f271b46ee89788a926b3b0 (patch)
tree5db502ab80287bfc8ff61082784017c7448464f5 /src/mesa/drivers/dri/r600/r600_cmdbuf.c
parent81722c5d7e8e93d837510b9e6e5d014ec64cf4b3 (diff)
parentd9dc4cb0e4f578da9e50c9d1ba6fd9c22ea2fca6 (diff)
Merge branch 'master' into asm-shader-rework-2
Conflicts: src/mesa/shader/lex.yy.c src/mesa/shader/program_parse.tab.c src/mesa/shader/program_parse.tab.h
Diffstat (limited to 'src/mesa/drivers/dri/r600/r600_cmdbuf.c')
-rw-r--r--src/mesa/drivers/dri/r600/r600_cmdbuf.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
index 65930ff589..3cfe03a45f 100644
--- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c
+++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
@@ -192,9 +192,9 @@ static int r600_cs_begin(struct radeon_cs *cs,
if (cs->cdw + ndw > cs->ndw) {
uint32_t tmp, *ptr;
- int num = (ndw > 0x3FF) ? ndw : 0x3FF;
+ int num = (ndw > 0x400) ? ndw : 0x400;
- tmp = (cs->cdw + 1 + num) & (~num);
+ tmp = (cs->cdw + num + 0x3FF) & (~0x3FF);
ptr = (uint32_t*)realloc(cs->packets, 4 * tmp);
if (ptr == NULL) {
return -ENOMEM;
@@ -229,6 +229,14 @@ static int r600_cs_end(struct radeon_cs *cs,
return -EPIPE;
}
+ if (cs->cdw > cs->ndw) {
+ fprintf(stderr, "CS section overflow at (%s,%s,%d) cdw %d ndw %d\n",
+ cs->section_file, cs->section_func, cs->section_line,cs->cdw,cs->ndw);
+ fprintf(stderr, "CS section end at (%s,%s,%d)\n",
+ file, func, line);
+ assert(0);
+ }
+
return 0;
}