v3dv: Don't use pthread functions on c11 mutexes

This only works because c11/threads.h is typedeffing the c11 stuff to
ptrheads.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15704>
This commit is contained in:
Jason Ekstrand
2022-04-04 08:40:30 -05:00
committed by Marge Bot
parent 25441b5e5c
commit 30191fd9df
2 changed files with 11 additions and 11 deletions
+7 -7
View File
@@ -852,7 +852,7 @@ physical_device_init(struct v3dv_physical_device *device,
get_device_extensions(device, &device->vk.supported_extensions);
pthread_mutex_init(&device->mutex, NULL);
mtx_init(&device->mutex, mtx_plain);
return VK_SUCCESS;
@@ -1857,8 +1857,8 @@ queue_init(struct v3dv_device *device, struct v3dv_queue *queue,
queue->device = device;
queue->noop_job = NULL;
list_inithead(&queue->submit_wait_list);
pthread_mutex_init(&queue->mutex, NULL);
pthread_mutex_init(&queue->noop_mutex, NULL);
mtx_init(&queue->mutex, mtx_plain);
mtx_init(&queue->noop_mutex, mtx_plain);
return VK_SUCCESS;
}
@@ -1869,8 +1869,8 @@ queue_finish(struct v3dv_queue *queue)
assert(list_is_empty(&queue->submit_wait_list));
if (queue->noop_job)
v3dv_job_destroy(queue->noop_job);
pthread_mutex_destroy(&queue->mutex);
pthread_mutex_destroy(&queue->noop_mutex);
mtx_destroy(&queue->mutex);
mtx_destroy(&queue->noop_mutex);
}
static void
@@ -1944,7 +1944,7 @@ v3dv_CreateDevice(VkPhysicalDevice physicalDevice,
device->instance = instance;
device->pdevice = physical_device;
pthread_mutex_init(&device->mutex, NULL);
mtx_init(&device->mutex, mtx_plain);
result = queue_init(device, &device->queue,
pCreateInfo->pQueueCreateInfos, 0);
@@ -2012,7 +2012,7 @@ v3dv_DestroyDevice(VkDevice _device,
v3dv_DeviceWaitIdle(_device);
queue_finish(&device->queue);
pthread_mutex_destroy(&device->mutex);
mtx_destroy(&device->mutex);
destroy_device_syncs(device, device->pdevice->render_fd);
destroy_device_meta(device);
v3dv_pipeline_cache_finish(&device->default_pipeline_cache);
+4 -4
View File
@@ -67,14 +67,14 @@ static void
pipeline_cache_lock(struct v3dv_pipeline_cache *cache)
{
if (!cache->externally_synchronized)
pthread_mutex_lock(&cache->mutex);
mtx_lock(&cache->mutex);
}
static void
pipeline_cache_unlock(struct v3dv_pipeline_cache *cache)
{
if (!cache->externally_synchronized)
pthread_mutex_unlock(&cache->mutex);
mtx_unlock(&cache->mutex);
}
void
@@ -203,7 +203,7 @@ v3dv_pipeline_cache_init(struct v3dv_pipeline_cache *cache,
bool cache_enabled)
{
cache->device = device;
pthread_mutex_init(&cache->mutex, NULL);
mtx_init(&cache->mutex, mtx_plain);
if (cache_enabled) {
cache->nir_cache = _mesa_hash_table_create(NULL, sha1_hash_func,
@@ -714,7 +714,7 @@ v3dv_CreatePipelineCache(VkDevice _device,
void
v3dv_pipeline_cache_finish(struct v3dv_pipeline_cache *cache)
{
pthread_mutex_destroy(&cache->mutex);
mtx_destroy(&cache->mutex);
if (dump_stats_on_destroy)
cache_dump_stats(cache);