assert(!pipe_is_referenced(&mm_buf->base.reference));
- pipe_mutex_lock(mm->mutex);
+ mtx_lock(&mm->mutex);
u_mmFreeMem(mm_buf->block);
FREE(mm_buf);
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
}
static void *
mm_buffer_map(struct pb_buffer *buf,
- unsigned flags,
+ enum pb_usage_flags flags,
void *flush_ctx)
{
struct mm_buffer *mm_buf = mm_buffer(buf);
static enum pipe_error
mm_buffer_validate(struct pb_buffer *buf,
struct pb_validate *vl,
- unsigned flags)
+ enum pb_usage_flags flags)
{
struct mm_buffer *mm_buf = mm_buffer(buf);
struct mm_pb_manager *mm = mm_buf->mgr;
if(!pb_check_alignment(desc->alignment, (pb_size)1 << mm->align2))
return NULL;
- pipe_mutex_lock(mm->mutex);
+ mtx_lock(&mm->mutex);
mm_buf = CALLOC_STRUCT(mm_buffer);
if (!mm_buf) {
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
return NULL;
}
mmDumpMemInfo(mm->heap);
#endif
FREE(mm_buf);
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
return NULL;
}
assert(0 <= (pb_size)mm_buf->block->ofs && (pb_size)mm_buf->block->ofs < mm->size);
assert(size <= (pb_size)mm_buf->block->size && (pb_size)mm_buf->block->ofs + (pb_size)mm_buf->block->size <= mm->size);
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
return SUPER(mm_buf);
}
{
struct mm_pb_manager *mm = mm_pb_manager(mgr);
- pipe_mutex_lock(mm->mutex);
+ mtx_lock(&mm->mutex);
u_mmDestroy(mm->heap);
pb_unmap(mm->buffer);
pb_reference(&mm->buffer, NULL);
- pipe_mutex_unlock(mm->mutex);
+ mtx_unlock(&mm->mutex);
FREE(mgr);
}
mm->size = size;
mm->align2 = align2; /* 64-byte alignment */
- pipe_mutex_init(mm->mutex);
+ (void) mtx_init(&mm->mutex, mtx_plain);
mm->buffer = buffer;