diff options
author | Matthew Garrett <mjg@redhat.com> | 2011-07-12 18:30:52 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-07-13 14:19:47 -0400 |
commit | f5a3d0c4086d1854cbda545092c462b84cba20ce (patch) | |
tree | a7ff24f477c618a7680bc617f12366656a0afe23 /drivers/acpi | |
parent | 2bf71160f94270319eb965935045f825ec446e8a (diff) |
i915: Fix opregion notifications
opregion-based platforms will send ACPI video event 0x80 for a range of
notification types for legacy compatibility. This is interpreted as a
display switch event, which may not be appropriate in the circumstances.
When we receive such an event we should make sure that the platform is
genuinely requesting a display switch before passing that event through
to userspace.
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Tested-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/video.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index db39e9e607d8..ada4b4d9bdc8 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -46,7 +46,6 @@ | |||
46 | 46 | ||
47 | #define PREFIX "ACPI: " | 47 | #define PREFIX "ACPI: " |
48 | 48 | ||
49 | #define ACPI_VIDEO_CLASS "video" | ||
50 | #define ACPI_VIDEO_BUS_NAME "Video Bus" | 49 | #define ACPI_VIDEO_BUS_NAME "Video Bus" |
51 | #define ACPI_VIDEO_DEVICE_NAME "Video Device" | 50 | #define ACPI_VIDEO_DEVICE_NAME "Video Device" |
52 | #define ACPI_VIDEO_NOTIFY_SWITCH 0x80 | 51 | #define ACPI_VIDEO_NOTIFY_SWITCH 0x80 |
@@ -1445,7 +1444,8 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event) | |||
1445 | case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch, | 1444 | case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch, |
1446 | * most likely via hotkey. */ | 1445 | * most likely via hotkey. */ |
1447 | acpi_bus_generate_proc_event(device, event, 0); | 1446 | acpi_bus_generate_proc_event(device, event, 0); |
1448 | keycode = KEY_SWITCHVIDEOMODE; | 1447 | if (!acpi_notifier_call_chain(device, event, 0)) |
1448 | keycode = KEY_SWITCHVIDEOMODE; | ||
1449 | break; | 1449 | break; |
1450 | 1450 | ||
1451 | case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video | 1451 | case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video |
@@ -1475,7 +1475,8 @@ static void acpi_video_bus_notify(struct acpi_device *device, u32 event) | |||
1475 | break; | 1475 | break; |
1476 | } | 1476 | } |
1477 | 1477 | ||
1478 | acpi_notifier_call_chain(device, event, 0); | 1478 | if (event != ACPI_VIDEO_NOTIFY_SWITCH) |
1479 | acpi_notifier_call_chain(device, event, 0); | ||
1479 | 1480 | ||
1480 | if (keycode) { | 1481 | if (keycode) { |
1481 | input_report_key(input, keycode, 1); | 1482 | input_report_key(input, keycode, 1); |