From 44ccaca41d41e5dfa660f7c2fb6e50aa2ff03e22 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sat, 3 Sep 2022 00:13:15 +0800 Subject: [PATCH] util/mesa/wide: Rename _SIMPLE_MTX_INITIALIZER_NP to SIMPLE_MTX_INITIALIZER Signed-off-by: Yonggang Luo Reviewed-by: Jesse Natalie Part-of: --- src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c | 2 +- src/egl/main/eglglobals.c | 2 +- src/etnaviv/drm/etnaviv_bo.c | 2 +- src/freedreno/drm/freedreno_bo.c | 2 +- src/gallium/drivers/crocus/crocus_bufmgr.c | 2 +- src/gallium/drivers/iris/iris_bufmgr.c | 2 +- src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c | 2 +- src/intel/nullhw-layer/intel_nullhw.c | 2 +- src/mesa/main/bufferobj.c | 2 +- src/mesa/main/fbobject.c | 4 ++-- src/mesa/main/version.c | 2 +- src/panfrost/lib/genxml/decode_common.c | 2 +- src/util/perf/u_trace.c | 2 +- src/util/simple_mtx.h | 4 ++-- src/virtio/vulkan/vn_cs.c | 2 +- src/vulkan/overlay-layer/overlay.cpp | 2 +- 16 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c index 54d9cab33b5..5b5f2409a97 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -138,7 +138,7 @@ radv_amdgpu_winsys_get_chip_name(struct radeon_winsys *rws) return amdgpu_get_marketing_name(dev); } -static simple_mtx_t winsys_creation_mutex = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t winsys_creation_mutex = SIMPLE_MTX_INITIALIZER; static struct hash_table *winsyses = NULL; static void diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c index 93013ea6ff1..6ae161fcb54 100644 --- a/src/egl/main/eglglobals.c +++ b/src/egl/main/eglglobals.c @@ -47,7 +47,7 @@ #endif -static simple_mtx_t _eglGlobalMutex = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t _eglGlobalMutex = SIMPLE_MTX_INITIALIZER; struct _egl_global _eglGlobal = { diff --git a/src/etnaviv/drm/etnaviv_bo.c b/src/etnaviv/drm/etnaviv_bo.c index 8384b98735c..d790823bcb7 100644 --- a/src/etnaviv/drm/etnaviv_bo.c +++ b/src/etnaviv/drm/etnaviv_bo.c @@ -30,7 +30,7 @@ #include "etnaviv_priv.h" #include "etnaviv_drmif.h" -simple_mtx_t etna_device_lock = _SIMPLE_MTX_INITIALIZER_NP; +simple_mtx_t etna_device_lock = SIMPLE_MTX_INITIALIZER; /* set buffer name, and add to table, call w/ etna_drm_table_lock held: */ static void set_name(struct etna_bo *bo, uint32_t name) diff --git a/src/freedreno/drm/freedreno_bo.c b/src/freedreno/drm/freedreno_bo.c index cbc31000fae..fa63709e37c 100644 --- a/src/freedreno/drm/freedreno_bo.c +++ b/src/freedreno/drm/freedreno_bo.c @@ -29,7 +29,7 @@ #include "freedreno_drmif.h" #include "freedreno_priv.h" -simple_mtx_t table_lock = _SIMPLE_MTX_INITIALIZER_NP; +simple_mtx_t table_lock = SIMPLE_MTX_INITIALIZER; void bo_del(struct fd_bo *bo); /* set buffer name, and add to table, call w/ table_lock held: */ diff --git a/src/gallium/drivers/crocus/crocus_bufmgr.c b/src/gallium/drivers/crocus/crocus_bufmgr.c index 060ad7542a8..eddcadbcaba 100644 --- a/src/gallium/drivers/crocus/crocus_bufmgr.c +++ b/src/gallium/drivers/crocus/crocus_bufmgr.c @@ -164,7 +164,7 @@ struct crocus_bufmgr { bool bo_reuse:1; }; -static simple_mtx_t global_bufmgr_list_mutex = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t global_bufmgr_list_mutex = SIMPLE_MTX_INITIALIZER; static struct list_head global_bufmgr_list = { .next = &global_bufmgr_list, .prev = &global_bufmgr_list, diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index 9c9aefa716a..a70dbaa8375 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -247,7 +247,7 @@ struct iris_bufmgr { struct iris_border_color_pool border_color_pool; }; -static simple_mtx_t global_bufmgr_list_mutex = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t global_bufmgr_list_mutex = SIMPLE_MTX_INITIALIZER; static struct list_head global_bufmgr_list = { .next = &global_bufmgr_list, .prev = &global_bufmgr_list, diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c index 318197b1ae2..05ff784d34f 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c @@ -44,7 +44,7 @@ #include "sid.h" static struct hash_table *dev_tab = NULL; -static simple_mtx_t dev_tab_mutex = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t dev_tab_mutex = SIMPLE_MTX_INITIALIZER; #if DEBUG DEBUG_GET_ONCE_BOOL_OPTION(all_bos, "RADEON_ALL_BOS", false) diff --git a/src/intel/nullhw-layer/intel_nullhw.c b/src/intel/nullhw-layer/intel_nullhw.c index 308b2893edc..9320d0bddcc 100644 --- a/src/intel/nullhw-layer/intel_nullhw.c +++ b/src/intel/nullhw-layer/intel_nullhw.c @@ -54,7 +54,7 @@ struct device_data { }; static struct hash_table_u64 *vk_object_to_data = NULL; -static simple_mtx_t vk_object_to_data_mutex = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t vk_object_to_data_mutex = SIMPLE_MTX_INITIALIZER; static inline void ensure_vk_object_map(void) { diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 0c267dd3cbe..38129d46230 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -650,7 +650,7 @@ buffer_usage_warning(struct gl_context *ctx, GLuint *id, const char *fmt, ...) * glBindBuffer() so that glIsBuffer() can work correctly. */ static struct gl_buffer_object DummyBufferObject = { - .MinMaxCacheMutex = _SIMPLE_MTX_INITIALIZER_NP, + .MinMaxCacheMutex = SIMPLE_MTX_INITIALIZER, .RefCount = 1000*1000*1000, /* never delete */ }; diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 9d90beac67e..be1d61907a4 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -86,7 +86,7 @@ delete_dummy_framebuffer(struct gl_framebuffer *fb) * with the real frame/renderbuffer. */ static struct gl_framebuffer DummyFramebuffer = { - .Mutex = _SIMPLE_MTX_INITIALIZER_NP, + .Mutex = SIMPLE_MTX_INITIALIZER, .Delete = delete_dummy_framebuffer, }; static struct gl_renderbuffer DummyRenderbuffer = { @@ -96,7 +96,7 @@ static struct gl_renderbuffer DummyRenderbuffer = { /* We bind this framebuffer when applications pass a NULL * drawable/surface in make current. */ static struct gl_framebuffer IncompleteFramebuffer = { - .Mutex = _SIMPLE_MTX_INITIALIZER_NP, + .Mutex = SIMPLE_MTX_INITIALIZER, .Delete = delete_dummy_framebuffer, }; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 74220657b4e..8b72b08c223 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -36,7 +36,7 @@ #include "state_tracker/st_context.h" -static simple_mtx_t override_lock = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t override_lock = SIMPLE_MTX_INITIALIZER; /** * Scans 'string' to see if it ends with 'ending'. diff --git a/src/panfrost/lib/genxml/decode_common.c b/src/panfrost/lib/genxml/decode_common.c index 18f3ed11d8c..ecc02387175 100644 --- a/src/panfrost/lib/genxml/decode_common.c +++ b/src/panfrost/lib/genxml/decode_common.c @@ -44,7 +44,7 @@ static struct rb_tree mmap_tree; static struct util_dynarray ro_mappings; -static simple_mtx_t pandecode_lock = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t pandecode_lock = SIMPLE_MTX_INITIALIZER; #define to_mapped_memory(x) \ rb_node_data(struct pandecode_mapped_memory, x, node) diff --git a/src/util/perf/u_trace.c b/src/util/perf/u_trace.c index a73cd1384ff..11e10b296a2 100644 --- a/src/util/perf/u_trace.c +++ b/src/util/perf/u_trace.c @@ -59,7 +59,7 @@ int ut_perfetto_enabled; */ static struct list_head ctx_list = { &ctx_list, &ctx_list }; -static simple_mtx_t ctx_list_mutex = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t ctx_list_mutex = SIMPLE_MTX_INITIALIZER; #endif struct u_trace_payload_buf { diff --git a/src/util/simple_mtx.h b/src/util/simple_mtx.h index acfd649b529..90092d7a534 100644 --- a/src/util/simple_mtx.h +++ b/src/util/simple_mtx.h @@ -77,7 +77,7 @@ typedef struct { uint32_t val; } simple_mtx_t; -#define _SIMPLE_MTX_INITIALIZER_NP { 0 } +#define SIMPLE_MTX_INITIALIZER { 0 } #define _SIMPLE_MTX_INVALID_VALUE 0xd0d0d0d0 @@ -151,7 +151,7 @@ typedef struct simple_mtx_t { mtx_t mtx; } simple_mtx_t; -#define _SIMPLE_MTX_INITIALIZER_NP { UTIL_ONCE_FLAG_INIT } +#define SIMPLE_MTX_INITIALIZER { UTIL_ONCE_FLAG_INIT } void _simple_mtx_plain_init_once(simple_mtx_t *mtx); diff --git a/src/virtio/vulkan/vn_cs.c b/src/virtio/vulkan/vn_cs.c index 8c242d4cc95..54a3cc0d91c 100644 --- a/src/virtio/vulkan/vn_cs.c +++ b/src/virtio/vulkan/vn_cs.c @@ -9,7 +9,7 @@ #include "vn_renderer.h" struct vn_cs_renderer_protocol_info _vn_cs_renderer_protocol_info = { - .mutex = _SIMPLE_MTX_INITIALIZER_NP, + .mutex = SIMPLE_MTX_INITIALIZER, }; static void diff --git a/src/vulkan/overlay-layer/overlay.cpp b/src/vulkan/overlay-layer/overlay.cpp index 8e3f4f70509..8171fe0c177 100644 --- a/src/vulkan/overlay-layer/overlay.cpp +++ b/src/vulkan/overlay-layer/overlay.cpp @@ -216,7 +216,7 @@ static const VkQueryPipelineStatisticFlags overlay_query_flags = #define OVERLAY_QUERY_COUNT (11) static struct hash_table_u64 *vk_object_to_data = NULL; -static simple_mtx_t vk_object_to_data_mutex = _SIMPLE_MTX_INITIALIZER_NP; +static simple_mtx_t vk_object_to_data_mutex = SIMPLE_MTX_INITIALIZER; thread_local ImGuiContext* __MesaImGui;