summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Hopf <mhopf@suse.de>2007-10-19 17:28:15 +0200
committerMatthias Hopf <mhopf@suse.de>2007-10-19 17:28:15 +0200
commit74e84b8d891632141a60e2d29463ab46f622df3f (patch)
tree1a9bd31ffbb128a40977f32ae057d385af530bb1
parent6fdf3ddfef2707755cec0fc9cbce354fd472bb52 (diff)
Only issue XF86_APM_CAPABILITY_CHANGED for video change ACPI events (not e.g. brightness etc.).
-rw-r--r--hw/xfree86/os-support/linux/lnx_acpi.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 9808e37e0..bb975cc5d 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -69,9 +69,11 @@ lnxACPIGetEventFromOs(int fd, pmEvent *events, int num)
TimerSet(NULL, 0, ACPI_REOPEN_DELAY, lnxACPIReopen, NULL);
return 0;
}
+ /* FIXME: this only processes the first read ACPI event & might break
+ * with interrupted reads. */
/* Check that we have a video event */
- if (strstr(ev, "video") == ev) {
+ if (!strncmp(ev, "video", 5)) {
char *video = NULL;
char *GFX = NULL;
char *notify = NULL;
@@ -97,26 +99,19 @@ lnxACPIGetEventFromOs(int fd, pmEvent *events, int num)
ErrorF("data: 0x%lx\n",data_l);
#endif
- /* We currently don't differentiate between any event */
+ /* Differentiate between events */
switch (notify_l) {
case ACPI_VIDEO_NOTIFY_SWITCH:
- break;
- case ACPI_VIDEO_NOTIFY_PROBE:
- break;
case ACPI_VIDEO_NOTIFY_CYCLE:
- break;
case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT:
- break;
case ACPI_VIDEO_NOTIFY_PREV_OUTPUT:
- break;
+ events[0] = XF86_APM_CAPABILITY_CHANGED;
+ return 1;
+ case ACPI_VIDEO_NOTIFY_PROBE:
+ return 0;
default:
- break;
+ return 0;
}
-
- /* Deal with all ACPI events as a capability change */
- events[0] = XF86_APM_CAPABILITY_CHANGED;
-
- return 1;
}
return 0;