Mesa (master): pipebuffer: Wait for the GPU to finish reading too.

Keith Whitwell keithw at kemper.freedesktop.org
Tue Mar 3 11:55:33 UTC 2009


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

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Mar  2 17:32:37 2009 +0000

pipebuffer: Wait for the GPU to finish reading too.

No real change, as we're not tracking relocations read/write access yet.

---

 .../auxiliary/pipebuffer/pb_buffer_fenced.c        |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index 91b55c8..ede2af4 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -296,9 +296,10 @@ fenced_buffer_map(struct pb_buffer *buf,
    assert(!(flags & ~PIPE_BUFFER_USAGE_CPU_READ_WRITE));
    flags &= PIPE_BUFFER_USAGE_CPU_READ_WRITE;
    
-   /* Check for GPU read/write access */
-   if(fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_WRITE) {
-      /* Wait for the GPU to finish writing */
+   /* Serialize writes */
+   if((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_WRITE) ||
+      ((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_READ) && (flags & PIPE_BUFFER_USAGE_CPU_WRITE))) {
+      /* Wait for the GPU to finish */
       _fenced_buffer_finish(fenced_buf);
    }
 




More information about the mesa-commit mailing list