summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx/nvfx_surface.c
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-09-05 08:27:12 +0200
committerLuca Barbieri <[email protected]>2010-09-05 17:52:26 +0200
commit49b493ddd0bd6718fe02258a070121f5f4aa10d8 (patch)
tree780bd80fa2edad5d803d6a2ac7f543fc1bb579d8 /src/gallium/drivers/nvfx/nvfx_surface.c
parent14d58052354cdd72fadabaeb1ae1be2d45d2a5ca (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.c16
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