i965: Replace maxBatchSize variable with BATCH_SZ define.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 29 Jun 2013 02:38:13 +0000 (19:38 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 3 Jul 2013 17:48:14 +0000 (10:48 -0700)
maxBatchSize was only ever initialized to BATCH_SZ, and a few places
used BATCH_SZ directly anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_batchbuffer.h
src/mesa/drivers/dri/i965/intel_context.c
src/mesa/drivers/dri/i965/intel_context.h

index 46f17fd19275ad51538ac4f9adb139050c3f801f..409df29c7d1b4c29493759068751f023921cf3ee 100644 (file)
@@ -71,7 +71,7 @@ intel_batchbuffer_init(struct intel_context *intel)
    }
 
    if (!intel->has_llc) {
-      intel->batch.cpu_map = malloc(intel->maxBatchSize);
+      intel->batch.cpu_map = malloc(BATCH_SZ);
       intel->batch.map = intel->batch.cpu_map;
    }
 }
@@ -88,7 +88,7 @@ intel_batchbuffer_reset(struct intel_context *intel)
    clear_cache(intel);
 
    intel->batch.bo = drm_intel_bo_alloc(intel->bufmgr, "batchbuffer",
-                                       intel->maxBatchSize, 4096);
+                                       BATCH_SZ, 4096);
    if (intel->has_llc) {
       drm_intel_bo_map(intel->batch.bo, true);
       intel->batch.map = intel->batch.bo->virtual;
index 1a6d1aa4946416eb93c713d69e0a8d033e3c5695..08455453d3762a6fc64d8a7c509df2ede86b4402 100644 (file)
@@ -111,7 +111,7 @@ intel_batchbuffer_require_space(struct intel_context *intel,
    intel->batch.is_blit = is_blit;
 
 #ifdef DEBUG
-   assert(sz < intel->maxBatchSize - BATCH_RESERVED);
+   assert(sz < BATCH_SZ - BATCH_RESERVED);
 #endif
    if (intel_batchbuffer_space(intel) < sz)
       intel_batchbuffer_flush(intel);
index cf0060382b1592b340e04dde4898e9290f7b5e8b..e4d7bd50bc8b56851fb3f78e18169395b42be280 100644 (file)
@@ -510,7 +510,6 @@ intelInitContext(struct intel_context *intel,
 
    driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache,
                        sPriv->myNum, "i965");
-   intel->maxBatchSize = BATCH_SZ;
 
    /* Estimate the size of the mappable aperture into the GTT.  There's an
     * ioctl to get the whole GTT size, but not one to get the mappable subset.
index 5fd9ccd1aebab25f3c3c3e293c0d12b099e5690c..a55572307ec329d01d3db0c69c175f727f4879e5 100644 (file)
@@ -155,7 +155,6 @@ struct intel_context
    GLuint NewGLState;
  
    dri_bufmgr *bufmgr;
-   unsigned int maxBatchSize;
 
    /**
     * Generation number of the hardware: 2 is 8xx, 3 is 9xx pre-965, 4 is 965.