diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-25 13:21:58 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-25 13:23:17 +0100 |
commit | 5ad1661b870b5b189e52383e45a9b8f570b40501 (patch) | |
tree | 726c3935d3e0e76b813fa46ce6a76806c38984fd | |
parent | c3e4518e84300aeb8e12a0af56c2d66a1df9d8d7 (diff) |
sna: Only mark throttle as done after success
References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 7 | ||||
-rw-r--r-- | src/sna/sna_display.c | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 2c394b63..50a7da21 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -967,8 +967,10 @@ static bool __kgem_throttle(struct kgem *kgem) * too much and completely starve X. We will sleep again shortly, * and so catch up or detect the hang. */ - if (ioctl(kgem->fd, DRM_IOCTL_I915_GEM_THROTTLE) == 0) + if (ioctl(kgem->fd, DRM_IOCTL_I915_GEM_THROTTLE) == 0) { + kgem->need_throttle = 0; return false; + } return errno == EIO; } @@ -3398,7 +3400,6 @@ static void find_hang_state(struct kgem *kgem, char *path, int maxlen) void kgem_throttle(struct kgem *kgem) { - kgem->need_throttle = 0; if (kgem->wedged) return; @@ -3414,6 +3415,8 @@ void kgem_throttle(struct kgem *kgem) xf86DrvMsg(kgem_get_screen_index(kgem), X_ERROR, "When reporting this, please include %s and the full dmesg.\n", path); + + kgem->need_throttle = false; } } diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 706a7eb4..799d7d47 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -1120,6 +1120,8 @@ static bool wait_for_shadow(struct sna *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); + sna->kgem.need_throttle = false; + while (sna->mode.flip_active && sna_mode_has_pending_events(sna)) sna_mode_wakeup(sna); } |