Depends on previous signalled value patch.

If the reqiest is unsynchronized, we must not do anything, so do that
check first.

Fixes a bug if DONTBLOCK | UNSYNCHRONIZED.

---
 .../auxiliary/pipebuffer/pb_buffer_fenced.c        |   34 +++++++++----------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c 
b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index d97f749..46e490b 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -688,27 +688,25 @@ fenced_buffer_map(struct pb_buffer *buf,
    /*
     * Serialize writes.
     */
-   while((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_WRITE) ||
-         ((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_READ) &&
-          (flags & PIPE_BUFFER_USAGE_CPU_WRITE))) {
+   if (flags & PIPE_BUFFER_USAGE_UNSYNCHRONIZED) {
+      while((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_WRITE) ||
+            ((fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_READ) &&
+             (flags & PIPE_BUFFER_USAGE_CPU_WRITE))) {
 
-      /* 
-       * Don't wait for the GPU to finish accessing it, if blocking is 
forbidden.
-       */
-      if((flags & PIPE_BUFFER_USAGE_DONTBLOCK) &&
-          ops->fence_signalled(ops, fenced_buf->fence, 0) != 0) {
-         goto done;
-      }
+         /*
+          * Don't wait for the GPU to finish accessing it, if blocking is 
forbidden.
+          */
+         if((flags & PIPE_BUFFER_USAGE_DONTBLOCK) &&
+             ops->fence_signalled(ops, fenced_buf->fence, 0) != 0) {
+            goto done;
+         }
 
-      if (flags & PIPE_BUFFER_USAGE_UNSYNCHRONIZED) {
-         break;
+         /*
+          * Wait for the GPU to finish accessing. This will release and 
re-acquire
+          * the mutex, so all copies of mutable state must be discarded.
+          */
+         fenced_buffer_finish_locked(fenced_mgr, fenced_buf);
       }
-
-      /*
-       * Wait for the GPU to finish accessing. This will release and re-acquire
-       * the mutex, so all copies of mutable state must be discarded.
-       */
-      fenced_buffer_finish_locked(fenced_mgr, fenced_buf);
    }
 
    if(fenced_buf->buffer) {
-- 
1.6.6.1.476.g01ddb


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to