summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv30
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nv30')
-rw-r--r--src/gallium/drivers/nv30/nv30_context.c4
-rw-r--r--src/gallium/drivers/nv30/nv30_context.h5
-rw-r--r--src/gallium/drivers/nv30/nv30_screen.c4
-rw-r--r--src/gallium/drivers/nv30/nv30_screen.h2
-rw-r--r--src/gallium/drivers/nv30/nv30_state_emit.c6
5 files changed, 12 insertions, 9 deletions
diff --git a/src/gallium/drivers/nv30/nv30_context.c b/src/gallium/drivers/nv30/nv30_context.c
index 8a40cea2e5..8bfd7b2c90 100644
--- a/src/gallium/drivers/nv30/nv30_context.c
+++ b/src/gallium/drivers/nv30/nv30_context.c
@@ -43,7 +43,7 @@ nv30_destroy(struct pipe_context *pipe)
}
struct pipe_context *
-nv30_create(struct pipe_screen *pscreen, unsigned pctx_id)
+nv30_create(struct pipe_screen *pscreen, void *priv)
{
struct nv30_screen *screen = nv30_screen(pscreen);
struct pipe_winsys *ws = pscreen->winsys;
@@ -54,12 +54,12 @@ nv30_create(struct pipe_screen *pscreen, unsigned pctx_id)
if (!nv30)
return NULL;
nv30->screen = screen;
- nv30->pctx_id = pctx_id;
nv30->nvws = nvws;
nv30->pipe.winsys = ws;
nv30->pipe.screen = pscreen;
+ nv30->pipe.priv = priv;
nv30->pipe.destroy = nv30_destroy;
nv30->pipe.draw_arrays = nv30_draw_arrays;
nv30->pipe.draw_elements = nv30_draw_elements;
diff --git a/src/gallium/drivers/nv30/nv30_context.h b/src/gallium/drivers/nv30/nv30_context.h
index 7d05338327..b3b26f7f94 100644
--- a/src/gallium/drivers/nv30/nv30_context.h
+++ b/src/gallium/drivers/nv30/nv30_context.h
@@ -111,7 +111,6 @@ struct nv30_context {
struct nouveau_winsys *nvws;
struct nv30_screen *screen;
- unsigned pctx_id;
struct draw_context *draw;
@@ -209,4 +208,8 @@ extern void nv30_draw_elements(struct pipe_context *pipe,
extern void nv30_clear(struct pipe_context *pipe, unsigned buffers,
const float *rgba, double depth, unsigned stencil);
+/* nv30_context.c */
+struct pipe_context *
+nv30_create(struct pipe_screen *pscreen, void *priv);
+
#endif
diff --git a/src/gallium/drivers/nv30/nv30_screen.c b/src/gallium/drivers/nv30/nv30_screen.c
index 62ee2e7697..8f9b26ea56 100644
--- a/src/gallium/drivers/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nv30/nv30_screen.c
@@ -20,9 +20,6 @@ struct nouveau_winsys {
struct pipe_screen *pscreen;
- unsigned nr_pctx;
- struct pipe_context **pctx;
-
struct pipe_surface *front;
};
@@ -212,6 +209,7 @@ nv30_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
pscreen->get_param = nv30_screen_get_param;
pscreen->get_paramf = nv30_screen_get_paramf;
pscreen->is_format_supported = nv30_screen_surface_format_supported;
+ pscreen->context_create = nv30_create;
nv30_screen_init_miptree_functions(pscreen);
nv30_screen_init_transfer_functions(pscreen);
diff --git a/src/gallium/drivers/nv30/nv30_screen.h b/src/gallium/drivers/nv30/nv30_screen.h
index 744a72de91..8591cd31ca 100644
--- a/src/gallium/drivers/nv30/nv30_screen.h
+++ b/src/gallium/drivers/nv30/nv30_screen.h
@@ -10,7 +10,7 @@ struct nv30_screen {
struct nouveau_winsys *nvws;
- unsigned cur_pctx;
+ struct nv30_context *cur_ctx;
/* HW graphics objects */
struct nv04_surface_2d *eng2d;
diff --git a/src/gallium/drivers/nv30/nv30_state_emit.c b/src/gallium/drivers/nv30/nv30_state_emit.c
index ac52d946f0..d9650f63eb 100644
--- a/src/gallium/drivers/nv30/nv30_state_emit.c
+++ b/src/gallium/drivers/nv30/nv30_state_emit.c
@@ -44,13 +44,15 @@ nv30_state_emit(struct nv30_context *nv30)
unsigned i;
uint64_t states;
- if (nv30->pctx_id != screen->cur_pctx) {
+ /* XXX: racy!
+ */
+ if (nv30 != screen->cur_ctx) {
for (i = 0; i < NV30_STATE_MAX; i++) {
if (state->hw[i] && screen->state[i] != state->hw[i])
state->dirty |= (1ULL << i);
}
- screen->cur_pctx = nv30->pctx_id;
+ screen->cur_ctx = nv30;
}
for (i = 0, states = state->dirty; states; i++) {