summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv50
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r--src/gallium/drivers/nv50/nv50_context.c4
-rw-r--r--src/gallium/drivers/nv50/nv50_context.h5
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c1
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.h1
-rw-r--r--src/gallium/drivers/nv50/nv50_state_validate.c10
5 files changed, 12 insertions, 9 deletions
diff --git a/src/gallium/drivers/nv50/nv50_context.c b/src/gallium/drivers/nv50/nv50_context.c
index ac1abc1d5c..867bd03e69 100644
--- a/src/gallium/drivers/nv50/nv50_context.c
+++ b/src/gallium/drivers/nv50/nv50_context.c
@@ -95,7 +95,7 @@ nv50_destroy(struct pipe_context *pipe)
struct pipe_context *
-nv50_create(struct pipe_screen *pscreen, unsigned pctx_id)
+nv50_create(struct pipe_screen *pscreen, void *priv)
{
struct pipe_winsys *pipe_winsys = pscreen->winsys;
struct nv50_screen *screen = nv50_screen(pscreen);
@@ -105,10 +105,10 @@ nv50_create(struct pipe_screen *pscreen, unsigned pctx_id)
if (!nv50)
return NULL;
nv50->screen = screen;
- nv50->pctx_id = pctx_id;
nv50->pipe.winsys = pipe_winsys;
nv50->pipe.screen = pscreen;
+ nv50->pipe.priv = priv;
nv50->pipe.destroy = nv50_destroy;
diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h
index 44d8f61342..14cef4c0bf 100644
--- a/src/gallium/drivers/nv50/nv50_context.h
+++ b/src/gallium/drivers/nv50/nv50_context.h
@@ -145,7 +145,6 @@ struct nv50_context {
struct pipe_context pipe;
struct nv50_screen *screen;
- unsigned pctx_id;
struct draw_context *draw;
@@ -250,4 +249,8 @@ nv50_upload_sifc(struct nv50_context *nv50,
void *src, unsigned src_format, int src_pitch,
int x, int y, int w, int h, int cpp);
+/* nv50_context.c */
+struct pipe_context *
+nv50_create(struct pipe_screen *pscreen, void *priv);
+
#endif
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index 48c7b19584..8c4478e483 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -251,6 +251,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
pscreen->get_param = nv50_screen_get_param;
pscreen->get_paramf = nv50_screen_get_paramf;
pscreen->is_format_supported = nv50_screen_is_format_supported;
+ pscreen->context_create = nv50_create;
screen->base.pre_pipebuffer_map_callback = nv50_pre_pipebuffer_map;
nv50_screen_init_miptree_functions(pscreen);
diff --git a/src/gallium/drivers/nv50/nv50_screen.h b/src/gallium/drivers/nv50/nv50_screen.h
index 0d786b0f2e..2687b72127 100644
--- a/src/gallium/drivers/nv50/nv50_screen.h
+++ b/src/gallium/drivers/nv50/nv50_screen.h
@@ -9,7 +9,6 @@ struct nv50_screen {
struct nouveau_winsys *nvws;
- unsigned cur_pctx;
struct nv50_context *cur_ctx;
struct nouveau_grobj *tesla;
diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c
index 956da9b304..ee28fa63c1 100644
--- a/src/gallium/drivers/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nv50/nv50_state_validate.c
@@ -185,10 +185,10 @@ nv50_state_emit(struct nv50_context *nv50)
struct nv50_screen *screen = nv50->screen;
struct nouveau_channel *chan = screen->base.channel;
- /* I don't want to copy headers from the winsys. */
- screen->cur_ctx = nv50;
-
- if (nv50->pctx_id != screen->cur_pctx) {
+ /* XXX: this is racy for multiple contexts active on separate
+ * threads.
+ */
+ if (screen->cur_ctx != nv50) {
if (nv50->state.fb)
nv50->state.dirty |= NV50_NEW_FRAMEBUFFER;
if (nv50->state.blend)
@@ -217,7 +217,7 @@ nv50_state_emit(struct nv50_context *nv50)
nv50->state.dirty |= NV50_NEW_TEXTURE;
if (nv50->state.vtxfmt && nv50->state.vtxbuf)
nv50->state.dirty |= NV50_NEW_ARRAYS;
- screen->cur_pctx = nv50->pctx_id;
+ screen->cur_ctx = nv50;
}
if (nv50->state.dirty & NV50_NEW_FRAMEBUFFER)