aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-21 13:11:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-21 13:11:04 -0400
commitea45ea70b6131fa0b006f5b687b9b1398b24f681 (patch)
tree634e94b991a6a34f9a92d6e1c73ac676737efd19 /include
parent90db76e829479ef2ba1fed8f2552846015469831 (diff)
parentefaa14c7e981bdf8d3c8d39d3ed12bdc60faabb8 (diff)
Merge tag 'acpi-video-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI video support fixes from Rafael Wysocki: "I'm sending a separate pull request for this as it may be somewhat controversial. The breakage addressed here is not really new and the fixes may not satisfy all users of the affected systems, but we've had so much back and forth dance in this area over the last several weeks that I think it's time to actually make some progress. The source of the problem is that about a year ago we started to tell BIOSes that we're compatible with Windows 8, which we really need to do, because some systems shipping with Windows 8 are tested with it and nothing else, so if we tell their BIOSes that we aren't compatible with Windows 8, we expose our users to untested BIOS/AML code paths. However, as it turns out, some Windows 8-specific AML code paths are not tested either, because Windows 8 actually doesn't use the ACPI methods containing them, so if we declare Windows 8 compatibility and attempt to use those ACPI methods, things break. That occurs mostly in the backlight support area where in particular the _BCM and _BQC methods are plain unusable on some systems if the OS declares Windows 8 compatibility. [ The additional twist is that they actually become usable if the OS says it is not compatible with Windows 8, but that may cause problems to show up elsewhere ] Investigation carried out by Matthew Garrett indicates that what Windows 8 does about backlight is to leave backlight control up to individual graphics drivers. At least there's evidence that it does that if the Intel graphics driver is used, so we've decided to follow Windows 8 in that respect and allow i915 to control backlight (Daniel likes that part). The first commit from Aaron Lu makes ACPICA export the variable from which we can infer whether or not the BIOS believes that we are compatible with Windows 8. The second commit from Matthew Garrett prepares the ACPI video driver by making it initialize the ACPI backlight even if it is not going to be used afterward (that is needed for backlight control to work on Thinkpads). The third commit implements the actual workaround making i915 take over backlight control if the firmware thinks it's dealing with Windows 8 and is based on the work of multiple developers, including Matthew Garrett, Chun-Yi Lee, Seth Forshee, and Aaron Lu. The final commit from Aaron Lu makes us follow Windows 8 by informing the firmware through the _DOS method that it should not carry out automatic brightness changes, so that brightness can be controlled by GUI. Hopefully, this approach will allow us to avoid using blacklists of systems that should not declare Windows 8 compatibility just to avoid backlight control problems in the future. - Change from Aaron Lu makes ACPICA export a variable which can be used by driver code to determine whether or not the BIOS believes that we are compatible with Windows 8. - Change from Matthew Garrett makes the ACPI video driver initialize the ACPI backlight even if it is not going to be used afterward (that is needed for backlight control to work on Thinkpads). - Fix from Rafael J Wysocki implements Windows 8 backlight support workaround making i915 take over bakclight control if the firmware thinks it's dealing with Windows 8. Based on the work of multiple developers including Matthew Garrett, Chun-Yi Lee, Seth Forshee, and Aaron Lu. - Fix from Aaron Lu makes the kernel follow Windows 8 by informing the firmware through the _DOS method that it should not carry out automatic brightness changes, so that brightness can be controlled by GUI" * tag 'acpi-video-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / video: no automatic brightness changes by win8-compatible firmware ACPI / video / i915: No ACPI backlight if firmware expects Windows 8 ACPI / video: Always call acpi_video_init_brightness() on init ACPICA: expose OSI version
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpixf.h1
-rw-r--r--include/acpi/actypes.h15
-rw-r--r--include/acpi/video.h11
-rw-r--r--include/linux/acpi.h1
4 files changed, 27 insertions, 1 deletions
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 1b09300810e6..22d497ee6ef9 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -62,6 +62,7 @@ extern u32 acpi_current_gpe_count;
62extern struct acpi_table_fadt acpi_gbl_FADT; 62extern struct acpi_table_fadt acpi_gbl_FADT;
63extern u8 acpi_gbl_system_awake_and_running; 63extern u8 acpi_gbl_system_awake_and_running;
64extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ 64extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */
65extern u8 acpi_gbl_osi_data;
65 66
66/* Runtime configuration of debug print levels */ 67/* Runtime configuration of debug print levels */
67 68
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index a64adcc29ae5..22b03c9286e9 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -1144,4 +1144,19 @@ struct acpi_memory_list {
1144#endif 1144#endif
1145}; 1145};
1146 1146
1147/* Definitions for _OSI support */
1148
1149#define ACPI_OSI_WIN_2000 0x01
1150#define ACPI_OSI_WIN_XP 0x02
1151#define ACPI_OSI_WIN_XP_SP1 0x03
1152#define ACPI_OSI_WINSRV_2003 0x04
1153#define ACPI_OSI_WIN_XP_SP2 0x05
1154#define ACPI_OSI_WINSRV_2003_SP1 0x06
1155#define ACPI_OSI_WIN_VISTA 0x07
1156#define ACPI_OSI_WINSRV_2008 0x08
1157#define ACPI_OSI_WIN_VISTA_SP1 0x09
1158#define ACPI_OSI_WIN_VISTA_SP2 0x0A
1159#define ACPI_OSI_WIN_7 0x0B
1160#define ACPI_OSI_WIN_8 0x0C
1161
1147#endif /* __ACTYPES_H__ */ 1162#endif /* __ACTYPES_H__ */
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)
20extern int acpi_video_register(void); 20extern int __acpi_video_register(bool backlight_quirks);
21static inline int acpi_video_register(void)
22{
23 return __acpi_video_register(false);
24}
25static inline int acpi_video_register_with_quirks(void)
26{
27 return __acpi_video_register(true);
28}
21extern void acpi_video_unregister(void); 29extern void acpi_video_unregister(void);
22extern int acpi_video_get_edid(struct acpi_device *device, int type, 30extern 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
25static inline int acpi_video_register(void) { return 0; } 33static inline int acpi_video_register(void) { return 0; }
34static inline int acpi_video_register_with_quirks(void) { return 0; }
26static inline void acpi_video_unregister(void) { return; } 35static inline void acpi_video_unregister(void) { return; }
27static inline int acpi_video_get_edid(struct acpi_device *device, int type, 36static 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