freedreno: switch to simple_mtx

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>
This commit is contained in:
Rob Clark 2020-04-28 13:07:16 -07:00 committed by Marge Bot
parent 336a8cd82a
commit 27cafa9a51
2 changed files with 7 additions and 7 deletions

View 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;

View 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,