diff options
author | Luca Barbieri <[email protected]> | 2010-09-05 08:27:12 +0200 |
---|---|---|
committer | Luca Barbieri <[email protected]> | 2010-09-05 17:52:26 +0200 |
commit | 49b493ddd0bd6718fe02258a070121f5f4aa10d8 (patch) | |
tree | 780bd80fa2edad5d803d6a2ac7f543fc1bb579d8 /src/gallium/drivers/nvfx/nvfx_surface.c | |
parent | 14d58052354cdd72fadabaeb1ae1be2d45d2a5ca (diff) |
nvfx: pause occlusion queries during blitter usage
Thanks for Dave Airlie and Jerome Glisse for their code which made
me realize I need this too.
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_surface.c')
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_surface.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_surface.c b/src/gallium/drivers/nvfx/nvfx_surface.c index aff7ac54b7f..e39f7f15a31 100644 --- a/src/gallium/drivers/nvfx/nvfx_surface.c +++ b/src/gallium/drivers/nvfx/nvfx_surface.c @@ -163,6 +163,14 @@ nvfx_get_blitter(struct pipe_context* pipe, int copy) assert(nvfx->blitters_in_use < Elements(nvfx->blitter)); + if(nvfx->query && !nvfx->blitters_in_use) + { + struct nouveau_channel* chan = nvfx->screen->base.channel; + WAIT_RING(chan, 2); + OUT_RING(chan, RING_3D(NV34TCL_QUERY_ENABLE, 1)); + OUT_RING(chan, 0); + } + struct blitter_context** pblitter = &nvfx->blitter[nvfx->blitters_in_use++]; if(!*pblitter) *pblitter = util_blitter_create(pipe); @@ -195,6 +203,14 @@ nvfx_put_blitter(struct pipe_context* pipe, struct blitter_context* blitter) struct nvfx_context* nvfx = nvfx_context(pipe); --nvfx->blitters_in_use; assert(nvfx->blitters_in_use >= 0); + + if(nvfx->query && !nvfx->blitters_in_use) + { + struct nouveau_channel* chan = nvfx->screen->base.channel; + WAIT_RING(chan, 2); + OUT_RING(chan, RING_3D(NV34TCL_QUERY_ENABLE, 1)); + OUT_RING(chan, 1); + } } static unsigned |