summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nv40
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-02 14:56:42 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-03-02 15:02:25 +1100
commitb560ed2444383b9634786fe742b8cb6f5cdfc781 (patch)
treeecaec1297027c749bc212870ffca9b6525063e52 /src/gallium/drivers/nv40
parent0a12e4587ccf2c4fa71e93bb00b4582deb99a82c (diff)
nouveau: enable multi-context/single-channel support for nv40
Diffstat (limited to 'src/gallium/drivers/nv40')
-rw-r--r--src/gallium/drivers/nv40/nv40_context.c3
-rw-r--r--src/gallium/drivers/nv40/nv40_context.h1
-rw-r--r--src/gallium/drivers/nv40/nv40_screen.h2
-rw-r--r--src/gallium/drivers/nv40/nv40_state_emit.c10
4 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv40/nv40_context.c b/src/gallium/drivers/nv40/nv40_context.c
index 084829ce28..203c843a01 100644
--- a/src/gallium/drivers/nv40/nv40_context.c
+++ b/src/gallium/drivers/nv40/nv40_context.c
@@ -44,7 +44,7 @@ nv40_destroy(struct pipe_context *pipe)
}
struct pipe_context *
-nv40_create(struct pipe_screen *pscreen)
+nv40_create(struct pipe_screen *pscreen, unsigned pctx_id)
{
struct nv40_screen *screen = nv40_screen(pscreen);
struct pipe_winsys *ws = pscreen->winsys;
@@ -56,6 +56,7 @@ nv40_create(struct pipe_screen *pscreen)
if (!nv40)
return NULL;
nv40->screen = screen;
+ nv40->pctx_id = pctx_id;
nv40->chipset = chipset;
nv40->nvws = nvws;
diff --git a/src/gallium/drivers/nv40/nv40_context.h b/src/gallium/drivers/nv40/nv40_context.h
index 3b669594dc..e118776306 100644
--- a/src/gallium/drivers/nv40/nv40_context.h
+++ b/src/gallium/drivers/nv40/nv40_context.h
@@ -108,6 +108,7 @@ struct nv40_context {
struct nouveau_winsys *nvws;
struct nv40_screen *screen;
+ unsigned pctx_id;
struct draw_context *draw;
diff --git a/src/gallium/drivers/nv40/nv40_screen.h b/src/gallium/drivers/nv40/nv40_screen.h
index 9f9668dbb6..3ea78aadfd 100644
--- a/src/gallium/drivers/nv40/nv40_screen.h
+++ b/src/gallium/drivers/nv40/nv40_screen.h
@@ -9,6 +9,8 @@ struct nv40_screen {
struct nouveau_winsys *nvws;
unsigned chipset;
+ unsigned cur_pctx;
+
/* HW graphics objects */
struct nouveau_grobj *curie;
struct nouveau_notifier *sync;
diff --git a/src/gallium/drivers/nv40/nv40_state_emit.c b/src/gallium/drivers/nv40/nv40_state_emit.c
index 221503617c..a95e2472e2 100644
--- a/src/gallium/drivers/nv40/nv40_state_emit.c
+++ b/src/gallium/drivers/nv40/nv40_state_emit.c
@@ -62,8 +62,18 @@ static void
nv40_state_emit(struct nv40_context *nv40)
{
struct nv40_state *state = &nv40->state;
+ struct nv40_screen *screen = nv40->screen;
unsigned i, samplers;
+ if (nv40->pctx_id != screen->cur_pctx) {
+ for (i = 0; i < NV40_STATE_MAX; i++) {
+ if (screen->state[i] != state->hw[i] && state->hw[i])
+ state->dirty |= (1ULL << i);
+ }
+
+ screen->cur_pctx = nv40->pctx_id;
+ }
+
while (state->dirty) {
unsigned idx = ffsll(state->dirty) - 1;