summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_cmdbuf.c
diff options
context:
space:
mode:
authorNicolai Haehnle <prefect_@gmx.net>2005-05-14 14:51:17 +0000
committerNicolai Haehnle <prefect_@gmx.net>2005-05-14 14:51:17 +0000
commit09f433b97cc8fa36452a49c3f062b9d9d0c33b9e (patch)
treed353692d08dfe56715e9bf90da6d84e1a171782f /src/mesa/drivers/dri/r300/r300_cmdbuf.c
parent8110df4f617cdcbaccb968365e87d32560033149 (diff)
The kernel doesn't like command buffers over 64KB, so we don't
allocate buffers bigger than that.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_cmdbuf.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_cmdbuf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
index 73ef69c2f6..a873b0259d 100644
--- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c
+++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
@@ -196,7 +196,7 @@ void r300EmitState(r300ContextPtr r300)
if (r300->cmdbuf.count_used && !r300->hw.is_dirty && !r300->hw.all_dirty)
return;
-
+
/* To avoid going across the entire set of states multiple times, just check
* for enough space for the case of emitting all state, and inline the
* r300AllocCmdBuf code here without all the checks.
@@ -543,9 +543,11 @@ void r300InitCmdBuf(r300ContextPtr r300)
/* Initialize command buffer */
size = 256 * driQueryOptioni(&r300->radeon.optionCache, "command_buffer_size");
- if (size < 2*r300->hw.max_state_size){
+ if (size < 2*r300->hw.max_state_size) {
size = 2*r300->hw.max_state_size+65535;
- }
+ }
+ if (size > 64*256)
+ size = 64*256;
if (RADEON_DEBUG & (DEBUG_IOCTL|DEBUG_DMA)) {
fprintf(stderr, "sizeof(drm_r300_cmd_header_t)=%d\n",