Bug 155711

Summary: Aorus X5, Backlight hotkeys non-functional
Product: Drivers Reporter: seqrteam
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: NEEDINFO ---    
Severity: normal CC: rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.6.0-1-amd64 Subsystem:
Regression: No Bisected commit-id:
Attachments: Initial ACPI Dump
Contents of /sys/class/backlight/acpi_video0/device
Contents of /sys/class/backlight/acpi_video0/power

Description seqrteam 2016-09-01 05:26:19 UTC
Created attachment 231651 [details]
Initial ACPI Dump

Hi kernel team,

Apologies if I'm posting this under the wrong category.

I'm running Debian 8 (stretch) on an Aorus X5 laptop with kernel 4.6.0-1.  Architecture is amd64.

On my machine, the keys controlling backlight brightness are Fn+F3 and Fn+F4.  On Windows (laptop is a dual boot), brightness control works great.  However, under Linux, the brightness keys are non-functional.  Pressing the key combinations does trigger the little desktop brightness pop-up to show, and the slider appears as if it's adjusting the brightness.  However, the brightness of my backlight does not change.  If I use a tool like xbacklight, I can manually change my screen brightness, so it's not impossible to change brightness; however, the keyboard keys should work as intended.  I don't know if this is an ACPI bug or possibly another issue.

I have attempted to edit GRUB settings in every combination of ways suggested online; in particular, trying various combinations of options for GRUB_CMDLINE_LINUX_DEFAULT in my /etc/default/grub (and then running update-grub and rebooting each time).  Examples of what I've tried include "acpi_osi=Linux", "acpi_backlight=vendor", "acpi_osi=Linux acpi_backlight=vendor", "pcie_aspm=force acpi_osi=", "acpi_osi=", etc.  No luck with any of these solutions; some of them stop the GUI brightness pop-up from appearing, so just seem to make things worse!

I've also tried echo'ing values to /sys/class/backlight/acpi_video0/brightness, but that has no effect.

Here are some command outputs that might be useful:
cat /proc/cmdline:
BOOT_IMAGE=/vmlinuz-4.6.0-1-amd64 root=/dev/mapper/MYMACHINE--vg-root ro initrd=/install/gtk/initrd.gz quiet

lsb_release -a:
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux testing (stretch)
Release:	testing
Codename:	stretch

uname -a:
Linux MYMACHINE 4.6.0-1-amd64 #1 SMP Debian 4.6.4-1 (2016-07-18) x86_64 GNU/Linux

inxi -F:
System:    Host: MYMACHINE Kernel: 4.6.0-1-amd64 x86_64 (64 bit) Desktop: N/A Distro: Debian GNU/Linux stretch/sid
Machine:   System: GIGABYTE (portable) product: X5
           Mobo: GIGABYTE model: X5 Bios: American Megatrends v: FB08 date: 03/17/2016
Battery    BAT1: charge: 44.4 Wh 100.0% condition: 44.4/50.0 Wh (89%)
CPU:       Quad core Intel Core i7-5700HQ (-HT-MCP-) cache: 6144 KB 
           clock speeds: max: 3500 MHz 1: 2700 MHz 2: 2702 MHz 3: 2701 MHz 4: 2700 MHz 5: 2652 MHz 6: 1912 MHz
           7: 2700 MHz 8: 2700 MHz
Graphics:  Card-1: NVIDIA GM204M [GeForce GTX 965M]
           Card-2: NVIDIA GM204M [GeForce GTX 965M]
           Display Server: X.org 1.18.4 driver: nvidia tty size: 158x39 Advanced Data: N/A for root
Audio:     Card-1 2x NVIDIA GM204 High Definition Audio Controller driver: snd_hda_intelsnd_hda_intel
           Card-2 Intel 9 Series Family HD Audio Controller driver: snd_hda_intel
           Sound: Advanced Linux Sound Architecture v: k4.6.0-1-amd64
