diff options
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_batchbuffer.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_batchbuffer.h | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_render.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_screen.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_screen.h | 1 |
5 files changed, 18 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.c b/src/mesa/drivers/dri/i915/intel_batchbuffer.c index 3b0ba752f7..b4e0b74f16 100644 --- a/src/mesa/drivers/dri/i915/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.c @@ -82,11 +82,13 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch) { int i; + /* * Get a new, free batchbuffer. */ - driBOData(batch->buffer, BATCH_SZ, NULL, 0); + batch->size = batch->intel->intelScreen->maxBatchSize; + driBOData(batch->buffer, batch->size, NULL, 0); driBOResetList(&batch->list); diff --git a/src/mesa/drivers/dri/i915/intel_batchbuffer.h b/src/mesa/drivers/dri/i915/intel_batchbuffer.h index 7bfef2d483..a83dbf423d 100644 --- a/src/mesa/drivers/dri/i915/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/i915/intel_batchbuffer.h @@ -6,7 +6,7 @@ struct intel_context; -#define BATCH_SZ 4096 +#define BATCH_SZ 16384 #define BATCH_RESERVED 16 #define MAX_RELOCS 100 @@ -37,6 +37,7 @@ struct intel_batchbuffer struct buffer_reloc reloc[MAX_RELOCS]; GLuint nr_relocs; + GLuint size; }; struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_context @@ -76,7 +77,7 @@ GLboolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, static INLINE GLuint intel_batchbuffer_space(struct intel_batchbuffer *batch) { - return (BATCH_SZ - BATCH_RESERVED) - (batch->ptr - batch->map); + return (batch->size - BATCH_RESERVED) - (batch->ptr - batch->map); } @@ -93,7 +94,7 @@ static INLINE void intel_batchbuffer_require_space(struct intel_batchbuffer *batch, GLuint sz, GLuint flags) { - assert(sz < BATCH_SZ - 8); + assert(sz < batch->size - 8); if (intel_batchbuffer_space(batch) < sz || (batch->flags != 0 && flags != 0 && batch->flags != flags)) intel_batchbuffer_flush(batch); diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c index 1c83e7dd1f..f9fa55051e 100644 --- a/src/mesa/drivers/dri/i915/intel_render.c +++ b/src/mesa/drivers/dri/i915/intel_render.c @@ -126,7 +126,7 @@ do { \ #define FLUSH() INTEL_FIREVERTICES(intel) #define GET_SUBSEQUENT_VB_MAX_VERTS() \ - ((BATCH_SZ - 1500) / (intel->vertex_size*4)) + ((intel->batch->size - 1500) / (intel->vertex_size*4)) #define GET_CURRENT_VB_MAX_VERTS() GET_SUBSEQUENT_VB_MAX_VERTS() #define ALLOC_VERTS( nr ) \ diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index e2b148248c..c04831be1b 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -353,6 +353,8 @@ intelInitDriver(__DRIscreenPrivate * sPriv) intelScreenPrivate *intelScreen; I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv; drmI830Sarea *sarea; + unsigned batchPoolSize = 1024*1024; + PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension = (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface-> getProcAddress("glxEnableExtension")); @@ -380,7 +382,12 @@ intelInitDriver(__DRIscreenPrivate * sPriv) sarea = (drmI830Sarea *) (((GLubyte *) sPriv->pSAREA) + intelScreen->sarea_priv_offset); + intelScreen->maxBatchSize = BATCH_SZ; intelScreen->deviceID = gDRIPriv->deviceID; + if (intelScreen->deviceID == PCI_CHIP_I865_G) + intelScreen->maxBatchSize = 4096; + batchPoolSize /= intelScreen->maxBatchSize; + intelScreen->mem = gDRIPriv->mem; intelScreen->cpp = gDRIPriv->cpp; @@ -486,7 +493,8 @@ intelInitDriver(__DRIscreenPrivate * sPriv) DRM_BO_FLAG_EXE | DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_MEM_LOCAL, - BATCH_SZ, 100, 5); + intelScreen->maxBatchSize, + batchPoolSize, 5); if (!intelScreen->batchPool) { fprintf(stderr, "Failed to initialize batch pool - possible incorrect agpgart installed\n"); return GL_FALSE; diff --git a/src/mesa/drivers/dri/i915/intel_screen.h b/src/mesa/drivers/dri/i915/intel_screen.h index 22c2447dfc..17698773f3 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.h +++ b/src/mesa/drivers/dri/i915/intel_screen.h @@ -92,6 +92,7 @@ typedef struct struct _DriBufferPool *texPool; struct _DriBufferPool *regionPool; struct _DriBufferPool *staticPool; + unsigned int maxBatchSize; } intelScreenPrivate; |