struct list_head head;
};
-pipe_static_mutex(list_mutex);
+static mtx_t list_mutex = _MTX_INITIALIZER_NP;
static struct list_head ctx_list = {&ctx_list, &ctx_list};
static struct debug_stack_frame *
fbuf->supports_unsync = supports_unsync;
fbuf->bt_depth = bt_depth;
pipe_reference_init(&fbuf->reference, 1);
- pipe_mutex_init(fbuf->mutex);
+ (void) mtx_init(&fbuf->mutex, mtx_plain);
return fbuf;
out_no_buf:
goto out_no_ref_hash;
fctx->bt_depth = bt_depth;
- pipe_mutex_lock(list_mutex);
+ mtx_lock(&list_mutex);
list_addtail(&fctx->head, &ctx_list);
- pipe_mutex_unlock(list_mutex);
+ mtx_unlock(&list_mutex);
return fctx;
if (!fbuf)
return;
- pipe_mutex_lock(fbuf->mutex);
+ mtx_lock(&fbuf->mutex);
if (fbuf->mapped) {
debug_flush_alert("Recursive map detected.", "Map",
2, fbuf->bt_depth, TRUE, TRUE, NULL);
}
fbuf->map_frame = debug_flush_capture_frame(1, fbuf->bt_depth);
fbuf->mapped = TRUE;
- pipe_mutex_unlock(fbuf->mutex);
+ mtx_unlock(&fbuf->mutex);
if (mapped_sync) {
struct debug_flush_ctx *fctx;
- pipe_mutex_lock(list_mutex);
+ mtx_lock(&list_mutex);
LIST_FOR_EACH_ENTRY(fctx, &ctx_list, head) {
struct debug_flush_item *item =
util_hash_table_get(fctx->ref_hash, fbuf);
FALSE, FALSE, item->ref_frame);
}
}
- pipe_mutex_unlock(list_mutex);
+ mtx_unlock(&list_mutex);
}
}
if (!fbuf)
return;
- pipe_mutex_lock(fbuf->mutex);
+ mtx_lock(&fbuf->mutex);
if (!fbuf->mapped)
debug_flush_alert("Unmap not previously mapped detected.", "Map",
2, fbuf->bt_depth, FALSE, TRUE, NULL);
fbuf->mapped = FALSE;
FREE(fbuf->map_frame);
fbuf->map_frame = NULL;
- pipe_mutex_unlock(fbuf->mutex);
+ mtx_unlock(&fbuf->mutex);
}
void
item = util_hash_table_get(fctx->ref_hash, fbuf);
- pipe_mutex_lock(fbuf->mutex);
+ mtx_lock(&fbuf->mutex);
if (fbuf->mapped_sync) {
debug_flush_alert("Reference of mapped buffer detected.", "Reference",
2, fctx->bt_depth, TRUE, TRUE, NULL);
debug_flush_alert(NULL, "Map", 0, fbuf->bt_depth, FALSE,
FALSE, fbuf->map_frame);
}
- pipe_mutex_unlock(fbuf->mutex);
+ mtx_unlock(&fbuf->mutex);
if (!item) {
item = CALLOC_STRUCT(debug_flush_item);
util_snprintf(message, sizeof(message),
"%s referenced mapped buffer detected.", reason);
- pipe_mutex_lock(fbuf->mutex);
+ mtx_lock(&fbuf->mutex);
if (fbuf->mapped_sync) {
debug_flush_alert(message, reason, 3, item->bt_depth, TRUE, TRUE, NULL);
debug_flush_alert(NULL, "Map", 0, fbuf->bt_depth, TRUE, FALSE,
debug_flush_alert(NULL, "First reference", 0, item->bt_depth, FALSE,
FALSE, item->ref_frame);
}
- pipe_mutex_unlock(fbuf->mutex);
+ mtx_unlock(&fbuf->mutex);
return PIPE_OK;
}