Network:   Card-1: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller driver: alx
           IF: eth0 state: down mac: 40:8d:5c:18:9b:85
           Card-2: Intel Wireless 7265 driver: iwlwifi
           IF: wlan0 state: up mac: 5c:e0:c5:bf:a8:f6
Drives:    HDD Total Size: 3048.6GB (15.1% used) ID-1: /dev/sda model: HGST_HTS721010A9 size: 1000.2GB
           ID-2: /dev/sdc model: SanDisk_SD8SN8U1 size: 1024.2GB
           ID-3: /dev/sdb model: SanDisk_SD8SN8U1 size: 1024.2GB
Partition: ID-1: / size: 880G used: 392G (47%) fs: ext4 dev: /dev/dm-1
           ID-2: /boot size: 236M used: 108M (49%) fs: ext2 dev: /dev/sda1
           ID-3: swap-1 size: 40.46GB used: 0.00GB (0%) fs: swap dev: /dev/dm-2
Sensors:   System Temperatures: cpu: 60.0C mobo: 27.8C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 320 Uptime: 45 min Memory: 5148.9/32131.6MB Client: Shell (bash) inxi: 2.3.0 

ls /sys/class/backlight/ :
acpi_video0

acpidump > acpidump.txt :
(attached)

Any ideas for what could be going on here?  I should add, I've noticed this issue in at least the last few 4.x releases.  It could be something wrong in my system configuration somewhere, but I've exhausted the things I know to try and would appreciate any expert eyes taking a look at this issue.  Thank you in advance!
Comment 1 Zhang Rui 2016-09-02 02:14:17 UTC
please attach the output of "grep . /sys/class/backlight/*/*"

does the problem still exist if using kernel parameter acpi_backlight=none?
Comment 2 seqrteam 2016-09-02 04:35:13 UTC
Hi, thanks so much for helping with this!

Yes, the problem still exists with acpi_backlight=none (the GUI pop-up does not appear, and the buttons do nothing).

/sys/class/backlight is empty with acpi_backlight=none, but without that parameter, here is the output of grep . /sys/class/backlight/*/*  :

/sys/class/backlight/acpi_video0/actual_brightness:100
/sys/class/backlight/acpi_video0/bl_power:0
/sys/class/backlight/acpi_video0/brightness:100
grep: /sys/class/backlight/acpi_video0/device: Is a directory
/sys/class/backlight/acpi_video0/max_brightness: 100
grep: /sys/class/backlight/acpi_video0/power: Is a directory
grep: /sys/class/backlight/acpi_video0/subsystem: Is a directory
/sys/class/backlight/acpi_video0/type:firmware

Just in case, I also ran the same command for the device and power subfolders.  These yield the contents attached as device.txt and power.txt.  Thanks again for your help!
Comment 3 seqrteam 2016-09-02 04:35:58 UTC
Created attachment 231831 [details]
Contents of /sys/class/backlight/acpi_video0/device
Comment 4 seqrteam 2016-09-02 04:36:16 UTC
Created attachment 231841 [details]
Contents of /sys/class/backlight/acpi_video0/power
Comment 5 Zhang Rui 2016-09-02 07:04:43 UTC
(In reply to seqrteam from comment #0)
> Created attachment 231651 [details]
> Initial ACPI Dump
> 
> Hi kernel team,
> 
> Apologies if I'm posting this under the wrong category.
> 
> I'm running Debian 8 (stretch) on an Aorus X5 laptop with kernel 4.6.0-1. 
> Architecture is amd64.
> 
> On my machine, the keys controlling backlight brightness are Fn+F3 and
> Fn+F4.  On Windows (laptop is a dual boot), brightness control works great.

Have you installed some vendor drivers in windows?
 
> However, under Linux, the brightness keys are non-functional.  Pressing the
> key combinations does trigger the little desktop brightness pop-up to show,
> and the slider appears as if it's adjusting the brightness.

Good news, at least the hotkey events are working. :)

>  However, the
> brightness of my backlight does not change.  If I use a tool like
> xbacklight, I can manually change my screen brightness, so it's not
> impossible to change brightness;

what do you get in /sys/class/backlight/ when the xbacklight tool works?
And when it works, can you change the backlight by poking /sys/class/backlight/*/brightness?


 however, the keyboard keys should work as
