From dc8f2def5461c75fce6d648036a61186fd00d23f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 12 Jun 2013 08:34:48 +0100 Subject: [PATCH] sna: Allow the throttling to be woken by SIGINT Rather than completely starve X from handling input events and raising the spectre of miEQ overflow, stop throttling upon SIGINT. We will have waited a small period of time (~100ms) for the GPU to catch up, and will do so again in the near future. This also preserves the hang detection. Signed-off-by: Chris Wilson --- src/sna/kgem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 0925c33e..47c5c12b 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -757,7 +757,11 @@ static bool test_has_semaphores_enabled(struct kgem *kgem) static bool __kgem_throttle(struct kgem *kgem) { - if (drmIoctl(kgem->fd, DRM_IOCTL_I915_GEM_THROTTLE, NULL) == 0) + /* Let this be woken up by sigtimer so that we don't block here + * 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) return false; return errno == EIO;