summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvfx/nvfx_state_emit.c
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-03-14 03:09:02 +0100
committerLuca Barbieri <luca@luca-barbieri.com>2010-04-12 12:13:16 +0200
commitc0341b22cab5444350032a2b6e2320ab36fcba16 (patch)
tree0dbd4c70a3a6c52be03a7df85c816c3b83df1441 /src/gallium/drivers/nvfx/nvfx_state_emit.c
parent188b579e30cb7f8d7eef5cc9eb5913d9d43a3038 (diff)
nvfx: stop using flush_notify
Rather than emitting relocations on flush notifications, emit them in nvfx_state_start.
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_state_emit.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_emit.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_state_emit.c b/src/gallium/drivers/nvfx/nvfx_state_emit.c
index 72537388ea..d67fb5613f 100644
--- a/src/gallium/drivers/nvfx/nvfx_state_emit.c
+++ b/src/gallium/drivers/nvfx/nvfx_state_emit.c
@@ -81,12 +81,24 @@ nvfx_state_emit(struct nvfx_context *nvfx)
}
}
state->dirty = 0;
+
+ /* we need to ensure there is enough space to output relocations in one go */
+ unsigned max_relocs = 0
+ + 16 /* vertex buffers, incl. dma flag */
+ + 2 /* index buffer plus format+dma flag */
+ + 2 * 5 /* 4 cbufs + zsbuf, plus dma objects */
+ + 2 * 16 /* fragment textures plus format+dma flag */
+ + 2 * 4 /* vertex textures plus format+dma flag */
+ + 1 /* fragprog incl dma flag */
+ ;
+ MARK_RING(chan, max_relocs * 2, max_relocs * 2);
+ nvfx_state_relocate(nvfx);
}
void
-nvfx_state_flush_notify(struct nouveau_channel *chan)
+nvfx_state_relocate(struct nvfx_context *nvfx)
{
- struct nvfx_context *nvfx = chan->user_private;
+ struct nouveau_channel *chan = nvfx->screen->base.channel;
struct nvfx_state *state = &nvfx->state;
unsigned i, samplers;