[Mesa-dev] [PATCH] u_upload_mgr: remove the 'flushed' parameter

Marek Olšák maraeo at gmail.com
Sun Jan 1 09:28:10 PST 2012


Not used by anybody.
---
 src/gallium/auxiliary/util/u_upload_mgr.c        |   15 ++++-----------
 src/gallium/auxiliary/util/u_upload_mgr.h        |    7 ++-----
 src/gallium/auxiliary/util/u_vbuf.c              |    6 ++----
 src/gallium/drivers/r300/r300_render_translate.c |    7 +++----
 src/gallium/drivers/r300/r300_screen_buffer.c    |    3 +--
 src/gallium/drivers/r600/r600_buffer.c           |    8 +++-----
 src/gallium/drivers/r600/r600_translate.c        |    3 +--
 src/gallium/drivers/svga/svga_draw_elements.c    |    4 +---
 src/gallium/drivers/svga/svga_pipe_draw.c        |    4 +---
 9 files changed, 18 insertions(+), 39 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index 936e881..b4b4c91 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -158,7 +158,6 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
                                 unsigned size,
                                 unsigned *out_offset,
                                 struct pipe_resource **outbuf,
-                                boolean *flushed,
                                 void **ptr )
 {
    unsigned alloc_size = align( size, upload->alignment );
@@ -172,10 +171,6 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
                                                   alloc_offset + alloc_size);
       if (ret != PIPE_OK)
          return ret;
-
-      *flushed = TRUE;
-   } else {
-      *flushed = FALSE;
    }
 
    offset = MAX2(upload->offset, alloc_offset);
@@ -214,12 +209,11 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
                                unsigned size,
                                const void *data,
                                unsigned *out_offset,
-                               struct pipe_resource **outbuf,
-                               boolean *flushed )
+                               struct pipe_resource **outbuf)
 {
    uint8_t *ptr;
    enum pipe_error ret = u_upload_alloc(upload, min_out_offset, size,
-                                        out_offset, outbuf, flushed,
+                                        out_offset, outbuf,
                                         (void**)&ptr);
    if (ret != PIPE_OK)
       return ret;
@@ -240,8 +234,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
                                  unsigned size,
                                  struct pipe_resource *inbuf,
                                  unsigned *out_offset,
-                                 struct pipe_resource **outbuf,
-                                 boolean *flushed )
+                                 struct pipe_resource **outbuf)
 {
    enum pipe_error ret = PIPE_OK;
    struct pipe_transfer *transfer = NULL;
@@ -265,7 +258,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
                         size,
                         map,
                         out_offset,
-                        outbuf, flushed );
+                        outbuf);
 
    pipe_buffer_unmap( upload->pipe, transfer );
 
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h
index 9891513..b50d3f3 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.h
+++ b/src/gallium/auxiliary/util/u_upload_mgr.h
@@ -94,7 +94,6 @@ enum pipe_error u_upload_alloc( struct u_upload_mgr *upload,
                                 unsigned size,
                                 unsigned *out_offset,
                                 struct pipe_resource **outbuf,
-                                boolean *flushed,
                                 void **ptr );
 
 
