Bug 88941

Summary: asus brightness hotkeys doesn't work
Product: ACPI Reporter: Jaime Pérez (19.jaime.91)
Component: Power-VideoAssignee: Aaron Lu (aaron.lu)
Status: CLOSED DUPLICATE    
Severity: low CC: aaron.lu, lenb, rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.18-rc7 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: lspci -vvnn output
acpidump
backlight folders
max brightness
memory dump
i915 opregion
Work around firmware that provides 8+ video output devices
dmesg output with patch

Description Jaime Pérez 2014-11-26 15:22:47 UTC
With previous kernels the problem was solved using debug 

acpi_osi= acpi_sleep=s3_bios

in GRUB_CMDLINE_LINUX_DEFAULT, but with this version that doesn't work anymore.
Comment 1 Zhang Rui 2014-12-01 07:25:41 UTC
what graphics are you using?
please attach the lspci output.
Comment 2 Jaime Pérez 2014-12-01 13:43:12 UTC
Created attachment 159361 [details]
lspci -vvnn output
Comment 3 Aaron Lu 2014-12-02 01:28:19 UTC
Please attach your acpidump:
# acpidump > acpidump.txt

Please show me:
# ls /sys/class/backlight

And for each directory there, please test if manually set a value to brightness works:
# cd /sys/class/backlight/acpi_videoX
# cat max_brightness
10
# echo 2 > brightness
# echo 5 > brightness
...

# cd /sys/class/backlight/intel_backlight
# cat max_brightness
5000
# echo 1000 > brightness
# echo 2000 > brightness
...
Comment 4 Jaime Pérez 2014-12-02 21:04:19 UTC
Created attachment 159451 [details]
acpidump
Comment 5 Jaime Pérez 2014-12-02 21:04:45 UTC
Created attachment 159461 [details]
backlight folders
Comment 6 Jaime Pérez 2014-12-02 21:05:12 UTC
Created attachment 159471 [details]
max brightness
Comment 7 Jaime Pérez 2014-12-02 21:05:38 UTC
I am able to change it manually and form GUI menu, but not with hotkeys
Comment 8 Aaron Lu 2014-12-03 07:53:26 UTC
Please dump the below memory range:
0xDAB0EE18, size 0x16D
You can get it by:
$ sudo dd if=/dev/mem of=memory.dump bs=1 count=$((0x16D)) skip=$((0xDAB0EE18))

Please also attach: /sys/kernel/debug/dri/0/i915_opregion
Comment 9 Jaime Pérez 2014-12-03 15:05:16 UTC
Created attachment 159541 [details]
memory dump
Comment 10 Jaime Pérez 2014-12-03 15:07:14 UTC
Created attachment 159551 [details]
i915 opregion
Comment 11 Aaron Lu 2014-12-05 02:56:06 UTC
Created attachment 159751 [details]
Work around firmware that provides 8+ video output devices

Looks like a similar bug:
https://lkml.org/lkml/2014/2/11/1032

Please test this work around patch.
Comment 12 Jaime Pérez 2014-12-05 08:59:42 UTC
I have to compile the whole kernel or there is a method to compile only the i915 driver and change it in actual kernel?
Comment 13 Jaime Pérez 2014-12-05 09:39:11 UTC
I have applied the patch with 
patch -p1 < patch.patch

now I go to driver's folder and type make, but says 
make: *** No targets. Stop.

I type
gcc intel_opregion.c

and get
intel_opregion.c:30:24: fatal error: linux/acpi.h: No such file or directory
Comment 14 Jaime Pérez 2014-12-05 13:57:42 UTC
ok, I build intel_opregion.ko then I used sudo modprobe intel_opregion.ko, but nothing happens. With sudo insmod intel_opregion.ko I get "Unknown symbol in module"

Have I made something wrong?
Comment 15 Jaime Pérez 2014-12-06 18:24:51 UTC
Ok, I achieved building the module and installing it. Fix actually works, but with debug options in kernel load. I'm going to test without them.
Comment 16 Jaime Pérez 2014-12-06 18:27:31 UTC
It works without debug options, but minimum brightness is null, so if I press lower brightness key too much, my screen goes black until I press higher brightness key
Comment 17 Aaron Lu 2014-12-08 08:31:15 UTC
Please report back what's the effect of adding "acpi_osi=" to your kernel cmdline option. You do not need to apply any patch with this cmdline option, just use a normal kernel.
Comment 18 Jaime Pérez 2014-12-08 08:46:38 UTC
That fix the problem of the minimum brightness
Comment 19 Aaron Lu 2014-12-08 08:48:30 UTC
What about the other hotkeys? Do those hotkeys always work or they start to work with the newly added cmdline option?
Comment 20 Aaron Lu 2014-12-08 08:50:22 UTC
Oh I just realized you have been using acpi_osi=. So with v3.18-rc7 the hotkey for backlight control stops working, what about the final v3.18? Can you please try that kernel version? I have a patch in the final v3.18 that may affect the result:

commit 35d0565b95547ec12d025dc9b1394f22968d113d
Author: Aaron Lu <aaron.lu@intel.com>
Date:   Mon Dec 1 02:09:18 2014 +0100

    ACPI / video: update condition to check if device is in _DOD list
Comment 21 Jaime Pérez 2014-12-08 09:08:38 UTC
ok, trying. But what i meant was that keys work without debugging options, but the minimum turns off the screen. With acpi_osi= the minimum is fixed. I'll report results in a moment
Comment 22 Jaime Pérez 2014-12-08 09:14:15 UTC
Keys are blocked with 3.18 vanilla
Comment 23 Jaime Pérez 2014-12-08 09:15:55 UTC
If I press the key for disabling touchpad, it doesn't switch off/on the touchpad, but write a p. I suppose this is not normal
Comment 24 Jaime Pérez 2014-12-08 09:17:11 UTC
The problem appears to with 3.18-rc7
Comment 25 Jaime Pérez 2014-12-08 09:21:05 UTC
Created attachment 160011 [details]
dmesg output with patch

I think this output is different from the last one.
Comment 26 Jaime Pérez 2014-12-08 09:23:26 UTC
In 3.18 I dont have any strange output in dmesg, only in 3.18-rc7
Comment 27 Aaron Lu 2014-12-09 03:15:59 UTC
With acpi_osi= in your kernel cmdline, what's the output of:
# ls /sys/class/backlight

Presumably acpi_osi= has been used to make those hotkeys work, since which kernel version that cmdline option stops working? And when it stops working, what's the output of:
# ls /sys/class/backlight

Also, when it doesn't work, please run acpi_listen and then press the backlight hotkey, is there any output?
Comment 28 Jaime Pérez 2014-12-09 16:16:03 UTC
KERNEL VERSION  || WORKS?  || OUTPUT of ls /sys/class/backlight
--------------------------------------------------------------
3.13.0          ||  YES    || intel_backlight acpi_video0
3.14.26         ||  YES    || intel_backlight acpi_video0
3.15.10         ||  YES    || intel_backlight acpi_video0
3.16.7          ||  YES    || intel_backlight acpi_video0
3.17.6          ||  YES    || intel_backlight acpi_video0
--------------------------------------------------------------
3.18.rc7        ||  NO     || intel_backlight
3.18.0          ||  NO     || intel_backlight
Comment 29 Jaime Pérez 2014-12-09 16:19:29 UTC
with 3.18.0 there isn't any output when I use acpi_listen. With 3.17 , there is
Comment 30 Aaron Lu 2014-12-10 02:01:33 UTC

*** This bug has been marked as a duplicate of bug 70241 ***