From c0341b22cab5444350032a2b6e2320ab36fcba16 Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Sun, 14 Mar 2010 03:09:02 +0100 Subject: nvfx: stop using flush_notify Rather than emitting relocations on flush notifications, emit them in nvfx_state_start. --- src/gallium/drivers/nvfx/nvfx_context.c | 1 - src/gallium/drivers/nvfx/nvfx_context.h | 2 +- src/gallium/drivers/nvfx/nvfx_state_emit.c | 16 ++++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/drivers/nvfx/nvfx_context.c b/src/gallium/drivers/nvfx/nvfx_context.c index 61f55907e0..31c3e2bc39 100644 --- a/src/gallium/drivers/nvfx/nvfx_context.c +++ b/src/gallium/drivers/nvfx/nvfx_context.c @@ -67,7 +67,6 @@ nvfx_create(struct pipe_screen *pscreen, void *priv) nvfx->pipe.flush = nvfx_flush; screen->base.channel->user_private = nvfx; - screen->base.channel->flush_notify = nvfx_state_flush_notify; nvfx->is_nv4x = screen->is_nv4x; diff --git a/src/gallium/drivers/nvfx/nvfx_context.h b/src/gallium/drivers/nvfx/nvfx_context.h index 9d988b015c..138f480560 100644 --- a/src/gallium/drivers/nvfx/nvfx_context.h +++ b/src/gallium/drivers/nvfx/nvfx_context.h @@ -239,7 +239,7 @@ nv40_fragtex_build(struct nvfx_context *nvfx, int unit); extern void nvfx_init_state_functions(struct nvfx_context *nvfx); /* nvfx_state_emit.c */ -extern void nvfx_state_flush_notify(struct nouveau_channel *chan); +extern void nvfx_state_relocate(struct nvfx_context *nvfx); extern boolean nvfx_state_validate(struct nvfx_context *nvfx); extern boolean nvfx_state_validate_swtnl(struct nvfx_context *nvfx); extern void nvfx_state_emit(struct nvfx_context *nvfx); 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; -- cgit v1.2.3