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 <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-02-21 14:49:30 +00:00
parent 26721893cb
commit 2715a455f7
1 changed files with 7 additions and 0 deletions

View File

@ -32,6 +32,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#include <xf86.h>
#include <xf86drm.h>
#include <xaarop.h>
#include <string.h>
#include <errno.h>
@ -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