Bug 71101

Summary: Intel screen backlight control not working
Product: Drivers Reporter: andreanec (jibi.lolwut)
Component: Video(DRI - Intel)Assignee: Jani Nikula (jani.nikula)
Status: RESOLVED CODE_FIX    
Severity: normal CC: alan, daniel, intel-gfx-bugs, patrik.r.jakobsson
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 3.14-rc4 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: kernel 3.13.5-1-ARCH intel_reg_dumper
kernel 3.14.0-rc4-ARCH intel_reg_dumper
dmesg 3.14
intel_reg_dumper without i915 loaded

Description andreanec 2014-02-24 19:38:48 UTC
Starting with kernel 3.14 intel backlight control no longer works.
More specifically sysfs no longer works:

# echo [some value] > /sys/class/backlight/intel_backlight/brightness

does not produce any change in the screen backlight.
Comment 1 Alan 2014-02-24 22:30:58 UTC
please provide some actual information on what the machine is and what kernel last worked.
Comment 2 andreanec 2014-02-25 00:26:35 UTC
I'm sorry, I complete forgot to mention: I'm using a macbook pro late 2013 13", with i5-4288U (intel Iris 5100)
Comment 3 Jani Nikula 2014-02-25 09:00:59 UTC
Please enable drm.debug=0xe module parameter and attach dmesg from early boot to when you try to change the backlight.

Did this work in 3.13? If so, please also attach the outputs of intel_reg_dumper (from the intel-gpu-tools package [1]) on both v3.13 and v3.14.

[1] http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/
Comment 4 andreanec 2014-02-25 11:18:41 UTC
Created attachment 127391 [details]
kernel 3.13.5-1-ARCH intel_reg_dumper
Comment 5 andreanec 2014-02-25 11:19:25 UTC
Created attachment 127401 [details]
kernel 3.14.0-rc4-ARCH intel_reg_dumper
Comment 6 andreanec 2014-02-25 11:21:25 UTC
(In reply to Jani Nikula from comment #3)
> Please enable drm.debug=0xe module parameter and attach dmesg from early
> boot to when you try to change the backlight.
> 
> Did this work in 3.13? If so, please also attach the outputs of
> intel_reg_dumper (from the intel-gpu-tools package [1]) on both v3.13 and
> v3.14.
> 
> [1] http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/

I'm currently using 3.13 and backlight control works properly.
Comment 7 Jani Nikula 2014-02-25 11:56:16 UTC
Thanks for the dumps; please also attach the dmesg with drm.debug=0xe running 3.14.
Comment 8 andreanec 2014-02-25 12:47:35 UTC
Created attachment 127411 [details]
dmesg 3.14
Comment 9 Jani Nikula 2014-02-25 13:27:03 UTC
Please try these, separately:

1)
$ intel_reg_write 0xc8254 0x056c056c

2)
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index 350de359123a..cc03c74c6f31 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -1165,7 +1165,7 @@ void intel_panel_init_backlight_funcs(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 
-	if (IS_BROADWELL(dev)) {
+	if (IS_BROADWELL(dev) || IS_HASWELL(dev)) {
 		dev_priv->display.setup_backlight = bdw_setup_backlight;
 		dev_priv->display.enable_backlight = bdw_enable_backlight;
 		dev_priv->display.disable_backlight = pch_disable_backlight;

3) blacklist i915, attach reg dump *before* i915 has touched them.
Comment 10 andreanec 2014-02-25 19:18:22 UTC
I tried 1) and 2) without any results.
Comment 11 andreanec 2014-02-25 19:19:28 UTC
Created attachment 127461 [details]
intel_reg_dumper without i915 loaded
Comment 12 Daniel Vetter 2014-03-03 09:30:53 UTC
Iirc we need a special i2c backlight driver for recent macbook models. Patrik has patches ... But maybe I'm also mistaken, so I'll just add him to this bug.
Comment 13 Daniel Vetter 2014-03-03 09:32:56 UTC
https://lkml.org/lkml/2014/1/20/516 is the relevant link.  See https://github.com/patjak/mba6x_bl for patches.
Comment 14 Patrik Jakobsson 2014-03-03 09:54:09 UTC
Does this model come with both Nvidia and Intel GPU? Could be that just the 15" has dual GPUs. Don't know whether my driver works for the Pro models, I've only tested on the Air. If the LP8550 backlight chip is there it should work. Try it at your own risk. Please report back if you get it working and I can add the correct MODULE_ALIAS for the Pro models.
Comment 15 andreanec 2014-03-04 00:36:54 UTC
No, the 13" model has only Intel graphic.
Comment 16 andreanec 2014-04-02 13:37:05 UTC
The bug seems to be resolved with kernel version 3.14.0 (the Arch Linux package)