@@ -109,8 +108,7 @@ enum pipe_error u_upload_data( struct u_upload_mgr *upload,
                                unsigned size,
                                const void *data,
                                unsigned *out_offset,
-                               struct pipe_resource **outbuf,
-                               boolean *flushed );
+                               struct pipe_resource **outbuf);
 
 
 /**
@@ -125,8 +123,7 @@ enum pipe_error u_upload_buffer( struct u_upload_mgr *upload,
                                  unsigned size,
                                  struct pipe_resource *inbuf,
                                  unsigned *out_offset,
-                                 struct pipe_resource **outbuf,
-                                 boolean *flushed );
+                                 struct pipe_resource **outbuf);
 
 
 
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index 10e73e6..4729888 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -195,7 +195,6 @@ u_vbuf_translate_begin(struct u_vbuf_priv *mgr,
    struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS] = {0};
    struct pipe_resource *out_buffer = NULL;
    unsigned i, out_offset, num_verts = max_index + 1 - min_index;
-   boolean upload_flushed = FALSE;
 
    memset(&key, 0, sizeof(key));
    memset(tr_elem_index, 0xff, sizeof(tr_elem_index));
@@ -263,7 +262,7 @@ u_vbuf_translate_begin(struct u_vbuf_priv *mgr,
    u_upload_alloc(mgr->b.uploader,
                   key.output_stride * min_index,
                   key.output_stride * num_verts,
-                  &out_offset, &out_buffer, &upload_flushed,
+                  &out_offset, &out_buffer,
                   (void**)&out_map);
 
    out_offset -= key.output_stride * min_index;
@@ -600,7 +599,6 @@ u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
    /* Upload buffers. */
    for (i = 0; i < nr_vbufs; i++) {
       unsigned start, end = end_offset[i];
-      boolean flushed;
       struct pipe_vertex_buffer *real_vb;
       uint8_t *ptr;
 
@@ -615,7 +613,7 @@ u_vbuf_upload_buffers(struct u_vbuf_priv *mgr,
       ptr = u_vbuf_resource(mgr->b.vertex_buffer[i].buffer)->user_ptr;
 
       u_upload_data(mgr->b.uploader, start, end - start, ptr + start,
-                    &real_vb->buffer_offset, &real_vb->buffer, &flushed);
+                    &real_vb->buffer_offset, &real_vb->buffer);
 
       real_vb->buffer_offset -= start;
    }
