Bugzilla – Attachment 105953 Details for
Bug 197858
X server wakes up on any ACPI event
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
p_xorg_acpi.diff
p_xorg_acpi.diff (text/plain), 2.77 KB, created by
Stefan Dirsch
on 2006-11-17 11:26:31 UTC
(
hide
)
Description:
p_xorg_acpi.diff
Filename:
MIME Type:
Creator:
Stefan Dirsch
Created:
2006-11-17 11:26:31 UTC
Size:
2.77 KB
patch
obsolete
>diff -p -u -r hw/xfree86/os-support/linux.orig/lnx_acpi.c hw/xfree86/os-support/linux/lnx_acpi.c >--- hw/xfree86/os-support/linux.orig/lnx_acpi.c 2006-08-07 17:57:13.000000000 +0200 >+++ hw/xfree86/os-support/linux/lnx_acpi.c 2006-08-07 17:57:20.000000000 +0200 >@@ -32,8 +32,10 @@ > #define ACPI_VIDEO_HEAD_INVALID (~0u - 1) > #define ACPI_VIDEO_HEAD_END (~0u) > >+static PMClose doLnxACPIOpen(void); > static void lnxCloseACPI(void); > static pointer ACPIihPtr = NULL; >+static OsTimerPtr acpiTimer = NULL; > PMClose lnxACPIOpen(void); > > /* in milliseconds */ >@@ -52,6 +54,22 @@ lnxACPIReopen(OsTimerPtr timer, CARD32 t > > #define LINE_LENGTH 80 > >+static CARD32 >+lnxACPICheckTimer(OsTimerPtr timer, CARD32 now, pointer arg) >+{ >+#if DEBUG >+ ErrorF("ACPI: trying to reopen\n"); >+#endif >+ if (doLnxACPIOpen()) { >+#if DEBUG >+ ErrorF("ACPI: successfully reopened\n"); >+#endif >+ acpiTimer = NULL; >+ return 0; >+ } >+ return 5000; >+} >+ > static int > lnxACPIGetEventFromOs(int fd, pmEvent *events, int num) > { >@@ -132,16 +150,13 @@ lnxACPIConfirmEventToOs(int fd, pmEvent > } > } > >-PMClose >-lnxACPIOpen(void) >+static PMClose >+doLnxACPIOpen(void) > { > int fd; > struct sockaddr_un addr; > int r = -1; > >-#ifdef DEBUG >- ErrorF("ACPI: OSPMOpen called\n"); >-#endif > if (ACPIihPtr || !xf86Info.pmFlag) > return NULL; > >@@ -169,6 +184,27 @@ lnxACPIOpen(void) > return lnxCloseACPI; > } > >+PMClose >+lnxACPIPoll(void) >+{ >+ TimerSet(NULL, 0, 5000, lnxACPICheckTimer, NULL); >+ return lnxCloseACPI; >+} >+ >+PMClose >+lnxACPIOpen(void) >+{ >+ PMClose ret; >+#ifdef DEBUG >+ ErrorF("ACPI: OSPMOpen called\n"); >+#endif >+ if (!(ret = doLnxACPIOpen())) >+ xf86MsgVerb(X_WARNING,3,"Open ACPI failed (%s) (%s)\n", ACPI_SOCKET, >+ strerror(errno)); >+ >+ return ret; >+} >+ > static void > lnxCloseACPI(void) > { >@@ -182,5 +218,11 @@ lnxCloseACPI(void) > shutdown(fd, 2); > close(fd); > ACPIihPtr = NULL; >+ xf86PMGetEventFromOs = NULL; >+ xf86PMConfirmEventToOs = NULL; >+ if (acpiTimer) { >+ TimerCancel(acpiTimer); >+ acpiTimer = NULL; >+ } > } > } >diff -p -u -r hw/xfree86/os-support/linux.orig/lnx_apm.c hw/xfree86/os-support/linux/lnx_apm.c >--- hw/xfree86/os-support/linux.orig/lnx_apm.c 2006-08-07 17:57:13.000000000 +0200 >+++ hw/xfree86/os-support/linux/lnx_apm.c 2006-08-07 17:58:08.000000000 +0200 >@@ -12,6 +12,7 @@ > > #ifdef HAVE_ACPI > extern PMClose lnxACPIOpen(void); >+extern PMClose lnxACPIPoll(void); > #endif > > #ifdef HAVE_APM >@@ -150,6 +151,14 @@ xf86OSPMOpen(void) > ret = lnxAPMOpen(); > #endif > >+#ifdef HAVE_ACPI >+ /* if we can neither open ACPI nor APM poll for an ACPI service to >+ become available */ >+ >+ if (!ret && !xf86acpiDisableFlag) >+ ret = lnxACPIPoll(); >+#endif >+ > return ret; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 197858
: 105953 |
106208
|
106217
|
115856
|
116761