xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Mon Jul 17 11:57:33 PDT 2006


 hw/xfree86/os-support/linux/lnx_acpi.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

New commits:
diff-tree 881953813c7307f2aac4057b48d233e5f4a574cd (from f029e9a32dcaa95b84e08ec173a0cc78fd92bdbf)
Author: Adam Jackson <ajax at theobromine.nwnk.net>
Date:   Mon Jul 17 13:50:38 2006 -0400

    Fix the Linux ACPI reopen code to use a repeating timer, rather than a
    one-shot sleep-and-reopen attempt.

diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 6712c09..eca76db 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -36,6 +36,20 @@ static void lnxCloseACPI(void);
 static pointer ACPIihPtr = NULL;
 PMClose lnxACPIOpen(void);
 
+/* in milliseconds */
+#define ACPI_REOPEN_DELAY 1000
+
+static CARD32
+lnxACPIReopen(OsTimerPtr timer, CARD32 time, pointer arg)
+{
+    if (lnxACPIOpen()) {
+	TimerFree(timer);
+	return 0;
+    }
+
+    return ACPI_REOPEN_DELAY;
+}
+
 #define LINE_LENGTH 80
 
 static int
@@ -52,8 +66,7 @@ lnxACPIGetEventFromOs(int fd, pmEvent *e
 
     if (n <= 0) {
 	lnxCloseACPI();
-	sleep(1);
-	lnxACPIOpen();
+	TimerSet(NULL, 0, ACPI_REOPEN_DELAY, lnxACPIReopen, NULL);
 	return 0;
     }
     
@@ -171,4 +184,3 @@ lnxCloseACPI(void)
 	ACPIihPtr = NULL;
     }
 }
-



More information about the xorg-commit mailing list