Bug 62281

Summary: intel_backlight not working
Product: Drivers Reporter: jrg.otte
Component: Video(DRI - Intel)Assignee: Jani Nikula (jani.nikula)
Status: RESOLVED CODE_FIX    
Severity: normal CC: aaron.lu, intel-gfx-bugs, rjw
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: v3.12-rc3 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg with acpi_backlight=vendor
dmesg without fujitsu-laptop
acpidump
dmesg kernel 3.12.0-rc5-00551-gaabd627 from drm-intel
file /sys/kernel/debug/dri/0/i915_opregion

Description jrg.otte 2013-09-28 16:30:14 UTC
Patchset "Fix Win8 backlight issue" breaks backlight on my
laptop. Sometime backlight is bright, sometimes it's dark and it
can't be modified with the function keys. Writing integer values
into /sys/class/backlight/intel_backlight/brightness also does
not work. So sometimes I am left with an unusable laptop.

Patchset: http://marc.info/?t=138001608800001&r=1&w=2
Video driver: i915
HW: FUJITSU LIFEBOOK AH532/FJNBB1C, BIOS Version 1.09 05/22/2012

I was told the culprit is i915
(-> http://marc.info/?l=dri-devel&m=138024096722789&w=2)
so I file this bug against i915.
Comment 1 Rafael J. Wysocki 2013-09-29 00:14:33 UTC
It follows from what you said on mailing lists that intel_backlight doesn't work on your machine even without the patchset mentioned above.

Is that correct?
Comment 2 Jani Nikula 2013-09-29 16:03:51 UTC
We should debug this with upstream vanilla kernel, without the patches. Please use acpi_backlight=vendor kernel parameter and drm.debug=0xe module parameter. The hotkeys won't work with this, but try changing backlight through the gui and the sysfs file. Please attach dmesg all the way from boot to where you try to change backlight. Thanks.
Comment 3 jrg.otte 2013-09-30 10:27:29 UTC
Created attachment 110001 [details]
dmesg with acpi_backlight=vendor
Comment 4 jrg.otte 2013-09-30 10:31:39 UTC
acpi_backlight=vendor replaces acpi_video0 with fujitsu_laptop.
So now I have fujitsu_laptop and intel_backlight under
/sys/class/nacklight.

Gui works, function keys work.

Writing into intel_backlight/brightness however does not work!
Comment 5 Jani Nikula 2013-09-30 12:18:42 UTC
(In reply to jrg.otte from comment #4)
> acpi_backlight=vendor replaces acpi_video0 with fujitsu_laptop.
> So now I have fujitsu_laptop and intel_backlight under
> /sys/class/nacklight.

Ah, sorry, please also blacklist fujitsu-laptop while testing. Rinse and repeat.
Comment 6 jrg.otte 2013-09-30 15:09:03 UTC
Created attachment 110061 [details]
dmesg without fujitsu-laptop

ok, now neither Gui, nor function keys nor writing to intel_backlight/brightness
work.

Backlight can not be modified now.
Comment 7 Aaron Lu 2013-10-14 01:27:24 UTC
Jani,
Any ideas why intel_backlight doesn't work?

Jörg,
Please also attach acpidump:
# acpidump > acpidump.txt

Thanks!
Comment 8 jrg.otte 2013-10-14 07:55:46 UTC
Created attachment 110901 [details]
acpidump
Comment 9 Jani Nikula 2013-10-23 08:17:04 UTC
The current drm-intel-nightly branch at [1] leaves some more "breadcrumbs" about what it does with the backlight. Please try that, with backlight=vendor and blacklist fujitsu-laptop, and attach dmesg with drm.debug=0xe. Thanks.

[1] http://cgit.freedesktop.org/~danvet/drm-intel/log/?h=drm-intel-nightly
Comment 10 jrg.otte 2013-10-23 11:34:41 UTC
Created attachment 112051 [details]
dmesg kernel 3.12.0-rc5-00551-gaabd627 from drm-intel

No visible change for me. backlight still not working.
Comment 11 Jani Nikula 2013-10-23 12:25:04 UTC
Hmm. Just an idea, do you boot in pure UEFI mode, or CSM/legacy?
Comment 12 jrg.otte 2013-10-24 09:53:12 UTC
I think EFI mode. But I'm not familar with this subject.
Comment 13 Jani Nikula 2013-11-11 12:47:48 UTC
Please try backlight-rework branch of [1] together with Aaron's patches.

[1] git://gitorious.org/jani/drm.git
Comment 14 jrg.otte 2013-11-12 09:14:50 UTC
OK, I started again with acpi_backlight=vendor and blacklist fujitsu-laptop.

No visible change for me. Backlight still not working.
Comment 15 Aaron Lu 2013-11-13 01:00:20 UTC
The acpi asl code shows that the backlight control is done in EC:

Store (0x??, ^^^LPCB.EC0.BRIT)

The fact that ACPI backlight control works seems to suggest that, maybe the PWM control circuit is on EC instead of GPU controller?
Comment 16 Jani Nikula 2014-02-04 18:55:13 UTC
Jörg, the series was merged in 3.13 kernel. What is the status of your backlight with that?
Comment 17 jrg.otte 2014-02-05 08:51:20 UTC
2014-02-04  <bugzilla-daemon@bugzilla.kernel.org>:
> https://bugzilla.kernel.org/show_bug.cgi?id=62281
>
> --- Comment #16 from Jani Nikula <jani.nikula@intel.com> ---
> Jörg, the series was merged in 3.13 kernel. What is the status of your
> backlight with that?
>
> --
> You are receiving this mail because:
> You reported the bug.

No change, intel_backlight not working.
I still use acpi.

Jörg
Comment 18 Jani Nikula 2014-04-10 14:01:30 UTC
New idea, please attach /sys/kernel/debug/dri/0/i915_opregion.
Comment 19 jrg.otte 2014-04-10 15:52:48 UTC
/sys/kernel/debug directory is empty. Do I need any special
configuration options? Which?
Comment 20 Jani Nikula 2014-04-10 16:25:16 UTC
sudo mount -t debugfs debugfs /sys/kernel/debug/
Comment 21 jrg.otte 2014-04-11 07:07:27 UTC
Created attachment 131901 [details]
file /sys/kernel/debug/dri/0/i915_opregion
Comment 22 Jani Nikula 2014-04-11 07:32:25 UTC
Finally progress. The VBT tells us the native PWM backlight should not be used or enabled in the first place. We have patches queued to fix this; please try current drm-intel-nightly branch of http://cgit.freedesktop.org/drm-intel without all the extra acpi/backlight related kernel parameters.
Comment 23 Aaron Lu 2014-04-11 07:37:31 UTC
Nice work Jani, thanks for the VBT patches!
Comment 24 jrg.otte 2014-04-11 10:08:41 UTC
Now I have only acpi_backlight under /sys/class/backlight.

Backlight works now. It's using acpi I presume.
Comment 25 Jani Nikula 2014-04-11 10:18:41 UTC
(In reply to Aaron Lu from comment #23)
> Nice work Jani, thanks for the VBT patches!

Thanks, perhaps this helps in moving forward with defaulting to native backlight when available, without quirks!

(In reply to jrg.otte from comment #24)
> Now I have only acpi_backlight under /sys/class/backlight.
> 
> Backlight works now. It's using acpi I presume.

That's correct. Thanks for the report and testing.

Fixed by these two commits in drm-intel-fixes, which will be queued for 3.15:

commit d76fedf1980022912508e742660cebdc27c7a010
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Wed Apr 9 11:22:06 2014 +0300

    drm/i915: check VBT for supported backlight type

commit 1901dd794a87911d82edab57dc6f87c7fe9c9bfc
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Wed Apr 9 11:31:37 2014 +0300

    drm/i915: do not setup backlight if not available according to VBT