From da330a0eef95ae378d8938a77fcfa83bec6eb1e3 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 2 Jan 2015 04:26:05 +0000 Subject: [PATCH] [x86] ACPI / video: Run _BCL before deciding registering backlight (regression in 3.16) (Closes: #762285) svn path=/dists/sid/linux/; revision=22242 --- debian/changelog | 2 + ...bcl-before-deciding-registering-back.patch | 61 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 64 insertions(+) create mode 100644 debian/patches/bugfix/x86/acpi-video-run-_bcl-before-deciding-registering-back.patch diff --git a/debian/changelog b/debian/changelog index 786dc8c03..7b7d35989 100644 --- a/debian/changelog +++ b/debian/changelog @@ -101,6 +101,8 @@ linux (3.16.7-ckt3-1) UNRELEASED; urgency=medium (Closes: #774209) * udeb: Add i2c-designware-{core,platform} to i2c-modules and i2c-hid to input-modules (Closes: #772578) + * [x86] ACPI / video: Run _BCL before deciding registering backlight + (regression in 3.16) (Closes: #762285) [ Ian Campbell ] * [armhf] Enable support for support OMAP5432 uEVM by enabling: diff --git a/debian/patches/bugfix/x86/acpi-video-run-_bcl-before-deciding-registering-back.patch b/debian/patches/bugfix/x86/acpi-video-run-_bcl-before-deciding-registering-back.patch new file mode 100644 index 000000000..9df54f3cb --- /dev/null +++ b/debian/patches/bugfix/x86/acpi-video-run-_bcl-before-deciding-registering-back.patch @@ -0,0 +1,61 @@ +From: Aaron Lu +Date: Tue, 28 Oct 2014 14:35:59 +0800 +Subject: ACPI / video: Run _BCL before deciding registering backlight +Origin: https://git.kernel.org/linus/dce4ec2e452fddb7542b5fc15d0e6b8531f6d5eb + +The ASUS K53SM's ACPI table queries _OSI("Windows 2012") in the video +output device's _BCL and _BCM control method instead of the usual _INI +functions of the _SB or PCI host bridge PCI0 devices. This made our +video module thought this is a pre-Win8 system when deciding if we +should register a backlight interface for it and the end result is that +a non-working acpi_video interface is registered and user is unable to +control backlight from GUI. Solve this problem by evaluating _BCL control +method before doing the decision. + +Note that for some Thinkpad systems, the _BCL is also required to be +evaluated for the hotkey event to be generated no matter if we will +register an ACPI video backlight interface for it or not. Since the +thinkpad_acpi module will do this anyway we didn't add such a thing in +the video module previously. But now with this change here, the +thinkpad_acpi module is no more necessary for those systems regarding +backlight functionality. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=85051 +Reported-and-tested-by: Ralf Jung +Signed-off-by: Aaron Lu +Signed-off-by: Rafael J. Wysocki +--- + drivers/acpi/video.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/drivers/acpi/video.c ++++ b/drivers/acpi/video.c +@@ -1836,6 +1836,19 @@ static void acpi_video_dev_register_back + printk(KERN_ERR PREFIX "Create sysfs link\n"); + } + ++static void acpi_video_run_bcl_for_osi(struct acpi_video_bus *video) ++{ ++ struct acpi_video_device *dev; ++ union acpi_object *levels; ++ ++ mutex_lock(&video->device_list_lock); ++ list_for_each_entry(dev, &video->video_device_list, entry) { ++ if (!acpi_video_device_lcd_query_levels(dev, &levels)) ++ kfree(levels); ++ } ++ mutex_unlock(&video->device_list_lock); ++} ++ + static int acpi_video_bus_register_backlight(struct acpi_video_bus *video) + { + struct acpi_video_device *dev; +@@ -1843,6 +1856,8 @@ static int acpi_video_bus_register_backl + if (video->backlight_registered) + return 0; + ++ acpi_video_run_bcl_for_osi(video); ++ + if (!acpi_video_verify_backlight_support()) + return 0; + diff --git a/debian/patches/series b/debian/patches/series index 266e317f9..9c0296d56 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -483,3 +483,4 @@ debian/perf-fix-abi-change-in-3.16.7-ckt2.patch debian/arm-thread_info-fix-abi-change-in-3.16.7-ckt3.patch debian/pci-fix-abi-change-in-3.16.7-ckt3.patch features/x86/platform-chrome-chromeos_laptop-add-support-for-acer.patch +bugfix/x86/acpi-video-run-_bcl-before-deciding-registering-back.patch