xserver: Branch 'master' - 2 commits
Matthias Hopf
mhopf at kemper.freedesktop.org
Fri Oct 19 08:28:58 PDT 2007
hw/xfree86/os-support/linux/lnx_acpi.c | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
New commits:
commit 74e84b8d891632141a60e2d29463ab46f622df3f
Author: Matthias Hopf <mhopf at suse.de>
Date: Fri Oct 19 17:28:15 2007 +0200
Only issue XF86_APM_CAPABILITY_CHANGED for video change ACPI events (not e.g. brightness etc.).
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 9808e37..bb975cc 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;
commit 6fdf3ddfef2707755cec0fc9cbce354fd472bb52
Author: Matthias Hopf <mhopf at suse.de>
Date: Fri Oct 19 17:20:21 2007 +0200
Fix ids of ACPI events according to ACPI spec.
diff --git a/hw/xfree86/os-support/linux/lnx_acpi.c b/hw/xfree86/os-support/linux/lnx_acpi.c
index 024e6ef..9808e37 100644
--- a/hw/xfree86/os-support/linux/lnx_acpi.c
+++ b/hw/xfree86/os-support/linux/lnx_acpi.c
@@ -23,11 +23,11 @@
#define ACPI_VIDEO_NOTIFY_NEXT_OUTPUT 0x83
#define ACPI_VIDEO_NOTIFY_PREV_OUTPUT 0x84
-#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x82
-#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x83
-#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x84
-#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x85
-#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x86
+#define ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS 0x85
+#define ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS 0x86
+#define ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS 0x87
+#define ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS 0x88
+#define ACPI_VIDEO_NOTIFY_DISPLAY_OFF 0x89
#define ACPI_VIDEO_HEAD_INVALID (~0u - 1)
#define ACPI_VIDEO_HEAD_END (~0u)
More information about the xorg-commit
mailing list