From 68d23965fb47411a97202b0b176d7f62c7dd8020 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 21 Apr 2015 09:03:47 +0100 Subject: [PATCH] throttle-first --- src/mesa/drivers/dri/i965/intel_batchbuffer.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index e522e4e..7651a84 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -232,6 +232,13 @@ brw_finish_batch(struct brw_context *brw) static void throttle(struct brw_context *brw) { + /* Do a coarse wait first to boost priority of slow clients */ + if (brw->need_flush_throttle) { + __DRIscreen *psp = brw->intelScreen->driScrnPriv; + drmCommandNone(psp->fd, DRM_I915_GEM_THROTTLE); + brw->need_flush_throttle = false; + } + /* Wait for the swapbuffers before the one we just emitted, so we * don't get too many swaps outstanding for apps that are GPU-heavy * but not CPU-heavy. @@ -256,14 +263,6 @@ throttle(struct brw_context *brw) brw->throttle_batch[1] = brw->throttle_batch[0]; brw->throttle_batch[0] = NULL; brw->need_swap_throttle = false; - /* Throttling here is more precise than the throttle ioctl, so skip it */ - brw->need_flush_throttle = false; - } - - if (brw->need_flush_throttle) { - __DRIscreen *psp = brw->intelScreen->driScrnPriv; - drmCommandNone(psp->fd, DRM_I915_GEM_THROTTLE); - brw->need_flush_throttle = false; } } -- 2.1.4