diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2009-09-10 15:33:45 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2009-09-10 15:33:45 -0700 |
commit | b8e1e8d2d8ae6ffbf8f271b46ee89788a926b3b0 (patch) | |
tree | 5db502ab80287bfc8ff61082784017c7448464f5 /src/mesa/drivers/dri/r600/r600_cmdbuf.c | |
parent | 81722c5d7e8e93d837510b9e6e5d014ec64cf4b3 (diff) | |
parent | d9dc4cb0e4f578da9e50c9d1ba6fd9c22ea2fca6 (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.c | 12 |
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; } |