sna: Throttle before doing a TearFree buffer replacement

If the client is rendering fast, he may be rendering too fast and
starting to build up a backlog.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-06-25 08:18:25 +01:00
parent ea6b0bb8e1
commit 26c4e850b8
1 changed files with 6 additions and 2 deletions

View File

@ -1117,8 +1117,12 @@ static bool wait_for_shadow(struct sna *sna,
damage = sna->mode.shadow_damage;
sna->mode.shadow_damage = NULL;
while (sna->mode.flip_active && sna_mode_has_pending_events(sna))
sna_mode_wakeup(sna);
if (sna->mode.flip_active) {
/* raw cmd to avoid setting wedged in the middle of an op */
drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_THROTTLE, 0);
while (sna->mode.flip_active && sna_mode_has_pending_events(sna))
sna_mode_wakeup(sna);
}
bo = sna->mode.shadow;
if (sna->mode.flip_active) {