summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_screen.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-02-19 00:16:44 +0100
committerMarek Olšák <maraeo@gmail.com>2011-02-19 00:17:27 +0100
commit0b436cf511316d4bf90246a39557900b4b566853 (patch)
tree2bb1f9850eef22452ca65b5439e40c2b2ec41ff3 /src/gallium/drivers/r300/r300_screen.c
parente9e5380f22c230ea1276208baa40c3fe6482b296 (diff)
downloadexternal_mesa3d-0b436cf511316d4bf90246a39557900b4b566853.zip
external_mesa3d-0b436cf511316d4bf90246a39557900b4b566853.tar.gz
external_mesa3d-0b436cf511316d4bf90246a39557900b4b566853.tar.bz2
r300g: fix a possible race when counting contexts
Atomics aren't sufficient here.
Diffstat (limited to 'src/gallium/drivers/r300/r300_screen.c')
-rw-r--r--src/gallium/drivers/r300/r300_screen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index ed47315..77a9c6a 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -398,6 +398,7 @@ static void r300_destroy_screen(struct pipe_screen* pscreen)
struct r300_winsys_screen *rws = r300_winsys_screen(pscreen);
util_slab_destroy(&r300screen->pool_buffers);
+ pipe_mutex_destroy(r300screen->num_contexts_mutex);
if (rws)
rws->destroy(rws);
@@ -459,6 +460,8 @@ struct pipe_screen* r300_screen_create(struct r300_winsys_screen *rws)
r300screen->caps.is_r500 &&
rws->get_value(rws, R300_VID_DRM_2_3_0);
+ pipe_mutex_init(r300screen->num_contexts_mutex);
+
util_slab_create(&r300screen->pool_buffers,
sizeof(struct r300_resource), 64,
UTIL_SLAB_SINGLETHREADED);