diff --git a/src/gallium/drivers/r300/r300_render_translate.c b/src/gallium/drivers/r300/r300_render_translate.c
index f8c7558..c2eb3c5 100644
--- a/src/gallium/drivers/r300/r300_render_translate.c
+++ b/src/gallium/drivers/r300/r300_render_translate.c
@@ -33,12 +33,11 @@ void r300_translate_index_buffer(struct r300_context *r300,
     struct pipe_resource *out_buffer = NULL;
     unsigned out_offset;
     void *ptr;
-    boolean flushed;
 
     switch (*index_size) {
     case 1:
         u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 2,
-                       &out_offset, &out_buffer, &flushed, &ptr);
+                       &out_offset, &out_buffer, &ptr);
 
         util_shorten_ubyte_elts_to_userptr(
                 &r300->context, *index_buffer, index_offset,
@@ -53,7 +52,7 @@ void r300_translate_index_buffer(struct r300_context *r300,
     case 2:
         if (index_offset) {
             u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 2,
-                           &out_offset, &out_buffer, &flushed, &ptr);
+                           &out_offset, &out_buffer, &ptr);
 
             util_rebuild_ushort_elts_to_userptr(&r300->context, *index_buffer,
                                                 index_offset, *start,
@@ -68,7 +67,7 @@ void r300_translate_index_buffer(struct r300_context *r300,
     case 4:
         if (index_offset) {
             u_upload_alloc(r300->vbuf_mgr->uploader, 0, count * 4,
-                           &out_offset, &out_buffer, &flushed, &ptr);
+                           &out_offset, &out_buffer, &ptr);
 
             util_rebuild_uint_elts_to_userptr(&r300->context, *index_buffer,
                                               index_offset, *start,
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index 2e9e7d7..9d8ce62 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -38,7 +38,6 @@ void r300_upload_index_buffer(struct r300_context *r300,
 			      unsigned count, uint8_t *ptr)
 {
     unsigned index_offset;
-    boolean flushed;
 
     *index_buffer = NULL;
 
@@ -46,7 +45,7 @@ void r300_upload_index_buffer(struct r300_context *r300,
                   0, count * index_size,
                   ptr + (*start * index_size),
                   &index_offset,
-                  index_buffer, &flushed);
+                  index_buffer);
 
     *start = index_offset / index_size;
 }
diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c
index a0386fe..b7f0b24 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -241,10 +241,9 @@ void r600_upload_index_buffer(struct r600_pipe_context *rctx,
 			      struct pipe_index_buffer *ib, unsigned count)
 {
 	struct r600_resource *rbuffer = r600_resource(ib->buffer);
-	boolean flushed;
 
 	u_upload_data(rctx->vbuf_mgr->uploader, 0, count * ib->index_size,
-		      rbuffer->b.user_ptr, &ib->offset, &ib->buffer, &flushed);
+		      rbuffer->b.user_ptr, &ib->offset, &ib->buffer);
 }
 
 void r600_upload_const_buffer(struct r600_pipe_context *rctx, struct r600_resource **rbuffer,
@@ -253,7 +252,6 @@ void r600_upload_const_buffer(struct r600_pipe_context *rctx, struct r600_resour
 	if ((*rbuffer)->b.user_ptr) {
 		uint8_t *ptr = (*rbuffer)->b.user_ptr;
 		unsigned size = (*rbuffer)->b.b.b.width0;
-		boolean flushed;
 
 		*rbuffer = NULL;
 
@@ -271,12 +269,12 @@ void r600_upload_const_buffer(struct r600_pipe_context *rctx, struct r600_resour
 			}
 
 			u_upload_data(rctx->vbuf_mgr->uploader, 0, size, tmpPtr, const_offset,
-				      (struct pipe_resource**)rbuffer, &flushed);
+				      (struct pipe_resource**)rbuffer);
 
 			free(tmpPtr);
 		} else {
 			u_upload_data(rctx->vbuf_mgr->uploader, 0, size, ptr, const_offset,
-				      (struct pipe_resource**)rbuffer, &flushed);
+				      (struct pipe_resource**)rbuffer);
 		}
 	} else {
 		*const_offset = 0;
diff --git a/src/gallium/drivers/r600/r600_translate.c b/src/gallium/drivers/r600/r600_translate.c
index 9159e45..9449707 100644
--- a/src/gallium/drivers/r600/r600_translate.c
+++ b/src/gallium/drivers/r600/r600_translate.c
@@ -36,12 +36,11 @@ void r600_translate_index_buffer(struct r600_pipe_context *r600,
 	struct pipe_resource *out_buffer = NULL;
 	unsigned out_offset;
 	void *ptr;
-	boolean flushed;
 
 	switch (ib->index_size) {
 	case 1:
 		u_upload_alloc(r600->vbuf_mgr->uploader, 0, count * 2,
-			       &out_offset, &out_buffer, &flushed, &ptr);
+			       &out_offset, &out_buffer, &ptr);
 
 		util_shorten_ubyte_elts_to_userptr(
 				&r600->context, ib->buffer, 0, ib->offset, count, ptr);
diff --git a/src/gallium/drivers/svga/svga_draw_elements.c b/src/gallium/drivers/svga/svga_draw_elements.c
index ba49241..1c20881 100644
--- a/src/gallium/drivers/svga/svga_draw_elements.c
+++ b/src/gallium/drivers/svga/svga_draw_elements.c
@@ -121,7 +121,6 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl,
    if (index_buffer && 
        svga_buffer_is_user_buffer(index_buffer)) 
    {
-      boolean flushed;
       assert( index_buffer->width0 >= index_offset + count * index_size );
 
       ret = u_upload_buffer( hwtnl->upload_ib,
@@ -130,8 +129,7 @@ svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl,
                              count * index_size,
                              index_buffer,
                              &index_offset,
-                             &upload_buffer,
-                             &flushed );
+                             &upload_buffer);
       if (ret != PIPE_OK)
          goto done;
 
diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c
index 141734b..c61d5d0 100644
--- a/src/gallium/drivers/svga/svga_pipe_draw.c
+++ b/src/gallium/drivers/svga/svga_pipe_draw.c
@@ -138,7 +138,6 @@ svga_upload_user_buffers(struct svga_context *svga,
 
       if (vb->buffer && svga_buffer_is_user_buffer(vb->buffer)) {
          struct svga_buffer *buffer = svga_buffer(vb->buffer);
-         boolean flushed;
 
          /*
           * Check if already uploaded. Otherwise go ahead and upload.
@@ -153,8 +152,7 @@ svga_upload_user_buffers(struct svga_context *svga,
                                 buffer->uploaded.end - buffer->uploaded.start,
                                 &buffer->b.b,
                                 &buffer->uploaded.offset,
-                                &buffer->uploaded.buffer,
-                                &flushed);
+                                &buffer->uploaded.buffer);
 
          if (ret)
             return ret;
-- 
1.7.4.1



More information about the mesa-dev mailing list