ACPI / video: no automatic brightness changes by win8-compatible firmware
authorAaron Lu <[email protected]>
Tue, 16 Jul 2013 05:08:05 +0000 (13:08 +0800)
committerRafael J. Wysocki <[email protected]>
Thu, 18 Jul 2013 00:08:16 +0000 (02:08 +0200)
Starting from win8, MS backlight control driver will set bit 2 of the
parameter of control method _DOS, to inform firmware it should not
perform any automatic brightness changes. This mostly affects hotkey
notification deliver - if we do not set this bit, on hotkey press,
firmware may choose to adjust brightness level instead of sending out
notification and doing nothing.

So this patch sets bit 2 when calling _DOS so that GUIs can show the
notification window on hotkey press.  This behavior change is only
necessary for win8 systems.

The MS document on win8 backlight control is here:
http://msdn.microsoft.com/en-US/library/windows/hardware/jj159305

References: https://bugzilla.kernel.org/show_bug.cgi?id=52951
References: https://bugzilla.kernel.org/show_bug.cgi?id=56711
Reported-by: Micael Dias <[email protected]>
Reported-by: Dan Garton <[email protected]>
Reported-by: Bob Ziuchkovski <[email protected]>
Signed-off-by: Aaron Lu <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/acpi/video.c

index e9d4bb60c35c1c98f22bdbf3617a75b09d9767e8..c9fa4621ed25c76bf3f16d64ed664e30572b9f57 100644 (file)
@@ -1539,14 +1539,20 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video)
 
 /* acpi_video interface */
 
+/*
+ * Win8 requires setting bit2 of _DOS to let firmware know it shouldn't
+ * preform any automatic brightness change on receiving a notification.
+ */
 static int acpi_video_bus_start_devices(struct acpi_video_bus *video)
 {
-       return acpi_video_bus_DOS(video, 0, 0);
+       return acpi_video_bus_DOS(video, 0,
+                                 acpi_video_backlight_quirks() ? 1 : 0);
 }
 
 static int acpi_video_bus_stop_devices(struct acpi_video_bus *video)
 {
-       return acpi_video_bus_DOS(video, 0, 1);
+       return acpi_video_bus_DOS(video, 0,
+                                 acpi_video_backlight_quirks() ? 0 : 1);
 }
 
 static void acpi_video_bus_notify(struct acpi_device *device, u32 event)