[Mesa-dev] [PATCH 1/7] gallium/util: replace pipe_mutex with mtx_t
Timothy Arceri
tarceri at itsqueeze.com
Sun Mar 5 01:32:01 UTC 2017
pipe_mutex was made unnecessary with fd33a6bcd7f12.
---
src/gallium/auxiliary/os/os_thread.h | 14 +++++---------
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c | 2 +-
src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 4 ++--
src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c | 2 +-
src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c | 2 +-
src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 2 +-
src/gallium/auxiliary/pipebuffer/pb_cache.h | 2 +-
src/gallium/auxiliary/pipebuffer/pb_slab.h | 2 +-
src/gallium/auxiliary/util/u_debug_flush.c | 2 +-
src/gallium/auxiliary/util/u_queue.h | 4 ++--
src/gallium/auxiliary/util/u_range.h | 2 +-
src/gallium/auxiliary/util/u_ringbuffer.c | 2 +-
src/gallium/drivers/ddebug/dd_pipe.h | 2 +-
src/gallium/drivers/freedreno/freedreno_screen.h | 2 +-
src/gallium/drivers/llvmpipe/lp_fence.h | 2 +-
src/gallium/drivers/llvmpipe/lp_scene.h | 2 +-
src/gallium/drivers/llvmpipe/lp_screen.h | 2 +-
src/gallium/drivers/nouveau/nv50/nv50_surface.c | 2 +-
src/gallium/drivers/nouveau/nvc0/nvc0_surface.c | 2 +-
src/gallium/drivers/r300/r300_screen.h | 2 +-
src/gallium/drivers/radeon/r600_pipe_common.h | 4 ++--
src/gallium/drivers/radeonsi/si_pipe.h | 4 ++--
src/gallium/drivers/radeonsi/si_shader.h | 2 +-
src/gallium/drivers/rbug/rbug_context.h | 6 +++---
src/gallium/drivers/rbug/rbug_screen.h | 2 +-
src/gallium/drivers/svga/svga_screen.h | 4 ++--
src/gallium/drivers/svga/svga_screen_cache.h | 2 +-
src/gallium/drivers/vc4/vc4_screen.h | 4 ++--
src/gallium/state_trackers/dri/dri_screen.h | 2 +-
src/gallium/state_trackers/glx/xlib/xm_api.h | 2 +-
src/gallium/state_trackers/hgl/hgl_context.h | 2 +-
src/gallium/state_trackers/nine/nine_queue.c | 4 ++--
src/gallium/state_trackers/nine/nine_state.c | 6 +++---
src/gallium/state_trackers/va/va_private.h | 2 +-
src/gallium/state_trackers/vdpau/vdpau_private.h | 4 ++--
src/gallium/targets/haiku-softpipe/GalliumContext.h | 2 +-
src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h | 4 ++--
src/gallium/winsys/radeon/drm/radeon_drm_bo.h | 2 +-
src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 2 +-
src/gallium/winsys/radeon/drm/radeon_drm_winsys.h | 10 +++++-----
src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c | 2 +-
src/gallium/winsys/svga/drm/vmw_fence.c | 2 +-
src/gallium/winsys/svga/drm/vmw_surface.h | 2 +-
src/gallium/winsys/virgl/drm/virgl_drm_winsys.h | 4 ++--
src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h | 2 +-
45 files changed, 67 insertions(+), 71 deletions(-)
diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h
index 6eca2ca..af350b8 100644
--- a/src/gallium/auxiliary/os/os_thread.h
+++ b/src/gallium/auxiliary/os/os_thread.h
@@ -101,48 +101,44 @@ static inline int pipe_thread_is_self( pipe_thread thread )
{
#if defined(HAVE_PTHREAD)
# if defined(__GNU_LIBRARY__) && defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \
(__GLIBC__ >= 3 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 12))
return pthread_equal(pthread_self(), thread);
# endif
#endif
return 0;
}
-/* pipe_mutex
- */
-typedef mtx_t pipe_mutex;
-
#define pipe_static_mutex(mutex) \
- static pipe_mutex mutex = _MTX_INITIALIZER_NP
+ static mtx_t mutex = _MTX_INITIALIZER_NP
#define pipe_mutex_init(mutex) \
(void) mtx_init(&(mutex), mtx_plain)
#define pipe_mutex_destroy(mutex) \
mtx_destroy(&(mutex))
#define pipe_mutex_lock(mutex) \
(void) mtx_lock(&(mutex))
#define pipe_mutex_unlock(mutex) \
(void) mtx_unlock(&(mutex))
#define pipe_mutex_assert_locked(mutex) \
__pipe_mutex_assert_locked(&(mutex))
static inline void
-__pipe_mutex_assert_locked(pipe_mutex *mutex)
+__pipe_mutex_assert_locked(mtx_t *mutex)
{
#ifdef DEBUG
/* NOTE: this would not work for recursive mutexes, but
- * pipe_mutex doesn't support those
+ * mtx_t doesn't support those
*/
int ret = mtx_trylock(mutex);
assert(ret == thrd_busy);
if (ret == thrd_success)
mtx_unlock(mutex);
#endif
}
/* pipe_condvar
*/
@@ -172,21 +168,21 @@ static inline void pipe_barrier_wait(pipe_barrier *barrier)
pthread_barrier_wait(barrier);
}
#else /* If the OS doesn't have its own, implement barriers using a mutex and a condvar */
typedef struct {
unsigned count;
unsigned waiters;
uint64_t sequence;
- pipe_mutex mutex;
+ mtx_t mutex;
pipe_condvar condvar;
} pipe_barrier;
static inline void pipe_barrier_init(pipe_barrier *barrier, unsigned count)
{
barrier->count = count;
barrier->waiters = 0;
barrier->sequence = 0;
pipe_mutex_init(barrier->mutex);
cnd_init(&barrier->condvar);
@@ -224,21 +220,21 @@ static inline void pipe_barrier_wait(pipe_barrier *barrier)
#endif
/*
* Semaphores
*/
typedef struct
{
- pipe_mutex mutex;
+ mtx_t mutex;
pipe_condvar cond;
int counter;
} pipe_semaphore;
static inline void
pipe_semaphore_init(pipe_semaphore *sema, int init_val)
{
pipe_mutex_init(sema->mutex);
cnd_init(&sema->cond);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
index 7717d78..f5e761b 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
@@ -74,21 +74,21 @@ struct fenced_manager
/**
* Maximum cpu memory we can allocate before we start waiting for the
* GPU to idle.
*/
pb_size max_cpu_total_size;
/**
* Following members are mutable and protected by this mutex.
*/
- pipe_mutex mutex;
+ mtx_t mutex;
/**
* Fenced buffer list.
*
* All fenced buffers are placed in this listed, ordered from the oldest
* fence to the newest fence.
*/
struct list_head fenced;
pb_size num_fenced;
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
index 4e36866..26ce603 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
@@ -71,38 +71,38 @@ struct pb_debug_buffer
struct pb_buffer base;
struct pb_buffer *buffer;
struct pb_debug_manager *mgr;
pb_size underflow_size;
pb_size overflow_size;
struct debug_stack_frame create_backtrace[PB_DEBUG_CREATE_BACKTRACE];
- pipe_mutex mutex;
+ mtx_t mutex;
unsigned map_count;
struct debug_stack_frame map_backtrace[PB_DEBUG_MAP_BACKTRACE];
struct list_head head;
};
struct pb_debug_manager
{
struct pb_manager base;
struct pb_manager *provider;
pb_size underflow_size;
pb_size overflow_size;
- pipe_mutex mutex;
+ mtx_t mutex;
struct list_head list;
};
static inline struct pb_debug_buffer *
pb_debug_buffer(struct pb_buffer *buf)
{
assert(buf);
return (struct pb_debug_buffer *)buf;
}
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
index 023a028..ef7e5ad 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
@@ -46,21 +46,21 @@
/**
* Convenience macro (type safe).
*/
#define SUPER(__derived) (&(__derived)->base)
struct mm_pb_manager
{
struct pb_manager base;
- pipe_mutex mutex;
+ mtx_t mutex;
pb_size size;
struct mem_block *heap;
pb_size align2;
struct pb_buffer *buffer;
void *map;
};
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
index 98877b4..3bfe720 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
@@ -49,21 +49,21 @@
/**
* Convenience macro (type safe).
*/
#define SUPER(__derived) (&(__derived)->base)
struct pool_pb_manager
{
struct pb_manager base;
- pipe_mutex mutex;
+ mtx_t mutex;
pb_size bufSize;
pb_size bufAlign;
pb_size numFree;
pb_size numTot;
struct list_head free;
struct pb_buffer *buffer;
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
index cc42eea..54aba98 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
@@ -121,21 +121,21 @@ struct pb_slab_manager
struct pb_desc desc;
/**
* Partial slabs
*
* Full slabs are not stored in any list. Empty slabs are destroyed
* immediatly.
*/
struct list_head slabs;
- pipe_mutex mutex;
+ mtx_t mutex;
};
/**
* Wrapper around several slabs, therefore capable of handling buffers of
* multiple sizes.
*
* This buffer manager just dispatches buffer allocations to the appropriate slab
* manager, according to the requested buffer size, or by passes the slab
* managers altogether for even greater sizes.
diff --git a/src/gallium/auxiliary/pipebuffer/pb_cache.h b/src/gallium/auxiliary/pipebuffer/pb_cache.h
index 7000fcd..d082eca 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_cache.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_cache.h
@@ -45,21 +45,21 @@ struct pb_cache_entry
unsigned bucket_index;
};
struct pb_cache
{
/* The cache is divided into buckets for minimizing cache misses.
* The driver controls which buffer goes into which bucket.
*/
struct list_head buckets[4];
- pipe_mutex mutex;
+ mtx_t mutex;
uint64_t cache_size;
uint64_t max_cache_size;
unsigned usecs;
unsigned num_buffers;
unsigned bypass_usage;
float size_factor;
void (*destroy_buffer)(struct pb_buffer *buf);
bool (*can_reclaim)(struct pb_buffer *buf);
};
diff --git a/src/gallium/auxiliary/pipebuffer/pb_slab.h b/src/gallium/auxiliary/pipebuffer/pb_slab.h
index e779d95..78a4bf7 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_slab.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_slab.h
@@ -103,21 +103,21 @@ typedef void (slab_free_fn)(void *priv, struct pb_slab *);
/* Callback function to determine whether a given entry can already be reused.
*/
typedef bool (slab_can_reclaim_fn)(void *priv, struct pb_slab_entry *);
/* Manager of slab allocations. The user of this utility library should embed
* this in a structure somewhere and call pb_slab_init/deinit at init/shutdown
* time.
*/
struct pb_slabs
{
- pipe_mutex mutex;
+ mtx_t mutex;
unsigned min_order;
unsigned num_orders;
unsigned num_heaps;
/* One group per (heap, order) pair. */
struct pb_slab_group *groups;
/* List of entries waiting to be reclaimed, i.e. they have been passed to
* pb_slab_free, but may not be safe for re-use yet. The tail points at
diff --git a/src/gallium/auxiliary/util/u_debug_flush.c b/src/gallium/auxiliary/util/u_debug_flush.c
index 52e72cd..6a8a91d 100644
--- a/src/gallium/auxiliary/util/u_debug_flush.c
+++ b/src/gallium/auxiliary/util/u_debug_flush.c
@@ -46,21 +46,21 @@
#include "util/u_hash_table.h"
#include "util/list.h"
#include "util/u_inlines.h"
#include "util/u_string.h"
#include "os/os_thread.h"
#include <stdio.h>
struct debug_flush_buf {
/* Atomic */
struct pipe_reference reference; /* Must be the first member. */
- pipe_mutex mutex;
+ mtx_t mutex;
/* Immutable */
boolean supports_unsync;
unsigned bt_depth;
/* Protected by mutex */
boolean mapped;
boolean mapped_sync;
struct debug_stack_frame *map_frame;
};
struct debug_flush_item {
diff --git a/src/gallium/auxiliary/util/u_queue.h b/src/gallium/auxiliary/util/u_queue.h
index 2e0a5a3..8d4804f 100644
--- a/src/gallium/auxiliary/util/u_queue.h
+++ b/src/gallium/auxiliary/util/u_queue.h
@@ -33,38 +33,38 @@
#ifndef U_QUEUE_H
#define U_QUEUE_H
#include "os/os_thread.h"
#include "util/list.h"
/* Job completion fence.
* Put this into your job structure.
*/
struct util_queue_fence {
- pipe_mutex mutex;
+ mtx_t mutex;
pipe_condvar cond;
int signalled;
};
typedef void (*util_queue_execute_func)(void *job, int thread_index);
struct util_queue_job {
void *job;
struct util_queue_fence *fence;
util_queue_execute_func execute;
util_queue_execute_func cleanup;
};
/* Put this into your context. */
struct util_queue {
const char *name;
- pipe_mutex lock;
+ mtx_t lock;
pipe_condvar has_queued_cond;
pipe_condvar has_space_cond;
pipe_thread *threads;
int num_queued;
unsigned num_threads;
int kill_threads;
int max_jobs;
int write_idx, read_idx; /* ring buffer pointers */
struct util_queue_job *jobs;
diff --git a/src/gallium/auxiliary/util/u_range.h b/src/gallium/auxiliary/util/u_range.h
index a1da5e5..9055d7b 100644
--- a/src/gallium/auxiliary/util/u_range.h
+++ b/src/gallium/auxiliary/util/u_range.h
@@ -36,21 +36,21 @@
#include "os/os_thread.h"
#include "util/u_math.h"
struct util_range {
unsigned start; /* inclusive */
unsigned end; /* exclusive */
/* for the range to be consistent with multiple contexts: */
- pipe_mutex write_mutex;
+ mtx_t write_mutex;
};
static inline void
util_range_set_empty(struct util_range *range)
{
range->start = ~0;
range->end = 0;
}
diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c b/src/gallium/auxiliary/util/u_ringbuffer.c
index a97236f..19f82f5 100644
--- a/src/gallium/auxiliary/util/u_ringbuffer.c
+++ b/src/gallium/auxiliary/util/u_ringbuffer.c
@@ -10,21 +10,21 @@
struct util_ringbuffer
{
struct util_packet *buf;
unsigned mask;
/* Can this be done with atomic variables??
*/
unsigned head;
unsigned tail;
pipe_condvar change;
- pipe_mutex mutex;
+ mtx_t mutex;
};
struct util_ringbuffer *util_ringbuffer_create( unsigned dwords )
{
struct util_ringbuffer *ring = CALLOC_STRUCT(util_ringbuffer);
if (!ring)
return NULL;
assert(util_is_power_of_two(dwords));
diff --git a/src/gallium/drivers/ddebug/dd_pipe.h b/src/gallium/drivers/ddebug/dd_pipe.h
index 08cd1e3..dc7c325 100644
--- a/src/gallium/drivers/ddebug/dd_pipe.h
+++ b/src/gallium/drivers/ddebug/dd_pipe.h
@@ -228,21 +228,21 @@ struct dd_context
* a copy of all states, the output of pipe_context::dump_debug_state,
* and it has a fence number assigned. That's done without knowing whether
* that draw call is problematic or not. The record is added into the list
* of all records.
*
* An independent, separate thread loops over the list of records and checks
* their fences. Records with signalled fences are freed. On fence timeout,
* the thread dumps the record of the oldest unsignalled fence.
*/
pipe_thread thread;
- pipe_mutex mutex;
+ mtx_t mutex;
int kill_thread;
struct pipe_resource *fence;
struct pipe_transfer *fence_transfer;
uint32_t *mapped_fence;
uint32_t sequence_no;
struct dd_draw_record *records;
int max_log_buffer_size;
};
diff --git a/src/gallium/drivers/freedreno/freedreno_screen.h b/src/gallium/drivers/freedreno/freedreno_screen.h
index 087b07e..f2b1d8c 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.h
+++ b/src/gallium/drivers/freedreno/freedreno_screen.h
@@ -37,21 +37,21 @@
#include "util/slab.h"
#include "os/os_thread.h"
#include "freedreno_batch_cache.h"
struct fd_bo;
struct fd_screen {
struct pipe_screen base;
- pipe_mutex lock;
+ 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
* the struct, so not quite so awesome to be adding refcnting
* further down the inheritance hierarchy:
*/
int refcnt;
/* place for winsys to stash it's own stuff: */
void *winsys_priv;
diff --git a/src/gallium/drivers/llvmpipe/lp_fence.h b/src/gallium/drivers/llvmpipe/lp_fence.h
index d7f0c15..4fc0801 100644
--- a/src/gallium/drivers/llvmpipe/lp_fence.h
+++ b/src/gallium/drivers/llvmpipe/lp_fence.h
@@ -36,21 +36,21 @@
struct pipe_screen;
struct lp_fence
{
struct pipe_reference reference;
unsigned id;
- pipe_mutex mutex;
+ mtx_t mutex;
pipe_condvar signalled;
boolean issued;
unsigned rank;
unsigned count;
};
struct lp_fence *
lp_fence_create(unsigned rank);
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h
index b1464bb..da29057 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.h
+++ b/src/gallium/drivers/llvmpipe/lp_scene.h
@@ -167,21 +167,21 @@ struct lp_scene {
boolean alloc_failed;
boolean discard;
/**
* Number of active tiles in each dimension.
* This basically the framebuffer size divided by tile size
*/
unsigned tiles_x, tiles_y;
int curr_x, curr_y; /**< for iterating over bins */
- pipe_mutex mutex;
+ mtx_t mutex;
struct cmd_bin tile[TILES_X][TILES_Y];
struct data_block_list data;
};
struct lp_scene *lp_scene_create(struct pipe_context *pipe);
void lp_scene_destroy(struct lp_scene *scene);
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h
index 00bf20c..da702ad 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.h
+++ b/src/gallium/drivers/llvmpipe/lp_screen.h
@@ -49,21 +49,21 @@ struct llvmpipe_screen
struct sw_winsys *winsys;
unsigned num_threads;
/* Increments whenever textures are modified. Contexts can track this.
*/
unsigned timestamp;
struct lp_rasterizer *rast;
- pipe_mutex rast_mutex;
+ mtx_t rast_mutex;
};
static inline struct llvmpipe_screen *
llvmpipe_screen( struct pipe_screen *pipe )
{
return (struct llvmpipe_screen *)pipe;
}
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_surface.c b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
index f5fa9d6..01bf14b 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_surface.c
@@ -814,21 +814,21 @@ nv50_clear_buffer(struct pipe_context *pipe,
/* =============================== BLIT CODE ===================================
*/
struct nv50_blitter
{
struct nv50_program *fp[NV50_BLIT_MAX_TEXTURE_TYPES][NV50_BLIT_MODES];
struct nv50_program vp;
struct nv50_tsc_entry sampler[2]; /* nearest, bilinear */
- pipe_mutex mutex;
+ mtx_t mutex;
};
struct nv50_blitctx
{
struct nv50_context *nv50;
struct nv50_program *fp;
uint8_t mode;
uint16_t color_mask;
uint8_t filter;
uint8_t render_condition_enable;
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index d567d82..96b2b5f 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -765,21 +765,21 @@ nvc0_clear(struct pipe_context *pipe, unsigned buffers,
/* =============================== BLIT CODE ===================================
*/
struct nvc0_blitter
{
struct nvc0_program *fp[NV50_BLIT_MAX_TEXTURE_TYPES][NV50_BLIT_MODES];
struct nvc0_program vp;
struct nv50_tsc_entry sampler[2]; /* nearest, bilinear */
- pipe_mutex mutex;
+ mtx_t mutex;
struct nvc0_screen *screen;
};
struct nvc0_blitctx
{
struct nvc0_context *nvc0;
struct nvc0_program *fp;
uint8_t mode;
uint16_t color_mask;
diff --git a/src/gallium/drivers/r300/r300_screen.h b/src/gallium/drivers/r300/r300_screen.h
index 4b783af..952dc34 100644
--- a/src/gallium/drivers/r300/r300_screen.h
+++ b/src/gallium/drivers/r300/r300_screen.h
@@ -41,21 +41,21 @@ struct r300_screen {
struct radeon_info info;
struct r300_capabilities caps;
/** Combination of DBG_xxx flags */
unsigned debug;
struct slab_parent_pool pool_transfers;
/* The MSAA texture with CMASK access; */
struct pipe_resource *cmask_resource;
- pipe_mutex cmask_mutex;
+ mtx_t cmask_mutex;
};
/* Convenience cast wrappers. */
static inline struct r300_screen* r300_screen(struct pipe_screen* screen) {
return (struct r300_screen*)screen;
}
static inline struct radeon_winsys *
radeon_winsys(struct pipe_screen *screen) {
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index 55d2d0b..726dbb3 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -374,34 +374,34 @@ struct r600_common_screen {
struct disk_cache *disk_shader_cache;
struct slab_parent_pool pool_transfers;
/* Texture filter settings. */
int force_aniso; /* -1 = disabled */
/* Auxiliary context. Mainly used to initialize resources.
* It must be locked prior to using and flushed before unlocking. */
struct pipe_context *aux_context;
- pipe_mutex aux_context_lock;
+ mtx_t aux_context_lock;
/* This must be in the screen, because UE4 uses one context for
* compilation and another one for rendering.
*/
unsigned num_compilations;
/* Along with ST_DEBUG=precompile, this should show if applications
* are loading shaders on demand. This is a monotonic counter.
*/
unsigned num_shaders_created;
unsigned num_shader_cache_hits;
/* GPU load thread. */
- pipe_mutex gpu_load_mutex;
+ mtx_t gpu_load_mutex;
pipe_thread gpu_load_thread;
union r600_mmio_counters mmio_counters;
volatile unsigned gpu_load_stop_thread; /* bool */
char renderer_string[100];
/* Performance counters. */
struct r600_perfcounters *perfcounters;
/* If pipe_screen wants to recompute and re-emit the framebuffer,
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index ec7cf30..617ec20 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -77,41 +77,41 @@ struct si_screen {
unsigned gs_table_depth;
unsigned tess_offchip_block_dw_size;
bool has_distributed_tess;
bool has_draw_indirect_multi;
bool has_ds_bpermute;
/* Whether shaders are monolithic (1-part) or separate (3-part). */
bool use_monolithic_shaders;
bool record_llvm_ir;
- pipe_mutex shader_parts_mutex;
+ mtx_t shader_parts_mutex;
struct si_shader_part *vs_prologs;
struct si_shader_part *vs_epilogs;
struct si_shader_part *tcs_epilogs;
struct si_shader_part *gs_prologs;
struct si_shader_part *ps_prologs;
struct si_shader_part *ps_epilogs;
/* Shader cache in memory.
*
* Design & limitations:
* - The shader cache is per screen (= per process), never saved to
* disk, and skips redundant shader compilations from TGSI to bytecode.
* - It can only be used with one-variant-per-shader support, in which
* case only the main (typically middle) part of shaders is cached.
* - Only VS, TCS, TES, PS are cached, out of which only the hw VS
* variants of VS and TES are cached, so LS and ES aren't.
* - GS and CS aren't cached, but it's certainly possible to cache
* those as well.
*/
- pipe_mutex shader_cache_mutex;
+ mtx_t shader_cache_mutex;
struct hash_table *shader_cache;
/* Shader compiler queue for multithreaded compilation. */
struct util_queue shader_compiler_queue;
LLVMTargetMachineRef tm[4]; /* used by the queue only */
};
struct si_blend_color {
struct r600_atom atom;
struct pipe_blend_color state;
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index c38e7f5..17ffc5d 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -271,21 +271,21 @@ struct si_compiler_ctx_state {
};
/* A shader selector is a gallium CSO and contains shader variants and
* binaries for one TGSI program. This can be shared by multiple contexts.
*/
struct si_shader_selector {
struct si_screen *screen;
struct util_queue_fence ready;
struct si_compiler_ctx_state compiler_ctx_state;
- pipe_mutex mutex;
+ mtx_t mutex;
struct si_shader *first_variant; /* immutable after the first variant */
struct si_shader *last_variant; /* mutable */
/* The compiled TGSI shader expecting a prolog and/or epilog (not
* uploaded to a buffer).
*/
struct si_shader *main_shader_part;
struct si_shader *main_shader_part_ls; /* as_ls is set in the key */
struct si_shader *main_shader_part_es; /* as_es is set in the key */
diff --git a/src/gallium/drivers/rbug/rbug_context.h b/src/gallium/drivers/rbug/rbug_context.h
index e99f6ed..6f11fa4 100644
--- a/src/gallium/drivers/rbug/rbug_context.h
+++ b/src/gallium/drivers/rbug/rbug_context.h
@@ -35,53 +35,53 @@
struct rbug_context {
struct pipe_context base; /**< base class */
struct pipe_context *pipe;
struct rbug_list list;
/* call locking */
- pipe_mutex call_mutex;
+ mtx_t call_mutex;
/* current state */
struct {
struct rbug_shader *shader[PIPE_SHADER_TYPES];
struct rbug_sampler_view *views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
struct rbug_resource *texs[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
unsigned num_views[PIPE_SHADER_TYPES];
unsigned nr_cbufs;
struct rbug_resource *cbufs[PIPE_MAX_COLOR_BUFS];
struct rbug_resource *zsbuf;
} curr;
/* draw locking */
- pipe_mutex draw_mutex;
+ mtx_t draw_mutex;
pipe_condvar draw_cond;
unsigned draw_num_rules;
int draw_blocker;
int draw_blocked;
struct {
struct rbug_shader *shader[PIPE_SHADER_TYPES];
struct rbug_resource *texture;
struct rbug_resource *surf;
int blocker;
} draw_rule;
/* list of state objects */
- pipe_mutex list_mutex;
+ mtx_t list_mutex;
unsigned num_shaders;
struct rbug_list shaders;
};
static inline struct rbug_context *
rbug_context(struct pipe_context *pipe)
{
return (struct rbug_context *)pipe;
}
diff --git a/src/gallium/drivers/rbug/rbug_screen.h b/src/gallium/drivers/rbug/rbug_screen.h
index fd92374..67e2876 100644
--- a/src/gallium/drivers/rbug/rbug_screen.h
+++ b/src/gallium/drivers/rbug/rbug_screen.h
@@ -42,21 +42,21 @@ struct rbug_list {
struct rbug_screen
{
struct pipe_screen base;
struct pipe_screen *screen;
struct pipe_context *private_context;
/* remote debugger */
struct rbug_rbug *rbug;
- pipe_mutex list_mutex;
+ mtx_t list_mutex;
int num_contexts;
int num_resources;
int num_surfaces;
int num_transfers;
struct rbug_list contexts;
struct rbug_list resources;
struct rbug_list surfaces;
struct rbug_list transfers;
};
diff --git a/src/gallium/drivers/svga/svga_screen.h b/src/gallium/drivers/svga/svga_screen.h
index 6cafeba..68834a6 100644
--- a/src/gallium/drivers/svga/svga_screen.h
+++ b/src/gallium/drivers/svga/svga_screen.h
@@ -59,23 +59,23 @@ struct svga_screen
struct {
boolean force_level_surface_view;
boolean force_surface_view;
boolean no_surface_view;
boolean force_sampler_view;
boolean no_sampler_view;
boolean no_cache_index_buffers;
} debug;
unsigned texture_timestamp;
- pipe_mutex tex_mutex;
+ mtx_t tex_mutex;
- pipe_mutex swc_mutex; /* Used for buffer uploads */
+ mtx_t swc_mutex; /* Used for buffer uploads */
/* which formats to translate depth formats into */
struct {
enum SVGA3dSurfaceFormat z16;
/* note gallium order */
enum SVGA3dSurfaceFormat x8z24;
enum SVGA3dSurfaceFormat s8z24;
} depth;
diff --git a/src/gallium/drivers/svga/svga_screen_cache.h b/src/gallium/drivers/svga/svga_screen_cache.h
index 619603a..2ade102 100644
--- a/src/gallium/drivers/svga/svga_screen_cache.h
+++ b/src/gallium/drivers/svga/svga_screen_cache.h
@@ -98,21 +98,21 @@ struct svga_host_surface_cache_entry
* 3. holding a buffer in an invalidate list
* 4. holding a flushed buffer (not in any validate list) with an active fence
* 5. holding a flushed buffer with an expired fence
*
* An entry progresses from 1 -> 2 -> 3 -> 4 -> 5. When we need an entry to put a
* buffer into we preferentially take from 1, or from the least recently used
* buffer from 4/5.
*/
struct svga_host_surface_cache
{
- pipe_mutex mutex;
+ mtx_t mutex;
/* Unused buffers are put in buckets to speed up lookups */
struct list_head bucket[SVGA_HOST_SURFACE_CACHE_BUCKETS];
/* Entries with unused buffers, ordered from most to least recently used
* (3 and 4) */
struct list_head unused;
/* Entries with buffers still in validate list (2) */
struct list_head validated;
diff --git a/src/gallium/drivers/vc4/vc4_screen.h b/src/gallium/drivers/vc4/vc4_screen.h
index 1f91ad3..54751ff 100644
--- a/src/gallium/drivers/vc4/vc4_screen.h
+++ b/src/gallium/drivers/vc4/vc4_screen.h
@@ -70,28 +70,28 @@ struct vc4_screen {
struct slab_parent_pool transfer_pool;
struct vc4_bo_cache {
/** List of struct vc4_bo freed, by age. */
struct list_head time_list;
/** List of struct vc4_bo freed, per size, by age. */
struct list_head *size_list;
uint32_t size_list_size;
- pipe_mutex lock;
+ mtx_t lock;
uint32_t bo_size;
uint32_t bo_count;
} bo_cache;
struct util_hash_table *bo_handles;
- pipe_mutex bo_handles_mutex;
+ mtx_t bo_handles_mutex;
uint32_t bo_size;
uint32_t bo_count;
bool has_control_flow;
bool has_etc1;
bool has_threaded_fs;
struct vc4_simulator_file *sim_file;
};
diff --git a/src/gallium/state_trackers/dri/dri_screen.h b/src/gallium/state_trackers/dri/dri_screen.h
index dc4692a..7f5fd13 100644
--- a/src/gallium/state_trackers/dri/dri_screen.h
+++ b/src/gallium/state_trackers/dri/dri_screen.h
@@ -82,21 +82,21 @@ struct dri_screen
boolean d_depth_bits_last;
boolean sd_depth_bits_last;
boolean auto_fake_front;
boolean has_reset_status_query;
enum pipe_texture_target target;
/* hooks filled in by dri2 & drisw */
__DRIimage * (*lookup_egl_image)(struct dri_screen *ctx, void *handle);
/* OpenCL interop */
- pipe_mutex opencl_func_mutex;
+ mtx_t opencl_func_mutex;
opencl_dri_event_add_ref_t opencl_dri_event_add_ref;
opencl_dri_event_release_t opencl_dri_event_release;
opencl_dri_event_wait_t opencl_dri_event_wait;
opencl_dri_event_get_fence_t opencl_dri_event_get_fence;
};
/** cast wrapper */
static inline struct dri_screen *
dri_screen(__DRIscreen * sPriv)
{
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.h b/src/gallium/state_trackers/glx/xlib/xm_api.h
index ccf35a5..06bf839 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.h
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.h
@@ -69,21 +69,21 @@ and create a window, you must do the following to use the X/Mesa interface:
struct hud_context;
typedef struct xmesa_display *XMesaDisplay;
typedef struct xmesa_buffer *XMesaBuffer;
typedef struct xmesa_context *XMesaContext;
typedef struct xmesa_visual *XMesaVisual;
struct xmesa_display {
- pipe_mutex mutex;
+ mtx_t mutex;
Display *display;
struct pipe_screen *screen;
struct st_manager *smapi;
struct pipe_context *pipe;
};
/*
diff --git a/src/gallium/state_trackers/hgl/hgl_context.h b/src/gallium/state_trackers/hgl/hgl_context.h
index d2ec7fb..5acb2f0 100644
--- a/src/gallium/state_trackers/hgl/hgl_context.h
+++ b/src/gallium/state_trackers/hgl/hgl_context.h
@@ -67,21 +67,21 @@ struct hgl_context
struct pp_queue_t* postProcess;
unsigned int postProcessEnable[PP_FILTERS];
// Desired viewport size
unsigned width;
unsigned height;
Bitmap* bitmap;
color_space colorSpace;
- pipe_mutex fbMutex;
+ mtx_t fbMutex;
struct hgl_buffer* draw;
struct hgl_buffer* read;
};
// hgl state_tracker api
struct st_api* hgl_create_st_api(void);
// hgl state_tracker framebuffer
diff --git a/src/gallium/state_trackers/nine/nine_queue.c b/src/gallium/state_trackers/nine/nine_queue.c
index b50b57b..4724b6b 100644
--- a/src/gallium/state_trackers/nine/nine_queue.c
+++ b/src/gallium/state_trackers/nine/nine_queue.c
@@ -67,22 +67,22 @@ struct nine_cmdbuf {
};
struct nine_queue_pool {
struct nine_cmdbuf pool[NINE_CMD_BUFS];
unsigned head;
unsigned tail;
unsigned cur_instr;
BOOL worker_wait;
pipe_condvar event_pop;
pipe_condvar event_push;
- pipe_mutex mutex_pop;
- pipe_mutex mutex_push;
+ mtx_t mutex_pop;
+ mtx_t mutex_push;
};
/* Consumer functions: */
void
nine_queue_wait_flush(struct nine_queue_pool* ctx)
{
struct nine_cmdbuf *cmdbuf = &ctx->pool[ctx->tail];
/* wait for cmdbuf full */
pipe_mutex_lock(ctx->mutex_push);
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c
index 90c49cf..231e422 100644
--- a/src/gallium/state_trackers/nine/nine_state.c
+++ b/src/gallium/state_trackers/nine/nine_state.c
@@ -57,27 +57,27 @@
struct csmt_instruction {
int (* func)(struct NineDevice9 *This, struct csmt_instruction *instr);
};
struct csmt_context {
pipe_thread worker;
struct nine_queue_pool* pool;
BOOL terminate;
pipe_condvar event_processed;
- pipe_mutex mutex_processed;
+ mtx_t mutex_processed;
struct NineDevice9 *device;
BOOL processed;
BOOL toPause;
BOOL hasPaused;
- pipe_mutex thread_running;
- pipe_mutex thread_resume;
+ mtx_t thread_running;
+ mtx_t thread_resume;
};
/* Wait for instruction to be processed.
* Caller has to ensure that only one thread waits at time.
*/
static void
nine_csmt_wait_processed(struct csmt_context *ctx)
{
pipe_mutex_lock(ctx->mutex_processed);
while (!p_atomic_read(&ctx->processed)) {
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h
index a744461..a7cedae 100644
--- a/src/gallium/state_trackers/va/va_private.h
+++ b/src/gallium/state_trackers/va/va_private.h
@@ -202,21 +202,21 @@ ProfileToPipe(VAProfile profile)
}
}
typedef struct {
struct vl_screen *vscreen;
struct pipe_context *pipe;
struct handle_table *htab;
struct vl_compositor compositor;
struct vl_compositor_state cstate;
vl_csc_matrix csc;
- pipe_mutex mutex;
+ mtx_t mutex;
} vlVaDriver;
typedef struct {
VAImage *image;
struct u_rect src_rect;
struct u_rect dst_rect;
struct pipe_sampler_view *sampler;
} vlVaSubpicture;
diff --git a/src/gallium/state_trackers/vdpau/vdpau_private.h b/src/gallium/state_trackers/vdpau/vdpau_private.h
index cc20e5d..b36c0c4 100644
--- a/src/gallium/state_trackers/vdpau/vdpau_private.h
+++ b/src/gallium/state_trackers/vdpau/vdpau_private.h
@@ -347,21 +347,21 @@ CheckSurfaceParams(struct pipe_screen *screen,
screen, templ->format, templ->target, templ->nr_samples, templ->bind);
}
typedef struct
{
struct pipe_reference reference;
struct vl_screen *vscreen;
struct pipe_context *context;
struct vl_compositor compositor;
struct pipe_sampler_view *dummy_sv;
- pipe_mutex mutex;
+ mtx_t mutex;
} vlVdpDevice;
typedef struct
{
vlVdpDevice *device;
struct vl_compositor_state cstate;
struct {
bool supported, enabled;
float luma_min, luma_max;
@@ -432,21 +432,21 @@ typedef struct
{
vlVdpDevice *device;
Drawable drawable;
struct vl_compositor_state cstate;
vlVdpOutputSurface *last_surf;
} vlVdpPresentationQueue;
typedef struct
{
vlVdpDevice *device;
- pipe_mutex mutex;
+ mtx_t mutex;
struct pipe_video_codec *decoder;
} vlVdpDecoder;
typedef uint32_t vlHandle;
boolean vlCreateHTAB(void);
void vlDestroyHTAB(void);
vlHandle vlAddDataHTAB(void *data);
void* vlGetDataHTAB(vlHandle handle);
void vlRemoveDataHTAB(vlHandle handle);
diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.h b/src/gallium/targets/haiku-softpipe/GalliumContext.h
index 22076cb..d8d75b9 100644
--- a/src/gallium/targets/haiku-softpipe/GalliumContext.h
+++ b/src/gallium/targets/haiku-softpipe/GalliumContext.h
@@ -43,15 +43,15 @@ public:
private:
status_t CreateScreen();
void Flush();
ulong fOptions;
struct pipe_screen* fScreen;
// Context Management
struct hgl_context* fContext[CONTEXT_MAX];
context_id fCurrentContext;
- pipe_mutex fMutex;
+ mtx_t fMutex;
};
#endif /* GALLIUMCONTEXT_H */
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
index b19d976..a5154ff 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_winsys.h
@@ -45,21 +45,21 @@ struct amdgpu_cs;
#define AMDGPU_SLAB_MAX_SIZE_LOG2 14
struct amdgpu_winsys {
struct radeon_winsys base;
struct pipe_reference reference;
struct pb_cache bo_cache;
struct pb_slabs bo_slabs;
amdgpu_device_handle dev;
- pipe_mutex bo_fence_lock;
+ mtx_t bo_fence_lock;
int num_cs; /* The number of command streams created. */
unsigned num_total_rejected_cs;
uint32_t next_bo_unique_id;
uint64_t allocated_vram;
uint64_t allocated_gtt;
uint64_t mapped_vram;
uint64_t mapped_gtt;
uint64_t buffer_wait_time; /* time spent in buffer_wait in ns */
uint64_t num_gfx_IBs;
@@ -72,21 +72,21 @@ struct amdgpu_winsys {
struct util_queue cs_queue;
struct amdgpu_gpu_info amdinfo;
ADDR_HANDLE addrlib;
uint32_t rev_id;
unsigned family;
bool check_vm;
/* List of all allocated buffers */
- pipe_mutex global_bo_list_lock;
+ mtx_t global_bo_list_lock;
struct list_head global_bo_list;
unsigned num_buffers;
};
static inline struct amdgpu_winsys *
amdgpu_winsys(struct radeon_winsys *base)
{
return (struct amdgpu_winsys*)base;
}
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
index 236e94c..d5fabab 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h
@@ -36,21 +36,21 @@
#include "os/os_thread.h"
#include "pipebuffer/pb_slab.h"
struct radeon_bo {
struct pb_buffer base;
union {
struct {
struct pb_cache_entry cache_entry;
void *ptr;
- pipe_mutex map_mutex;
+ mtx_t map_mutex;
unsigned map_count;
bool use_reusable_pool;
} real;
struct {
struct pb_slab_entry entry;
struct radeon_bo *real;
unsigned num_fences;
unsigned max_fences;
struct radeon_bo **fences;
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index a39a7be..6c6d920 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -50,21 +50,21 @@ static struct util_hash_table *fd_tab = NULL;
pipe_static_mutex(fd_tab_mutex);
/* Enable/disable feature access for one command stream.
* If enable == true, return true on success.
* Otherwise, return false.
*
* We basically do the same thing kernel does, because we have to deal
* with multiple contexts (here command streams) backed by one winsys. */
static bool radeon_set_fd_access(struct radeon_drm_cs *applier,
struct radeon_drm_cs **owner,
- pipe_mutex *mutex,
+ mtx_t *mutex,
unsigned request, const char *request_name,
bool enable)
{
struct drm_radeon_info info;
unsigned value = enable ? 1 : 0;
memset(&info, 0, sizeof(info));
pipe_mutex_lock(*mutex);
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
index 04659e4..362dab2 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
@@ -71,36 +71,36 @@ struct radeon_drm_winsys {
uint32_t va_start;
uint32_t va_unmap_working;
uint32_t accel_working2;
/* List of buffer GEM names. Protected by bo_handles_mutex. */
struct util_hash_table *bo_names;
/* List of buffer handles. Protectded by bo_handles_mutex. */
struct util_hash_table *bo_handles;
/* List of buffer virtual memory ranges. Protectded by bo_handles_mutex. */
struct util_hash_table *bo_vas;
- pipe_mutex bo_handles_mutex;
- pipe_mutex bo_va_mutex;
- pipe_mutex bo_fence_lock;
+ mtx_t bo_handles_mutex;
+ mtx_t bo_va_mutex;
+ mtx_t bo_fence_lock;
uint64_t va_offset;
struct list_head va_holes;
bool check_vm;
struct radeon_surface_manager *surf_man;
uint32_t num_cpus; /* Number of CPUs. */
struct radeon_drm_cs *hyperz_owner;
- pipe_mutex hyperz_owner_mutex;
+ mtx_t hyperz_owner_mutex;
struct radeon_drm_cs *cmask_owner;
- pipe_mutex cmask_owner_mutex;
+ mtx_t cmask_owner_mutex;
/* multithreaded command submission */
struct util_queue cs_queue;
};
static inline struct radeon_drm_winsys *
radeon_drm_winsys(struct radeon_winsys *base)
{
return (struct radeon_drm_winsys*)base;
}
diff --git a/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c b/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
index d049d1d..4c5a121 100644
--- a/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
+++ b/src/gallium/winsys/svga/drm/pb_buffer_simple_fenced.c
@@ -63,21 +63,21 @@
struct fenced_manager
{
struct pb_manager base;
struct pb_manager *provider;
struct pb_fence_ops *ops;
/**
* Following members are mutable and protected by this mutex.
*/
- pipe_mutex mutex;
+ mtx_t mutex;
/**
* Fenced buffer list.
*
* All fenced buffers are placed in this listed, ordered from the oldest
* fence to the newest fence.
*/
struct list_head fenced;
pb_size num_fenced;
diff --git a/src/gallium/winsys/svga/drm/vmw_fence.c b/src/gallium/winsys/svga/drm/vmw_fence.c
index bcf473a..0fbb078 100644
--- a/src/gallium/winsys/svga/drm/vmw_fence.c
+++ b/src/gallium/winsys/svga/drm/vmw_fence.c
@@ -33,21 +33,21 @@
#include "vmw_fence.h"
struct vmw_fence_ops
{
/*
* Immutable members.
*/
struct pb_fence_ops base;
struct vmw_winsys_screen *vws;
- pipe_mutex mutex;
+ mtx_t mutex;
/*
* Protected by mutex;
*/
struct list_head not_signaled;
uint32_t last_signaled;
uint32_t last_emitted;
};
struct vmw_fence
diff --git a/src/gallium/winsys/svga/drm/vmw_surface.h b/src/gallium/winsys/svga/drm/vmw_surface.h
index f8b582d..baeef50 100644
--- a/src/gallium/winsys/svga/drm/vmw_surface.h
+++ b/src/gallium/winsys/svga/drm/vmw_surface.h
@@ -50,21 +50,21 @@ struct vmw_svga_winsys_surface
int32_t validated; /* atomic */
struct pipe_reference refcnt;
struct vmw_winsys_screen *screen;
uint32_t sid;
/* FIXME: make this thread safe */
unsigned next_present_no;
uint32_t present_fences[VMW_MAX_PRESENTS];
- pipe_mutex mutex;
+ mtx_t mutex;
struct svga_winsys_buffer *buf; /* Current backing guest buffer */
uint32_t mapcount; /* Number of mappers */
uint32_t map_mode; /* PIPE_TRANSFER_[READ|WRITE] */
void *data; /* Pointer to data if mapcount != 0*/
boolean shared; /* Shared surface. Never discard */
uint32_t size; /* Size of backing buffer */
boolean rebind; /* Surface needs a rebind after next unmap */
};
diff --git a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.h b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.h
index ffd7658..f677215 100644
--- a/src/gallium/winsys/virgl/drm/virgl_drm_winsys.h
+++ b/src/gallium/winsys/virgl/drm/virgl_drm_winsys.h
@@ -52,25 +52,25 @@ struct virgl_hw_res {
uint32_t flink;
};
struct virgl_drm_winsys
{
struct virgl_winsys base;
int fd;
struct list_head delayed;
int num_delayed;
unsigned usecs;
- pipe_mutex mutex;
+ mtx_t mutex;
struct util_hash_table *bo_handles;
struct util_hash_table *bo_names;
- pipe_mutex bo_handles_mutex;
+ mtx_t bo_handles_mutex;
};
struct virgl_drm_cmd_buf {
struct virgl_cmd_buf base;
uint32_t buf[VIRGL_MAX_CMDBUF_DWORDS];
unsigned nres;
unsigned cres;
struct virgl_hw_res **res_bo;
diff --git a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
index b4faa70..031037b 100644
--- a/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
+++ b/src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
@@ -41,21 +41,21 @@ struct virgl_vtest_winsys {
struct virgl_winsys base;
struct sw_winsys *sws;
/* fd to remote renderer */
int sock_fd;
struct list_head delayed;
int num_delayed;
unsigned usecs;
- pipe_mutex mutex;
+ mtx_t mutex;
};
struct virgl_hw_res {
struct pipe_reference reference;
uint32_t res_handle;
int num_cs_references;
void *ptr;
int size;
--
2.9.3
More information about the mesa-dev
mailing list