summaryrefslogtreecommitdiff
path: root/src/sna/gen5_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-24 00:59:31 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-24 09:46:26 +0100
commit0e1e83ed4952f620e9422e58f955a5aea406e300 (patch)
tree1e0166c895a3e84e6ea678e691fd26774197f069 /src/sna/gen5_render.c
parent5059db0697c5516f1538f7062937664baf7b1c2e (diff)
sna: Allow the batch to be flushed if the GPU is idle upon a context switch
Submit early, submit often in order to keep the GPU busy. As always we trade off CPU overhead versus concurrency. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen5_render.c')
-rw-r--r--src/sna/gen5_render.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 2894c58d..aaf7e495 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -3509,6 +3509,9 @@ static void
gen5_render_context_switch(struct kgem *kgem,
int new_mode)
{
+ if (!kgem->mode)
+ return;
+
/* Ironlake has a limitation that a 3D or Media command can't
* be the first command after a BLT, unless it's
* non-pipelined.
@@ -3522,6 +3525,11 @@ gen5_render_context_switch(struct kgem *kgem,
__FUNCTION__));
sna->render_state.gen5.drawrect_limit = -1;
}
+
+ if (kgem_is_idle(kgem)) {
+ DBG(("%s: GPU idle, flushing\n", __FUNCTION__));
+ _kgem_submit(kgem);
+ }
}
static void