Bug 76971

Summary: Can't adjust brightness (Toshiba Tecra A50-A-130)
Product: Drivers Reporter: Blindekinder (rafael.raccuia)
Component: Platform_x86Assignee: drivers_platform_x86 (drivers_platform_x86)
Status: REOPENED ---    
Severity: normal CC: aaron.lu, rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.13.0 Subsystem:
Regression: Yes Bisected commit-id:
Attachments: acpidump
acpidump
dmidecode
Use alternative keymap

Description Blindekinder 2014-05-27 13:04:22 UTC
(from #72551)
Can't adjust brightness with widget or fn+F6-F7.

acpidump fails:
#acpidump
Cannot map /dev/mem
Could not map table at 0x00000000000F0030 length FEDA0000
Could not get ACPI tables, AE_ACCESS

# ls /sys/class/backlight
acpi_video0  intel_backlight  toshiba

This works:
/sys/class/backlight/intel_backlight$ sudo -s
[sudo] password for raphael: 
root@alphonse:/sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-eDP-1/intel_backlight# echo 700 > brightness 
root@alphonse:/sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-eDP-1/intel_backlight# echo 1000 > brightness 

interesting lines of acpi_listen:
video/brightnessup BRTUP 00000086 00000000 K
video/brightnessdown BRTDN 00000087 00000000 K

tried video.use_native_backlight=1 in boot cmdline, and it works: I can set backlight in seven step, but auto settings doesn't (when power supply is out, doesn't diminish etc...)
Comment 1 Aaron Lu 2014-05-28 02:56:42 UTC
Created attachment 137491 [details]
acpidump

Please try this version. Also, please attach your dmi info:
# dmidecode > dmi.txt
Comment 2 Blindekinder 2014-05-28 07:35:37 UTC
Created attachment 137501 [details]
acpidump
Comment 3 Blindekinder 2014-05-28 07:36:10 UTC
Created attachment 137511 [details]
dmidecode
Comment 4 Blindekinder 2014-05-28 07:36:36 UTC
yes, your version works...
Comment 5 Zhang Rui 2014-06-23 13:41:54 UTC
Ping aaron...
Comment 6 Aaron Lu 2014-06-24 01:53:26 UTC
With 3.16, the default will be using intel_backlight, so I think it's already fixed with v3.16-rc1:

commit 751109aad5834375ca9ed0dcfcd85a00cbf872b5
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Thu Jun 5 22:47:35 2014 +0200

    ACPI / video: Change the default for video.use_native_backlight to 1



BlindeKinder,
Can you please test v3.16-rc1 or a later kernel? Thanks.
Comment 7 Blindekinder 2014-06-24 07:38:16 UTC
yes, it works with 3.16. But it doesn't auto adjust when unplugging power supply.
Comment 8 Aaron Lu 2014-06-24 07:47:58 UTC
What GUI are you using?
Comment 9 Blindekinder 2014-06-24 07:51:03 UTC
I use Gnome-shell 3.10.4
Comment 10 Aaron Lu 2014-06-24 08:55:18 UTC
Sounds like a lack of functionality of the GUI?
I just tried MATE 1.6 on Fedora 19, when I unplug the AC adapter, the backlight is smoothly decreased to half of the current level; and when I plug the adapter, the level is restored. Though the cut it to half sounds not very good, but the GUI indeed did something on adapter plug/unplug.
Comment 11 Blindekinder 2014-07-06 17:43:29 UTC
sorry, I reopen, I tried some things around 3.16-rc1 and brightness: impossible adjust brightness after sleep, and it wakes up with ~50%...
Comment 12 Aaron Lu 2014-07-07 01:27:54 UTC
Sounds two problems?
1 impossible adjust brightness after sleep
2 doesn't wake up from suspend to mem
Correct?

For 1, after resume, does the sysfs interface work?
To verify:
# cd /sys/class/intel_backlight
# echo XXX > brightness

