summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-07-05 00:53:13 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-07-05 00:53:13 +1000
commit77f8167d75d0016c76812fc147c06072e5729965 (patch)
treef610929b3fa6d62013593df797b9e05d7c1452b4 /src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
parent6f56b527d866506a323feb19f9d8529d40034af2 (diff)
parent194cfc7a4ed86653db34be0e331ad7c23b5334eb (diff)
Merge remote branch 'upstream/gallium-0.1' into gallium-0.1
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
index b9dff09804..598d9ce310 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
@@ -324,8 +324,10 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr,
if(!pb_check_alignment(desc->alignment, mgr->bufSize))
return NULL;
- /* XXX: check for compatible buffer usage too? */
-
+ assert(pb_check_usage(desc->usage, mgr->desc.usage));
+ if(!pb_check_usage(desc->usage, mgr->desc.usage))
+ return NULL;
+
_glthread_LOCK_MUTEX(mgr->mutex);
if (mgr->slabs.next == &mgr->slabs) {
(void) pb_slab_create(mgr);
@@ -438,6 +440,9 @@ pb_slab_range_manager_create(struct pb_manager *provider,
size_t bufSize;
unsigned i;
+ if(!provider)
+ return NULL;
+
mgr = CALLOC_STRUCT(pb_slab_range_manager);
if (!mgr)
goto out_err0;