freedreno: Fixes error: passing argument 1 of ‘pthread_mutex_unlock’ from incompatible pointer type in tu_pipeline.c

src/freedreno/vulkan/tu_pipeline.c:4723:25: error: passing argument 1 of ‘pthread_mutex_unlock’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 4723 |    pthread_mutex_unlock(&dev->pipeline_mutex);
      |                         ^~~~~~~~~~~~~~~~~~~~
      |                         |
      |                         mtx_t *
In file included from ../../src/freedreno/vulkan/tu_common.h:14,
                 from ../../src/freedreno/vulkan/tu_pipeline.h:13,
                 from ../../src/freedreno/vulkan/tu_pipeline.c:10:
/usr/include/pthread.h:835:51: note: expected ‘pthread_mutex_t *’ but argument is of type ‘mtx_t *’
  835 | extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23733>
This commit is contained in:
Yonggang Luo 2023-02-13 16:43:39 +08:00 committed by Marge Bot
parent 1f3869ed4e
commit 2e4f874fa5

View file

@ -2557,10 +2557,10 @@ tu_pipeline_allocate_cs(struct tu_device *dev,
* can't use its EXTERNALLY_SYNCHRONIZED flag to avoid atomics because
* pipeline destroy isn't synchronized by the cache.
*/
pthread_mutex_lock(&dev->pipeline_mutex);
mtx_lock(&dev->pipeline_mutex);
VkResult result = tu_suballoc_bo_alloc(&pipeline->bo, &dev->pipeline_suballoc,
size * 4, 128);
pthread_mutex_unlock(&dev->pipeline_mutex);
mtx_unlock(&dev->pipeline_mutex);
if (result != VK_SUCCESS)
return result;
@ -4832,9 +4832,9 @@ tu_pipeline_finish(struct tu_pipeline *pipeline,
const VkAllocationCallbacks *alloc)
{
tu_cs_finish(&pipeline->cs);
pthread_mutex_lock(&dev->pipeline_mutex);
mtx_lock(&dev->pipeline_mutex);
tu_suballoc_bo_free(&dev->pipeline_suballoc, &pipeline->bo);
pthread_mutex_unlock(&dev->pipeline_mutex);
mtx_unlock(&dev->pipeline_mutex);
if (pipeline->pvtmem_bo)
tu_bo_finish(dev, pipeline->pvtmem_bo);