diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-17 20:08:06 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-17 20:08:06 -0400 |
commit | 8c5bd7adb2ce47e6aa39d17b2375f69b0c0aa255 (patch) | |
tree | 84ed8b6c9fd4e31eca9adbbbf6be9cd506a2fd46 /include | |
parent | c04c697cf1fe8f0962ccd3c2392a9b637a5307aa (diff) |
ACPI / video / i915: No ACPI backlight if firmware expects Windows 8
According to Matthew Garrett, "Windows 8 leaves backlight control up
to individual graphics drivers rather than making ACPI calls itself.
There's plenty of evidence to suggest that the Intel driver for
Windows [8] doesn't use the ACPI interface, including the fact that
it's broken on a bunch of machines when the OS claims to support
Windows 8. The simplest thing to do appears to be to disable the
ACPI backlight interface on these systems".
There's a problem with that approach, however, because simply
avoiding to register the ACPI backlight interface if the firmware
calls _OSI for Windows 8 may not work in the following situations:
(1) The ACPI backlight interface actually works on the given system
and the i915 driver is not loaded (e.g. another graphics driver
is used).
(2) The ACPI backlight interface doesn't work on the given system,
but there is a vendor platform driver that will register its
own, equally broken, backlight interface if not prevented from
doing so by the ACPI subsystem.
Therefore we need to allow the ACPI backlight interface to be
registered until the i915 driver is loaded which then will unregister
it if the firmware has called _OSI for Windows 8 (or will register
the ACPI video driver without backlight support if not already
present).
For this reason, introduce an alternative function for registering
ACPI video, acpi_video_register_with_quirks(), that will check
whether or not the ACPI video driver has already been registered
and whether or not the backlight Windows 8 quirk has to be applied.
If the quirk has to be applied, it will block the ACPI backlight
support and either unregister the backlight interface if the ACPI
video driver has already been registered, or register the ACPI
video driver without the backlight interface otherwise. Make
the i915 driver use acpi_video_register_with_quirks() instead of
acpi_video_register() in i915_driver_load().
This change is based on earlier patches from Matthew Garrett,
Chun-Yi Lee and Seth Forshee and includes a fix from Aaron Lu's.
References: https://bugzilla.kernel.org/show_bug.cgi?id=51231
Tested-by: Aaron Lu <aaron.lu@intel.com>
Tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Tested-by: Yves-Alexis Perez <corsac@debian.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Aaron Lu <aaron.lu@intel.com>
Acked-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/video.h | 11 | ||||
-rw-r--r-- | include/linux/acpi.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/include/acpi/video.h b/include/acpi/video.h index 61109f2609fc..b26dc4fb7ba8 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h | |||
@@ -17,12 +17,21 @@ struct acpi_device; | |||
17 | #define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200 | 17 | #define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200 |
18 | 18 | ||
19 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) | 19 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) |
20 | extern int acpi_video_register(void); | 20 | extern int __acpi_video_register(bool backlight_quirks); |
21 | static inline int acpi_video_register(void) | ||
22 | { | ||
23 | return __acpi_video_register(false); | ||
24 | } | ||
25 | static inline int acpi_video_register_with_quirks(void) | ||
26 | { | ||
27 | return __acpi_video_register(true); | ||
28 | } | ||
21 | extern void acpi_video_unregister(void); | 29 | extern void acpi_video_unregister(void); |
22 | extern int acpi_video_get_edid(struct acpi_device *device, int type, | 30 | extern int acpi_video_get_edid(struct acpi_device *device, int type, |
23 | int device_id, void **edid); | 31 | int device_id, void **edid); |
24 | #else | 32 | #else |
25 | static inline int acpi_video_register(void) { return 0; } | 33 | static inline int acpi_video_register(void) { return 0; } |
34 | static inline int acpi_video_register_with_quirks(void) { return 0; } | ||
26 | static inline void acpi_video_unregister(void) { return; } | 35 | static inline void acpi_video_unregister(void) { return; } |
27 | static inline int acpi_video_get_edid(struct acpi_device *device, int type, | 36 | static inline int acpi_video_get_edid(struct acpi_device *device, int type, |
28 | int device_id, void **edid) | 37 | int device_id, void **edid) |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 353ba256f368..6ad72f92469c 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -191,6 +191,7 @@ extern bool wmi_has_guid(const char *guid); | |||
191 | #define ACPI_VIDEO_BACKLIGHT_DMI_VIDEO 0x0200 | 191 | #define ACPI_VIDEO_BACKLIGHT_DMI_VIDEO 0x0200 |
192 | #define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR 0x0400 | 192 | #define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR 0x0400 |
193 | #define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800 | 193 | #define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800 |
194 | #define ACPI_VIDEO_SKIP_BACKLIGHT 0x1000 | ||
194 | 195 | ||
195 | #if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) | 196 | #if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) |
196 | 197 | ||