Mesa (master): intel: Remove the non-gem paths for batchbuffer upload.

Eric Anholt anholt at kemper.freedesktop.org
Tue Jun 8 13:42:22 PDT 2010


Module: Mesa
Branch: master
Commit: 754fcd605b200c1983d2840931b7cf8d638116df
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=754fcd605b200c1983d2840931b7cf8d638116df

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jun  7 08:39:33 2010 -0700

intel: Remove the non-gem paths for batchbuffer upload.

---

 src/mesa/drivers/dri/intel/intel_batchbuffer.c |   26 +++--------------------
 1 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
index 27bd4fe..d341762 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c
@@ -42,17 +42,9 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch)
       batch->buf = NULL;
    }
 
-   if (!batch->buffer)
-      batch->buffer = malloc (intel->maxBatchSize);
-
    batch->buf = dri_bo_alloc(intel->bufmgr, "batchbuffer",
 			     intel->maxBatchSize, 4096);
-   if (batch->buffer)
-      batch->map = batch->buffer;
-   else {
-      dri_bo_map(batch->buf, GL_TRUE);
-      batch->map = batch->buf->virtual;
-   }
+   batch->map = batch->buffer;
    batch->size = intel->maxBatchSize;
    batch->ptr = batch->map;
    batch->reserved_space = BATCH_RESERVED;
@@ -65,6 +57,7 @@ intel_batchbuffer_alloc(struct intel_context *intel)
    struct intel_batchbuffer *batch = calloc(sizeof(*batch), 1);
 
    batch->intel = intel;
+   batch->buffer = malloc(intel->maxBatchSize);
    intel_batchbuffer_reset(batch);
 
    return batch;
@@ -73,14 +66,7 @@ intel_batchbuffer_alloc(struct intel_context *intel)
 void
 intel_batchbuffer_free(struct intel_batchbuffer *batch)
 {
-   if (batch->buffer)
-      free (batch->buffer);
-   else {
-      if (batch->map) {
-	 dri_bo_unmap(batch->buf);
-	 batch->map = NULL;
-      }
-   }
+   free (batch->buffer);
    dri_bo_unreference(batch->buf);
    batch->buf = NULL;
    free(batch);
@@ -97,12 +83,8 @@ do_flush_locked(struct intel_batchbuffer *batch, GLuint used)
    int ret = 0;
    int x_off = 0, y_off = 0;
 
-   if (batch->buffer)
-      dri_bo_subdata (batch->buf, 0, used, batch->buffer);
-   else
-      dri_bo_unmap(batch->buf);
+   dri_bo_subdata (batch->buf, 0, used, batch->buffer);
 
-   batch->map = NULL;
    batch->ptr = NULL;
 
    if (!intel->no_hw)



More information about the mesa-commit mailing list