diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-24 00:59:31 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-24 09:46:26 +0100 |
commit | 0e1e83ed4952f620e9422e58f955a5aea406e300 (patch) | |
tree | 1e0166c895a3e84e6ea678e691fd26774197f069 /src/sna/gen5_render.c | |
parent | 5059db0697c5516f1538f7062937664baf7b1c2e (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.c | 8 |
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 |