[Mesa-dev] [PATCH 4/6] gallium/u_upload_mgr: don't expose u_upload_flush

Marek Olšák maraeo at gmail.com
Mon Jan 13 05:13:04 PST 2014


From: Marek Olšák <marek.olsak at amd.com>

It's unused and shouldn't be used at all in my opinion.

If some driver doesn't support the unsynchronized flag, u_upload_mgr should
avoid the synchronization by other means, e.g. by using the DONTBLOCK flag.
---
 src/gallium/auxiliary/util/u_upload_mgr.c | 16 ++++------------
 src/gallium/auxiliary/util/u_upload_mgr.h | 10 ----------
 2 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_upload_mgr.c b/src/gallium/auxiliary/util/u_upload_mgr.c
index 6859751..7349d00 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.c
+++ b/src/gallium/auxiliary/util/u_upload_mgr.c
@@ -87,16 +87,8 @@ void u_upload_unmap( struct u_upload_mgr *upload )
    }
 }
 
-/* Release old buffer.
- * 
- * This must usually be called prior to firing the command stream
- * which references the upload buffer, as many memory managers will
- * cause subsequent maps of a fired buffer to wait.
- *
- * Can improve this with a change to pipe_buffer_write to use the
- * DONT_WAIT bit, but for now, it's easiest just to grab a new buffer.
- */
-void u_upload_flush( struct u_upload_mgr *upload )
+
+static void u_upload_release_buffer(struct u_upload_mgr *upload)
 {
    /* Unmap and unreference the upload buffer. */
    u_upload_unmap(upload);
@@ -107,7 +99,7 @@ void u_upload_flush( struct u_upload_mgr *upload )
 
 void u_upload_destroy( struct u_upload_mgr *upload )
 {
-   u_upload_flush( upload );
+   u_upload_release_buffer( upload );
    FREE( upload );
 }
 
@@ -120,7 +112,7 @@ u_upload_alloc_buffer( struct u_upload_mgr *upload,
 
    /* Release the old buffer, if present:
     */
-   u_upload_flush( upload );
+   u_upload_release_buffer( upload );
 
    /* Allocate a new one: 
     */
diff --git a/src/gallium/auxiliary/util/u_upload_mgr.h b/src/gallium/auxiliary/util/u_upload_mgr.h
index 82215a5..63bf30e 100644
--- a/src/gallium/auxiliary/util/u_upload_mgr.h
+++ b/src/gallium/auxiliary/util/u_upload_mgr.h
@@ -57,16 +57,6 @@ struct u_upload_mgr *u_upload_create( struct pipe_context *pipe,
 void u_upload_destroy( struct u_upload_mgr *upload );
 
 /**
- * Unmap and release old upload buffer.
- * 
- * This is like u_upload_unmap() except the upload buffer is released for
- * recycling. This should be called on real hardware flushes on systems
- * that don't support the PIPE_TRANSFER_UNSYNCHRONIZED flag, as otherwise
- * the next u_upload_buffer will cause a sync on the buffer.
- */
-void u_upload_flush( struct u_upload_mgr *upload );
-
-/**
  * Unmap upload buffer
  *
  * \param upload           Upload manager
-- 
1.8.3.2



More information about the mesa-dev mailing list