i965: Remove unnecessary malloc/free in VS binding table setup.
authorEric Anholt <eric@anholt.net>
Tue, 19 Jan 2010 23:26:56 +0000 (15:26 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 26 Jan 2010 06:57:30 +0000 (22:57 -0800)
src/mesa/drivers/dri/i965/brw_vs_surface_state.c
src/mesa/drivers/dri/intel/intel_batchbuffer.c

index ca93ca75061ad14c3bdf1a3ed187c311394be2ef..ead623fc0eaf8edecccce9bc6bb55dd224d1a21a 100644 (file)
@@ -155,7 +155,7 @@ brw_vs_get_binding_table(struct brw_context *brw)
 
    if (bind_bo == NULL) {
       GLuint data_size = BRW_VS_MAX_SURF * sizeof(GLuint);
-      uint32_t *data = malloc(data_size);
+      uint32_t data[BRW_VS_MAX_SURF];
       int i;
 
       for (i = 0; i < BRW_VS_MAX_SURF; i++)
@@ -180,8 +180,6 @@ brw_vs_get_binding_table(struct brw_context *brw)
                                    I915_GEM_DOMAIN_INSTRUCTION, 0);
         }
       }
-
-      free(data);
    }
 
    return bind_bo;
index 3a4b21a844fd89edffcf37083c85de88bbda760d..f18fb91a888af13dce1e5bae070240e101bad92b 100644 (file)
@@ -167,7 +167,8 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file,
    struct intel_context *intel = batch->intel;
    GLuint used = batch->ptr - batch->map;
 
-   if (intel->first_post_swapbuffers_batch == NULL) {
+   if (!intel->using_dri2_swapbuffers &&
+       intel->first_post_swapbuffers_batch == NULL) {
       intel->first_post_swapbuffers_batch = intel->batch->buf;
       drm_intel_bo_reference(intel->first_post_swapbuffers_batch);
    }