From 2715a455f7bfbecd7a6977184dc6180a09d06e1f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 21 Feb 2012 14:49:30 +0000 Subject: [PATCH] uxa: Prevent laggy applications by throttling after rendering Before blocking and waiting for further input, we need to make sure that we have not developed too large a queue of outstanding rendering. As we rendering to the front-buffer with no natural throttling and allow X clients to render as fast as they wish, it is entirely possible for a large queue of outstanding rendering to develop. For such an example, watch firefox rendering the fishietank demo and notice the delay that can build up before the tooltips appear. Signed-off-by: Chris Wilson --- src/intel_uxa.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/intel_uxa.c b/src/intel_uxa.c index 0cb8df37..ed4f3753 100644 --- a/src/intel_uxa.c +++ b/src/intel_uxa.c @@ -32,6 +32,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #endif #include +#include #include #include #include @@ -1001,6 +1002,11 @@ static void intel_flush_rendering(intel_screen_private *intel) intel->needs_flush = 0; } +static void intel_throttle(intel_screen_private *intel) +{ + drmCommandNone(intel->drmSubFD, DRM_I915_GEM_THROTTLE); +} + void intel_uxa_block_handler(intel_screen_private *intel) { if (intel->shadow_damage && @@ -1015,6 +1021,7 @@ void intel_uxa_block_handler(intel_screen_private *intel) */ intel_glamor_flush(intel); intel_flush_rendering(intel); + intel_throttle(intel); } static PixmapPtr