diff options
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer')
4 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 95eb5f6563..d97f749b6e 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -696,7 +696,7 @@ fenced_buffer_map(struct pb_buffer *buf, * 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) { + ops->fence_signalled(ops, fenced_buf->fence, 0) != 0) { goto done; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 53bc019a20..86f9266c95 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -294,7 +294,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, LIST_DEL(&buf->head); pipe_mutex_unlock(mgr->mutex); /* Increase refcount */ - pipe_reference(NULL, &buf->base.base.reference); + pipe_reference_init(&buf->base.base.reference, 1); return &buf->base; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index c2593cf165..a5dbded2bc 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -179,7 +179,9 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf) { uint8_t *map; - map = pb_map(buf->buffer, PIPE_BUFFER_USAGE_CPU_READ); + map = pb_map(buf->buffer, + PIPE_BUFFER_USAGE_CPU_READ | + PIPE_BUFFER_USAGE_UNSYNCHRONIZED); assert(map); if(map) { boolean underflow, overflow; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c index c445cb578b..24e2820f88 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c @@ -483,11 +483,15 @@ pb_slab_range_manager_create_buffer(struct pb_manager *_mgr, { struct pb_slab_range_manager *mgr = pb_slab_range_manager(_mgr); pb_size bufSize; + pb_size reqSize = size; unsigned i; + if(desc->alignment > reqSize) + reqSize = desc->alignment; + bufSize = mgr->minBufSize; for (i = 0; i < mgr->numBuckets; ++i) { - if(bufSize >= size) + if(bufSize >= reqSize) return mgr->buckets[i]->create_buffer(mgr->buckets[i], size, desc); bufSize *= 2; } |