> intended.  I don't know if this is an ACPI bug or possibly another issue.
> 
> I have attempted to edit GRUB settings in every combination of ways
> suggested online; in particular, trying various combinations of options for
> GRUB_CMDLINE_LINUX_DEFAULT in my /etc/default/grub (and then running
> update-grub and rebooting each time).  Examples of what I've tried include
> "acpi_osi=Linux", "acpi_backlight=vendor", "acpi_osi=Linux
> acpi_backlight=vendor", "pcie_aspm=force acpi_osi=", "acpi_osi=", etc.  No
> luck with any of these solutions; some of them stop the GUI brightness
> pop-up from appearing, so just seem to make things worse!
> 
> I've also tried echo'ing values to
> /sys/class/backlight/acpi_video0/brightness, but that has no effect.
> 
> Here are some command outputs that might be useful:
> cat /proc/cmdline:
> BOOT_IMAGE=/vmlinuz-4.6.0-1-amd64 root=/dev/mapper/MYMACHINE--vg-root ro
> initrd=/install/gtk/initrd.gz quiet
> 
> lsb_release -a:
> No LSB modules are available.
> Distributor ID:       Debian
> Description:  Debian GNU/Linux testing (stretch)
> Release:      testing
> Codename:     stretch
> 
> uname -a:
> Linux MYMACHINE 4.6.0-1-amd64 #1 SMP Debian 4.6.4-1 (2016-07-18) x86_64
> GNU/Linux
> 
> inxi -F:
> System:    Host: MYMACHINE Kernel: 4.6.0-1-amd64 x86_64 (64 bit) Desktop:
> N/A Distro: Debian GNU/Linux stretch/sid
> Machine:   System: GIGABYTE (portable) product: X5
>            Mobo: GIGABYTE model: X5 Bios: American Megatrends v: FB08 date:
> 03/17/2016
> Battery    BAT1: charge: 44.4 Wh 100.0% condition: 44.4/50.0 Wh (89%)
> CPU:       Quad core Intel Core i7-5700HQ (-HT-MCP-) cache: 6144 KB 
>            clock speeds: max: 3500 MHz 1: 2700 MHz 2: 2702 MHz 3: 2701 MHz
> 4: 2700 MHz 5: 2652 MHz 6: 1912 MHz
>            7: 2700 MHz 8: 2700 MHz
> Graphics:  Card-1: NVIDIA GM204M [GeForce GTX 965M]
>            Card-2: NVIDIA GM204M [GeForce GTX 965M]
>            Display Server: X.org 1.18.4 driver: nvidia tty size: 158x39
> Advanced Data: N/A for root
> Audio:     Card-1 2x NVIDIA GM204 High Definition Audio Controller driver:
> snd_hda_intelsnd_hda_intel
>            Card-2 Intel 9 Series Family HD Audio Controller driver:
> snd_hda_intel
>            Sound: Advanced Linux Sound Architecture v: k4.6.0-1-amd64
> Network:   Card-1: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller
> driver: alx
>            IF: eth0 state: down mac: 40:8d:5c:18:9b:85
>            Card-2: Intel Wireless 7265 driver: iwlwifi
>            IF: wlan0 state: up mac: 5c:e0:c5:bf:a8:f6
> Drives:    HDD Total Size: 3048.6GB (15.1% used) ID-1: /dev/sda model:
> HGST_HTS721010A9 size: 1000.2GB
>            ID-2: /dev/sdc model: SanDisk_SD8SN8U1 size: 1024.2GB
>            ID-3: /dev/sdb model: SanDisk_SD8SN8U1 size: 1024.2GB
> Partition: ID-1: / size: 880G used: 392G (47%) fs: ext4 dev: /dev/dm-1
>            ID-2: /boot size: 236M used: 108M (49%) fs: ext2 dev: /dev/sda1
>            ID-3: swap-1 size: 40.46GB used: 0.00GB (0%) fs: swap dev:
> /dev/dm-2
> Sensors:   System Temperatures: cpu: 60.0C mobo: 27.8C
>            Fan Speeds (in rpm): cpu: N/A
> Info:      Processes: 320 Uptime: 45 min Memory: 5148.9/32131.6MB Client:
> Shell (bash) inxi: 2.3.0 
> 
> ls /sys/class/backlight/ :
> acpi_video0
> 
> acpidump > acpidump.txt :
> (attached)
> 
> Any ideas for what could be going on here?  I should add, I've noticed this
> issue in at least the last few 4.x releases.  It could be something wrong in
> my system configuration somewhere, but I've exhausted the things I know to
> try and would appreciate any expert eyes taking a look at this issue.  Thank
> you in advance!
Comment 6 seqrteam 2016-09-02 21:47:04 UTC
Although I have of course installed vendor drivers in Windows, I don't think any of the drivers I installed were related to the keyboard keys or display (except for the NVIDIA graphics driver, which I would assume to be unrelated).  I just checked the manufacturer's website again and did not see any drivers for the keyboard keys, screen, etc.

