xf86-video-intel: src/sna/kgem.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Jun 12 01:45:17 PDT 2013


 src/sna/kgem.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit dc8f2def5461c75fce6d648036a61186fd00d23f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jun 12 08:34:48 2013 +0100

    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 <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 0925c33..47c5c12 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;


More information about the xorg-commit mailing list