Mesa (master): pipebuffer: don't fail when validating mapped buffers

Keith Whitwell keithw at kemper.freedesktop.org
Fri Apr 24 11:43:32 UTC 2009


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

Author: Keith Whitwell <keithw at vmware.com>
Date:   Fri Apr 24 12:43:04 2009 +0100

pipebuffer: don't fail when validating mapped buffers

This can be almost impossible to avoid - hopefully we won't encounter
a situation where this is a true requirement.  Would probably require
drivers to flush between hardware and software vertex processing.

---

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

diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index 2cd0b8a..044e8e1 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -365,21 +365,22 @@ fenced_buffer_validate(struct pb_buffer *buf,
    if(fenced_buf->vl && fenced_buf->vl != vl)
       return PIPE_ERROR_RETRY;
    
+#if 0
    /* Do not validate if buffer is still mapped */
    if(fenced_buf->flags & PIPE_BUFFER_USAGE_CPU_READ_WRITE) {
       /* TODO: wait for the thread that mapped the buffer to unmap it */
       return PIPE_ERROR_RETRY;
    }
+   /* Final sanity checking */
+   assert(!(fenced_buf->flags & PIPE_BUFFER_USAGE_CPU_READ_WRITE));
+   assert(!fenced_buf->mapcount);
+#endif
 
    if(fenced_buf->vl == vl &&
       (fenced_buf->validation_flags & flags) == flags) {
       /* Nothing to do -- buffer already validated */
       return PIPE_OK;
    }
-
-   /* Final sanity checking */
-   assert(!(fenced_buf->flags & PIPE_BUFFER_USAGE_CPU_READ_WRITE));
-   assert(!fenced_buf->mapcount);
    
    ret = pb_validate(fenced_buf->buffer, vl, flags);
    if (ret != PIPE_OK)




More information about the mesa-commit mailing list