summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv30/nv30_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nouveau/nv30/nv30_context.c')
-rw-r--r--src/gallium/drivers/nouveau/nv30/nv30_context.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_context.c b/src/gallium/drivers/nouveau/nv30/nv30_context.c
index 3ed0889..fbc4136 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_context.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_context.c
@@ -201,6 +201,8 @@ nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags)
if (!nv30)
return NULL;
+ pipe_mutex_lock(screen->base.push_mutex);
+
nv30->screen = screen;
nv30->base.screen = &screen->base;
nv30->base.copy_data = nv30_transfer_copy_data;
@@ -226,6 +228,7 @@ nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags)
ret = nouveau_bufctx_new(nv30->base.client, 64, &nv30->bufctx);
if (ret) {
nv30_context_destroy(pipe);
+ pipe_mutex_unlock(screen->base.push_mutex);
return NULL;
}
@@ -259,10 +262,13 @@ nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags)
nv30->blitter = util_blitter_create(pipe);
if (!nv30->blitter) {
nv30_context_destroy(pipe);
+ pipe_mutex_unlock(screen->base.push_mutex);
return NULL;
}
nouveau_context_init_vdec(&nv30->base);
+ pipe_mutex_unlock(screen->base.push_mutex);
+
return pipe;
}