Bugzilla – Attachment 68704 Details for
Bug 148384
restarting acpid makes X consume 100% cpu
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
fix
diff.xorg_acpi (text/plain), 3.24 KB, created by
Egbert Eich
on 2006-02-15 19:01:45 UTC
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Egbert Eich
Created:
2006-02-15 19:01:45 UTC
Size:
3.24 KB
patch
obsolete
>--- lnx_apm.c.org 2006-02-15 19:52:46.000000000 +0100 >+++ lnx_apm.c 2006-02-15 19:48:05.000000000 +0100 >@@ -31,6 +31,7 @@ > > static PMClose lnxAPMOpen(void); > extern PMClose lnxACPIOpen(void); >+extern PMClose lnxACPIPoll(void); > static void lnxCloseAPM(void); > static pointer APMihPtr = NULL; > >@@ -139,6 +140,12 @@ > if (!ret) > ret = lnxAPMOpen(); > >+ /* if we can neither open ACPI nor APM poll for an ACPI service to >+ become available */ >+ >+ if (!ret && !xf86acpiDisableFlag) >+ ret = lnxACPIPoll(); >+ > return ret; > } > >--- lnx_acpi.c.org 2006-02-15 19:52:38.000000000 +0100 >+++ lnx_acpi.c 2006-02-15 19:50:47.000000000 +0100 >@@ -11,7 +11,7 @@ > #include <unistd.h> > #include <fcntl.h> > #include <errno.h> >- >+#define DEBUG 1 > #define ACPI_SOCKET "/var/run/acpid.socket" > #define ACPI_EVENTS "/proc/acpi/event" > >@@ -30,12 +30,30 @@ > #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); > > #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) > { >@@ -45,7 +63,11 @@ > memset(ev, 0, LINE_LENGTH); > > n = read( fd, ev, LINE_LENGTH ); >- >+ if (n == 0) { >+ lnxCloseACPI(); >+ TimerSet(NULL, 0, 5000, lnxACPICheckTimer, NULL); >+ return 0; >+ } > /* Check that we have a video event */ > if (strstr(ev, "video") == ev) { > char *video = NULL; >@@ -108,16 +130,13 @@ > } > } > >-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; > >@@ -134,21 +153,39 @@ > fd = -1; > } > } >- >- if (fd == -1) { >- xf86MsgVerb(X_WARNING,3,"Open ACPI failed (%s) (%s)\n", ACPI_SOCKET, >- strerror(errno)); >+ if (fd == -1) > return NULL; >- } > > xf86PMGetEventFromOs = lnxACPIGetEventFromOs; > xf86PMConfirmEventToOs = lnxACPIConfirmEventToOs; > ACPIihPtr = xf86AddInputHandler(fd,xf86HandlePMEvents,NULL); >- xf86MsgVerb(X_INFO,3,"Open ACPI successful (%s)\n", (r != -1) ? ACPI_SOCKET : ACPI_EVENTS); > >+ xf86MsgVerb(X_INFO,3,"Open ACPI successful (%s)\n", ACPI_SOCKET); >+ >+ 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) > { >@@ -162,6 +199,12 @@ > shutdown(fd, 2); > close(fd); > ACPIihPtr = NULL; >+ xf86PMGetEventFromOs = NULL; >+ xf86PMConfirmEventToOs = NULL; >+ if (acpiTimer) { >+ TimerCancel(acpiTimer); >+ acpiTimer = NULL; >+ } > } > } >
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 148384
:
66567
|
66568
| 68704