diff options
author | Michel Dänzer <daenzer@vmware.com> | 2009-03-23 18:03:13 +0100 |
---|---|---|
committer | Michel Dänzer <daenzer@vmware.com> | 2009-03-23 18:03:13 +0100 |
commit | e9d156e9e4f92ae1ce70bd563c251b34d238c4bc (patch) | |
tree | 564c4283ca531a0cb1f21b5439237d0d07641f33 /src/gallium/auxiliary/pipebuffer | |
parent | da96767c8971e792285e3190c708438d65802379 (diff) |
gallium: Remove remnants of reference counting internals outside of p_refcnt.h.
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer')
7 files changed, 17 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index 2a1315922a..92b6fd0056 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -158,7 +158,7 @@ pb_map(struct pb_buffer *buf, assert(buf); if(!buf) return NULL; - assert(p_atomic_read(&buf->base.reference.count) > 0); + assert(pipe_is_referenced(&buf->base.reference)); return buf->vtbl->map(buf, flags); } @@ -169,7 +169,7 @@ pb_unmap(struct pb_buffer *buf) assert(buf); if(!buf) return; - assert(p_atomic_read(&buf->base.reference.count) > 0); + assert(pipe_is_referenced(&buf->base.reference)); buf->vtbl->unmap(buf); } @@ -185,7 +185,7 @@ pb_get_base_buffer( struct pb_buffer *buf, offset = 0; return; } - assert(p_atomic_read(&buf->base.reference.count) > 0); + assert(pipe_is_referenced(&buf->base.reference)); assert(buf->vtbl->get_base_buffer); buf->vtbl->get_base_buffer(buf, base_buf, offset); assert(*base_buf); @@ -221,7 +221,7 @@ pb_destroy(struct pb_buffer *buf) assert(buf); if(!buf) return; - assert(p_atomic_read(&buf->base.reference.count) == 0); + assert(!pipe_is_referenced(&buf->base.reference)); buf->vtbl->destroy(buf); } diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 1bdf7a0b2d..48d76a7af7 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -115,7 +115,7 @@ _fenced_buffer_add(struct fenced_buffer *fenced_buf) { struct fenced_buffer_list *fenced_list = fenced_buf->list; - assert(p_atomic_read(&fenced_buf->base.base.reference.count)); + assert(pipe_is_referenced(&fenced_buf->base.base.reference)); assert(fenced_buf->flags & PIPE_BUFFER_USAGE_GPU_READ_WRITE); assert(fenced_buf->fence); @@ -137,7 +137,7 @@ _fenced_buffer_destroy(struct fenced_buffer *fenced_buf) { struct fenced_buffer_list *fenced_list = fenced_buf->list; - assert(p_atomic_read(&fenced_buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&fenced_buf->base.base.reference)); assert(!fenced_buf->fence); #ifdef DEBUG assert(fenced_buf->head.prev); @@ -181,7 +181,7 @@ _fenced_buffer_remove(struct fenced_buffer_list *fenced_list, * FIXME!!! */ - if(!p_atomic_read(&fenced_buf->base.base.reference.count)) + if(!pipe_is_referenced(&fenced_buf->base.base.reference)) _fenced_buffer_destroy(fenced_buf); } @@ -257,7 +257,7 @@ fenced_buffer_destroy(struct pb_buffer *buf) struct fenced_buffer_list *fenced_list = fenced_buf->list; pipe_mutex_lock(fenced_list->mutex); - assert(p_atomic_read(&fenced_buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&fenced_buf->base.base.reference)); if (fenced_buf->fence) { struct pb_fence_ops *ops = fenced_list->ops; if(ops->fence_signalled(ops, fenced_buf->fence, 0) == 0) { diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 010a2ecc1f..35358430b4 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -112,7 +112,7 @@ _pb_cache_buffer_destroy(struct pb_cache_buffer *buf) LIST_DEL(&buf->head); assert(mgr->numDelayed); --mgr->numDelayed; - assert(p_atomic_read(&buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&buf->base.base.reference)); pb_reference(&buf->buffer, NULL); FREE(buf); } @@ -153,7 +153,7 @@ pb_cache_buffer_destroy(struct pb_buffer *_buf) struct pb_cache_manager *mgr = buf->mgr; pipe_mutex_lock(mgr->mutex); - assert(p_atomic_read(&buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&buf->base.base.reference)); _pb_cache_buffer_list_check_free(mgr); @@ -310,7 +310,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, return NULL; } - assert(p_atomic_read(&buf->buffer->base.reference.count) >= 1); + assert(pipe_is_referenced(&buf->buffer->base.reference)); assert(pb_check_alignment(desc->alignment, buf->buffer->base.alignment)); assert(pb_check_usage(desc->usage, buf->buffer->base.usage)); assert(buf->buffer->base.size >= size); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index 478682dbee..f1a05be46e 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -208,7 +208,7 @@ pb_debug_buffer_destroy(struct pb_buffer *_buf) { struct pb_debug_buffer *buf = pb_debug_buffer(_buf); - assert(p_atomic_read(&buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&buf->base.base.reference)); pb_debug_buffer_check(buf); @@ -315,7 +315,7 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr, return NULL; } - assert(p_atomic_read(&buf->buffer->base.reference.count) >= 1); + assert(pipe_is_referenced(&buf->buffer->base.reference)); assert(pb_check_alignment(real_desc.alignment, buf->buffer->base.alignment)); assert(pb_check_usage(real_desc.usage, buf->buffer->base.usage)); assert(buf->buffer->base.size >= real_size); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c index fb18dcc5dc..5a342fbf3b 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c @@ -97,7 +97,7 @@ mm_buffer_destroy(struct pb_buffer *buf) struct mm_buffer *mm_buf = mm_buffer(buf); struct mm_pb_manager *mm = mm_buf->mgr; - assert(p_atomic_read(&mm_buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&mm_buf->base.base.reference)); pipe_mutex_lock(mm->mutex); u_mmFreeMem(mm_buf->block); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c index 75b95e132e..07fd1a22d9 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c @@ -108,7 +108,7 @@ pool_buffer_destroy(struct pb_buffer *buf) struct pool_buffer *pool_buf = pool_buffer(buf); struct pool_pb_manager *pool = pool_buf->mgr; - assert(p_atomic_read(&pool_buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&pool_buf->base.base.reference)); pipe_mutex_lock(pool->mutex); LIST_ADD(&pool_buf->head, &pool->free); @@ -216,7 +216,7 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr, pipe_mutex_unlock(pool->mutex); pool_buf = LIST_ENTRY(struct pool_buffer, item, head); - assert(p_atomic_read(&pool_buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&pool_buf->base.base.reference)); pipe_reference_init(&pool_buf->base.base.reference, 1); pool_buf->base.base.alignment = desc->alignment; pool_buf->base.base.usage = desc->usage; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c index a431fd5211..724aaadb43 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c @@ -202,7 +202,7 @@ pb_slab_buffer_destroy(struct pb_buffer *_buf) pipe_mutex_lock(mgr->mutex); - assert(p_atomic_read(&buf->base.base.reference.count) == 0); + assert(!pipe_is_referenced(&buf->base.base.reference)); buf->mapCount = 0; |