For 2, does v3.15 resume OK? If so, it may be a regression. Please test latest Linus' tree, if problem is also there, open a new bug under the PM/Suspend/Hibernation category. Thanks.
Comment 13 Blindekinder 2014-07-17 07:36:57 UTC
I'm not sure I understood point 2: it wakes up, but with ~50% brightness and impossible to adjust.

I tried 3.16 rc 5, can't adjust at all: after boot, after sleep, even with acpi boot options (acpi_csi=Linux acpi_backlight=vendor).
Comment 14 Aaron Lu 2014-07-17 07:47:15 UTC
I misunderstood the ~50%, I thought the system doesn't wake up about ~50% of the time while you obviously mean the backlight level is ~50% after wake up.

So after wakeup, does the intel_backlight interface still work?
Comment 15 Aaron Lu 2014-07-22 07:01:06 UTC
ping
Comment 16 Blindekinder 2014-08-12 15:00:50 UTC
Sorry for the delay, I was out...
I tried 3.16 final, same as comment 13.

It works with intel_backlight, but now schortcuts (fn) doesn't (just like #72551):

^[[18;2~battery PNP0C0A:00 00000080 00000001
^[[18;2~^[[18;2~battery PNP0C0A:00 00000080 00000001
^[[18;2~battery PNP0C0A:00 00000080 00000001
battery PNP0C0A:00 00000080 00000001
^[[17;2~battery PNP0C0A:00 00000080 00000001
^[[17;2~^[[17;2~battery PNP0C0A:00 00000080 00000001
^[[17;2~^[[17;2~^[[17;2~battery PNP0C0A:00 00000080 00000001
^[[17;2~^[[17;2~^[[17;2~^[[17;2~battery PNP0C0A:00 00000080 00000001
^[[17;2~^[[17;2~^[[17;2~battery PNP0C0A:00 00000080 00000001
Comment 17 Aaron Lu 2014-08-13 02:01:34 UTC
Did your hotkey(fn) ever work before?
Comment 18 Aaron Lu 2014-08-13 02:03:12 UTC
Created attachment 146401 [details]
Use alternative keymap

Please test this patch, see if the hotkey works now. Apply on top of v3.16.
Comment 19 Blindekinder 2014-09-15 08:57:15 UTC
Sorry, I can't find info on how to apply this patch, not very familiar with kernel compilation... any suggestion?
Comment 20 Aaron Lu 2014-09-15 09:01:31 UTC
Usually, it is like this:
$ git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ git apply the_provided_patch
build kernel and test.

If it doesn't apply cleanly, set tree to v3.16 first:
$ git reset --hard v3.16
$ git apply the_provided_patch
Comment 21 Blindekinder 2014-09-15 09:30:09 UTC
ok i'll try but i cant download the patch... the link goes to code browser
Comment 22 Aaron Lu 2014-09-16 02:08:54 UTC
Right click and then choose save.
Comment 23 Aaron Lu 2014-10-10 07:23:52 UTC
any update?
Comment 24 Blindekinder 2014-10-10 12:10:05 UTC
I get an attachment.cgi file, but says: 'fatal: input [or entry?] not recognized' on apply... (my translation)
Comment 26 Blindekinder 2014-10-20 20:48:12 UTC
ok I finally succeeded.
yes, now it works, without any boot args, and also after wake up. Need more infos?
Comment 27 Aaron Lu 2014-10-21 01:55:48 UTC
No need, I'll submit that patch and cc you.
Comment 28 Aaron Lu 2014-10-24 08:20:02 UTC
Patch sent:

http://www.spinics.net/lists/platform-driver-x86/msg05763.html
Comment 29 Aaron Lu 2015-01-06 07:35:44 UTC
commit b1bde689dde0d5de9e974390f9a0859a7ec5fd1b
Author: Aaron Lu <aaron.lu@intel.com>
Date:   Thu Oct 23 16:18:02 2014 +0800

    toshiba_acpi: Add Toshiba TECRA A50-A to the alt keymap dmi list
Comment 30 Blindekinder 2016-10-19 20:54:08 UTC
Again on 4.4.04...
Still on 14.04.