<div dir="ltr">On Thu, Jul 25, 2013 at 9:00 PM, Rafael J. Wysocki <span dir="ltr"><<a href="mailto:rjw@sisk.pl" target="_blank">rjw@sisk.pl</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Monday, July 22, 2013 09:54:21 PM Rafael J. Wysocki wrote:<br>
> On Monday, July 22, 2013 11:11:54 AM Linus Torvalds wrote:<br>
> > On Mon, Jul 22, 2013 at 6:02 AM, Rafael J. Wysocki <<a href="mailto:rjw@sisk.pl">rjw@sisk.pl</a>> wrote:<br>
> > ><br>
> > > Linus, do you want me to send a pull request reverting 8c5bd7a and efaa14c?<br>
> ><br>
> > Yes, but let's wait a while. Not because I think we'll fix the problem<br>
> > (hey, miracles might happen), but because I think it would be useful<br>
> > to couple the reverts with information about the particular machines<br>
> > that broke (and the people who reported it). So that when we<br>
> > inevitably try again, we can perhaps get some testing effort with<br>
> > those machines/people.<br>
> ><br>
> > It doesn't seem to be a show-stopped for a large number of people, so<br>
> > there's no huge hurry. I'd suggest doing the revert just in time for<br>
> > rc3, but waiting until then to gather info about people who see<br>
> > breakage.<br>
> ><br>
> > Sound like a plan?<br>
><br>
> Yes, it does.<br>
<br>
OK, time to revert I guess.<br>
<br>
James, Kamal, Steven, Jörg, Martin, Kalle, please check if the apppended patch<br>
fixes the backlight for you.<br>
<br>
Aaron, please double check if acpi_video_backlight_quirks() will still work as<br>
needed.<br></blockquote><div><br></div><div>Yes, I think so.</div><div><br></div><div>Thanks,</div><div>Aaron</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Rafael<br>
<br>
<br>
---<br>
From: Rafael J. Wysocki <<a href="mailto:rafael.j.wysocki@intel.com">rafael.j.wysocki@intel.com</a>><br>
Subject: Revert "ACPI / video / i915: No ACPI backlight if firmware expects Windows 8"<br>
<br>
We attempted to address a regression introduced by commit a57f7f9<br>
(ACPICA: Add Windows8/Server2012 string for _OSI method.) after which<br>
ACPI video backlight support doesn't work on a number of systems,<br>
because the relevant AML methods in the ACPI tables in their BIOSes<br>
become useless after the BIOS has been told that the OS is compatible<br>
with Windows 8. That problem is tracked by the bug entry at:<br>
<br>
<a href="https://bugzilla.kernel.org/show_bug.cgi?id=51231" target="_blank">https://bugzilla.kernel.org/show_bug.cgi?id=51231</a><br>
<br>
Commit 8c5bd7a (ACPI / video / i915: No ACPI backlight if firmware<br>
expects Windows 8) introduced for this purpose essentially prevented<br>
the ACPI backlight support from being used if the BIOS had been told<br>
that the OS was compatible with Windows 8 and the i915 driver was<br>
loaded, in which case the backlight would always be handled by i915.<br>
Unfortunately, however, that turned out to cause problems with<br>
backlight to appear on multiple systems with symptoms indicating that<br>
i915 was unable to control the backlight on those systems as<br>
expected.<br>
<br>
For this reason, revert commit 8c5bd7a, but leave the function<br>
acpi_video_backlight_quirks() introduced by it, because another<br>
commit on top of it uses that function.<br>
<br>
References: <a href="https://lkml.org/lkml/2013/7/21/119" target="_blank">https://lkml.org/lkml/2013/7/21/119</a><br>
References: <a href="https://lkml.org/lkml/2013/7/22/261" target="_blank">https://lkml.org/lkml/2013/7/22/261</a><br>
References: <a href="https://lkml.org/lkml/2013/7/23/429" target="_blank">https://lkml.org/lkml/2013/7/23/429</a><br>
References: <a href="https://lkml.org/lkml/2013/7/23/459" target="_blank">https://lkml.org/lkml/2013/7/23/459</a><br>
References: <a href="https://lkml.org/lkml/2013/7/23/81" target="_blank">https://lkml.org/lkml/2013/7/23/81</a><br>
References: <a href="https://lkml.org/lkml/2013/7/24/27
Reported-by" target="_blank">https://lkml.org/lkml/2013/7/24/27<br>
Reported-by</a>: James Hogan <<a href="mailto:james@albanarts.com">james@albanarts.com</a>><br>
Reported-by: Steven Newbury <<a href="mailto:steve@snewbury.org.uk">steve@snewbury.org.uk</a>><br>
Reported-by: Kamal Mostafa <<a href="mailto:kamal@canonical.com">kamal@canonical.com</a>><br>
Reported-by: Martin Steigerwald <<a href="mailto:Martin@lichtvoll.de">Martin@lichtvoll.de</a>><br>
Reported-by: Jörg Otte <<a href="mailto:jrg.otte@gmail.com">jrg.otte@gmail.com</a>><br>
Reported-by: Kalle Valo <<a href="mailto:kvalo@adurom.com">kvalo@adurom.com</a>><br>
Signed-off-by: Rafael J. Wysocki <<a href="mailto:rafael.j.wysocki@intel.com">rafael.j.wysocki@intel.com</a>><br>
---<br>
drivers/acpi/internal.h | 2 -<br>
drivers/acpi/video.c | 67 ++++------------------------------------<br>
drivers/acpi/video_detect.c | 15 --------<br>
drivers/gpu/drm/i915/i915_dma.c | 2 -<br>
include/acpi/video.h | 11 ------<br>
include/linux/acpi.h | 1<br>
6 files changed, 11 insertions(+), 87 deletions(-)<br>
<br>
Index: linux-pm/drivers/acpi/video.c<br>
===================================================================<br>
--- linux-pm.orig/drivers/acpi/video.c<br>
+++ linux-pm/drivers/acpi/video.c<br>
@@ -897,7 +897,7 @@ static void acpi_video_device_find_cap(s<br>
if (acpi_video_init_brightness(device))<br>
return;<br>
<br>
- if (acpi_video_verify_backlight_support()) {<br>
+ if (acpi_video_backlight_support()) {<br>
struct backlight_properties props;<br>
struct pci_dev *pdev;<br>
acpi_handle acpi_parent;<br>
@@ -1344,8 +1344,8 @@ acpi_video_switch_brightness(struct acpi<br>
unsigned long long level_current, level_next;<br>
int result = -EINVAL;<br>
<br>
- /* no warning message if acpi_backlight=vendor or a quirk is used */<br>
- if (!acpi_video_verify_backlight_support())<br>
+ /* no warning message if acpi_backlight=vendor is used */<br>
+ if (!acpi_video_backlight_support())<br>
return 0;<br>
<br>
if (!device->brightness)<br>
@@ -1843,46 +1843,6 @@ static int acpi_video_bus_remove(struct<br>
return 0;<br>
}<br>
<br>
-static acpi_status video_unregister_backlight(acpi_handle handle, u32 lvl,<br>
- void *context, void **rv)<br>
-{<br>
- struct acpi_device *acpi_dev;<br>
- struct acpi_video_bus *video;<br>
- struct acpi_video_device *dev, *next;<br>
-<br>
- if (acpi_bus_get_device(handle, &acpi_dev))<br>
- return AE_OK;<br>
-<br>
- if (acpi_match_device_ids(acpi_dev, video_device_ids))<br>
- return AE_OK;<br>
-<br>
- video = acpi_driver_data(acpi_dev);<br>
- if (!video)<br>
- return AE_OK;<br>
-<br>
- acpi_video_bus_stop_devices(video);<br>
- mutex_lock(&video->device_list_lock);<br>
- list_for_each_entry_safe(dev, next, &video->video_device_list, entry) {<br>
- if (dev->backlight) {<br>
- backlight_device_unregister(dev->backlight);<br>
- dev->backlight = NULL;<br>
- kfree(dev->brightness->levels);<br>
- kfree(dev->brightness);<br>
- }<br>
- if (dev->cooling_dev) {<br>
- sysfs_remove_link(&dev->dev->dev.kobj,<br>
- "thermal_cooling");<br>
- sysfs_remove_link(&dev->cooling_dev->device.kobj,<br>
- "device");<br>
- thermal_cooling_device_unregister(dev->cooling_dev);<br>
- dev->cooling_dev = NULL;<br>
- }<br>
- }<br>
- mutex_unlock(&video->device_list_lock);<br>
- acpi_video_bus_start_devices(video);<br>
- return AE_OK;<br>
-}<br>
-<br>
static int __init is_i740(struct pci_dev *dev)<br>
{<br>
if (dev->device == 0x00D1)<br>
@@ -1914,25 +1874,14 @@ static int __init intel_opregion_present<br>
return opregion;<br>
}<br>
<br>
-int __acpi_video_register(bool backlight_quirks)<br>
+int acpi_video_register(void)<br>
{<br>
- bool no_backlight;<br>
- int result;<br>
-<br>
- no_backlight = backlight_quirks ? acpi_video_backlight_quirks() : false;<br>
-<br>
+ int result = 0;<br>
if (register_count) {<br>
/*<br>
- * If acpi_video_register() has been called already, don't try<br>
- * to register acpi_video_bus, but unregister backlight devices<br>
- * if no backlight support is requested.<br>
+ * if the function of acpi_video_register is already called,<br>
+ * don't register the acpi_vide_bus again and return no error.<br>
*/<br>
- if (no_backlight)<br>
- acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,<br>
- ACPI_UINT32_MAX,<br>
- video_unregister_backlight,<br>
- NULL, NULL, NULL);<br>
-<br>
return 0;<br>
}<br>
<br>
@@ -1948,7 +1897,7 @@ int __acpi_video_register(bool backlight<br>
<br>
return 0;<br>
}<br>
-EXPORT_SYMBOL(__acpi_video_register);<br>
+EXPORT_SYMBOL(acpi_video_register);<br>
<br>
void acpi_video_unregister(void)<br>
{<br>
Index: linux-pm/drivers/gpu/drm/i915/i915_dma.c<br>
===================================================================<br>
--- linux-pm.orig/drivers/gpu/drm/i915/i915_dma.c<br>
+++ linux-pm/drivers/gpu/drm/i915/i915_dma.c<br>
@@ -1648,7 +1648,7 @@ int i915_driver_load(struct drm_device *<br>
if (INTEL_INFO(dev)->num_pipes) {<br>
/* Must be done after probing outputs */<br>
intel_opregion_init(dev);<br>
- acpi_video_register_with_quirks();<br>
+ acpi_video_register();<br>
}<br>
<br>
if (IS_GEN5(dev))<br>
Index: linux-pm/include/acpi/video.h<br>
===================================================================<br>
--- linux-pm.orig/include/acpi/video.h<br>
+++ linux-pm/include/acpi/video.h<br>
@@ -17,21 +17,12 @@ struct acpi_device;<br>
#define ACPI_VIDEO_DISPLAY_LEGACY_TV 0x0200<br>
<br>
#if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE)<br>
-extern int __acpi_video_register(bool backlight_quirks);<br>
-static inline int acpi_video_register(void)<br>
-{<br>
- return __acpi_video_register(false);<br>
-}<br>
-static inline int acpi_video_register_with_quirks(void)<br>
-{<br>
- return __acpi_video_register(true);<br>
-}<br>
+extern int acpi_video_register(void);<br>
extern void acpi_video_unregister(void);<br>
extern int acpi_video_get_edid(struct acpi_device *device, int type,<br>
int device_id, void **edid);<br>
#else<br>
static inline int acpi_video_register(void) { return 0; }<br>
-static inline int acpi_video_register_with_quirks(void) { return 0; }<br>
static inline void acpi_video_unregister(void) { return; }<br>
static inline int acpi_video_get_edid(struct acpi_device *device, int type,<br>
int device_id, void **edid)<br>
Index: linux-pm/drivers/acpi/video_detect.c<br>
===================================================================<br>
--- linux-pm.orig/drivers/acpi/video_detect.c<br>
+++ linux-pm/drivers/acpi/video_detect.c<br>
@@ -235,12 +235,7 @@ static void acpi_video_caps_check(void)<br>
<br>
bool acpi_video_backlight_quirks(void)<br>
{<br>
- if (acpi_gbl_osi_data >= ACPI_OSI_WIN_8) {<br>
- acpi_video_caps_check();<br>
- acpi_video_support |= ACPI_VIDEO_SKIP_BACKLIGHT;<br>
- return true;<br>
- }<br>
- return false;<br>
+ return acpi_gbl_osi_data >= ACPI_OSI_WIN_8;<br>
}<br>
EXPORT_SYMBOL(acpi_video_backlight_quirks);<br>
<br>
@@ -288,14 +283,6 @@ int acpi_video_backlight_support(void)<br>
}<br>
EXPORT_SYMBOL(acpi_video_backlight_support);<br>
<br>
-/* For the ACPI video driver use only. */<br>
-bool acpi_video_verify_backlight_support(void)<br>
-{<br>
- return (acpi_video_support & ACPI_VIDEO_SKIP_BACKLIGHT) ?<br>
- false : acpi_video_backlight_support();<br>
-}<br>
-EXPORT_SYMBOL(acpi_video_verify_backlight_support);<br>
-<br>
/*<br>
* Use acpi_backlight=vendor/video to force that backlight switching<br>
* is processed by vendor specific acpi drivers or video.ko driver.<br>
Index: linux-pm/include/linux/acpi.h<br>
===================================================================<br>
--- linux-pm.orig/include/linux/acpi.h<br>
+++ linux-pm/include/linux/acpi.h<br>
@@ -191,7 +191,6 @@ extern bool wmi_has_guid(const char *gui<br>
#define ACPI_VIDEO_BACKLIGHT_DMI_VIDEO 0x0200<br>
#define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR 0x0400<br>
#define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800<br>
-#define ACPI_VIDEO_SKIP_BACKLIGHT 0x1000<br>
<br>
#if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE)<br>
<br>
Index: linux-pm/drivers/acpi/internal.h<br>
===================================================================<br>
--- linux-pm.orig/drivers/acpi/internal.h<br>
+++ linux-pm/drivers/acpi/internal.h<br>
@@ -169,10 +169,8 @@ int acpi_create_platform_device(struct a<br>
-------------------------------------------------------------------------- */<br>
#if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE)<br>
bool acpi_video_backlight_quirks(void);<br>
-bool acpi_video_verify_backlight_support(void);<br>
#else<br>
static inline bool acpi_video_backlight_quirks(void) { return false; }<br>
-static inline bool acpi_video_verify_backlight_support(void) { return false; }<br>
#endif<br>
<br>
#endif /* _ACPI_INTERNAL_H_ */<br>
<br>
--<br>
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in<br>
the body of a message to <a href="mailto:majordomo@vger.kernel.org">majordomo@vger.kernel.org</a><br>
More majordomo info at <a href="http://vger.kernel.org/majordomo-info.html" target="_blank">http://vger.kernel.org/majordomo-info.html</a><br>
</blockquote></div><br></div></div>