freedreno: switch to simple_mtx
authorRob Clark <robdclark@chromium.org>
Tue, 28 Apr 2020 20:07:16 +0000 (13:07 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 29 Apr 2020 20:37:00 +0000 (20:37 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4810>

src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_screen.h

index 346ff856fbcc11047fa0794b38bf992976d41c7c..892adad3f24a71f5186777b7e1fb597328a075eb 100644 (file)
@@ -156,7 +156,7 @@ fd_screen_destroy(struct pipe_screen *pscreen)
 
        slab_destroy_parent(&screen->transfer_pool);
 
-       mtx_destroy(&screen->lock);
+       simple_mtx_destroy(&screen->lock);
 
        ralloc_free(screen->compiler);
 
@@ -964,7 +964,7 @@ fd_screen_create(struct fd_device *dev, struct renderonly *ro)
 
        list_inithead(&screen->context_list);
 
-       (void) mtx_init(&screen->lock, mtx_plain);
+       (void) simple_mtx_init(&screen->lock, mtx_plain);
 
        pscreen->destroy = fd_screen_destroy;
        pscreen->get_param = fd_screen_get_param;
index 6370b310b2bb5157139e131af3078008bf144251..c70eb3b61360f986a296e6b3de7b5253a24adb8b 100644 (file)
@@ -34,7 +34,7 @@
 #include "pipe/p_screen.h"
 #include "util/u_memory.h"
 #include "util/slab.h"
-#include "os/os_thread.h"
+#include "util/simple_mtx.h"
 #include "renderonly/renderonly.h"
 
 #include "freedreno_batch_cache.h"
@@ -48,7 +48,7 @@ struct fd_screen {
 
        struct list_head context_list;
 
-       mtx_t lock;
+       simple_mtx_t lock;
 
        /* it would be tempting to use pipe_reference here, but that
         * really doesn't work well if it isn't the first member of
@@ -137,19 +137,19 @@ fd_screen(struct pipe_screen *pscreen)
 static inline void
 fd_screen_lock(struct fd_screen *screen)
 {
-       mtx_lock(&screen->lock);
+       simple_mtx_lock(&screen->lock);
 }
 
 static inline void
 fd_screen_unlock(struct fd_screen *screen)
 {
-       mtx_unlock(&screen->lock);
+       simple_mtx_unlock(&screen->lock);
 }
 
 static inline void
 fd_screen_assert_locked(struct fd_screen *screen)
 {
-       pipe_mutex_assert_locked(screen->lock);
+       simple_mtx_assert_locked(&screen->lock);
 }
 
 bool fd_screen_bo_get_handle(struct pipe_screen *pscreen,