When I use xbacklight (e.g. sudo xbacklight -set 50), nothing seems to change in /sys/class/backlight/ ; /sys/class/backlight/acpi_video0/brightness and /sys/class/backlight/acpi_video0/actual_brightness are both still 100.

Whether before or after I change the brightness with xbacklight, modifying /sys/class/backlight/acpi_video0/brightness has no effect.  Of course, the value in that file changes, but the brightness of my screen doesn't change at all by modifying those files.

Like you said, at least the hotkey events are working :)  Any more things I can try/check to try to get brightness adjustment fully working?
Comment 7 Zhang Rui 2016-09-05 00:35:09 UTC
well, what you mean is that xbacklight tool works, while /sys/class/backlight/ interfaces doesn't work, right?
Comment 8 seqrteam 2016-09-05 01:16:40 UTC
Yes, that's right.

My Fn+F3 and Fn+F4 buttons do change the /sys/class/backlight/ values, but don't actually change my screen brightness, because the /sys/class/backlight/ interface doesn't work.  So the question is why that interface isn't working with my hardware...
Comment 9 Zhang Rui 2016-09-12 02:43:55 UTC
xbacklight has native ways to control backlight IMO, but this interface is not exposed to users via backlight sysfs I/F.
ACPI video backlight control is known to not work for many platforms, and that's why we have /sys/class/backlight/intel_backlight.
For this platform, as the hotkey events works well, it just lacks of a working kernel I/F to change backlight, let's reassign this to nvidia kernel graphics driver.
Comment 10 seqrteam 2016-09-15 04:21:38 UTC
That makes sense.  In case it was something with the nvidia driver, I tried a few different nvidia driver versions (with their associated kernel modules): 352.79. 361.45, and 367.44 (the latest).  (All were installed from the Debian package repositories, not through manual driver installation etc.)  Regardless of which driver I tried, I still encountered the same issue with the backlight hotkeys not working.

Is this issue something that can potentially be fixed, or would nvidia have to publish a new proprietary driver that addressed this issue?  Thanks!
Comment 11 seqrteam 2016-10-11 16:06:28 UTC
Just a gentle bump on this -- any ideas if it's possible to fix this issue, or if one should be looking elsewhere for help with this (e.g. complaining to NVidia)?  Let me know if there is any additional info I can provide.