//// THE SETUP /////////////// On the MacbookPro12,1 (early 2015 Retina display version) with the graphics adapter: 00:02.0 0300: 8086:162b (rev 09) (prog-if 00 [VGA controller]) Subsystem: 106b:013f 00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09) (prog-if 00 [VGA controller]) Subsystem: Apple Inc. Device 013f Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 0 Interrupt: pin A routed to IRQ 57 Region 0: Memory at c0000000 (64-bit, non-prefetchable) [size=16M] Region 2: Memory at b0000000 (64-bit, prefetchable) [size=256M] Region 4: I/O ports at 3000 [size=64] Expansion ROM at <unassigned> [disabled] Capabilities: <access denied> Kernel driver in use: i915 //// THE PROBLEM /////////////// If the kernel 4.0.4 is booted without any relevant kernel cmdline paramters: There are: /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0 and /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight The latter (intel_backlight) works and controls the brightness of the laptops internal screen using a brightness scale from 0 to 1388 (adjustable in steps of 1 ;). But the former (acpi_video0), which is used by the X brightness keys, has no effect: It has a scale from 0-100 and changing it's values (trough echo under /sys/ or using the XF86 brightness up/down keys, has no visible effect. Using acpi_backlight=vendor fixes the problem in that it removes: /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0 and leaves only: /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight to be found and used by X. Please let me know if you need more information, debug, logfiles, etc. Tormen.
CC Aaron, Hans
This should be fixed by this commit which is queued up for merging into 4.2 : https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=7f5c1882add891f7420a327e908f206fafed3670
Super. Thanks for the quick feedback ! I'll try the patch and report back ! Tormen
Hi. Compiling the kernel, it complained about missing function "video_enable_native_backlight". As all the other exceptions used "video_disable_native_backlight", I gave this a shot. But this does not fix the problem: Using the new kernel while removing the kernel cmdline parameter "acpi_backlight=vendor", brings back: /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness Was this function maybe added in a more recent kernel version than 4.0.4 ? Not sure if important, but dmidecode shows 2 "Product Names": Handle 0x0006, DMI type 1, 27 bytes System Information Manufacturer: Apple Inc. Product Name: MacBookPro12,1 Version: 1.0 Serial Number: C02PP2V8FVH8 UUID: 25EF0280-EC82-42B0-8FB6-10ADCCC67C02 Wake-up Type: Power Switch SKU Number: Family: MacBook Pro Handle 0x0007, DMI type 2, 17 bytes Base Board Information Manufacturer: Apple Inc. Product Name: Mac-E43C1C25D4880AD6 Version: MacBookPro12,1 Serial Number: C0251830058GDVN1K Asset Tag: Features: Board is a hosting board Location In Chassis: Chassis Handle: 0x0008 Type: Motherboard Contained Object Handles: 0
Hi, If you want to build a kernel with the patch fixing this you will also need this patch as per-requisite: https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/drivers/acpi/video.c?h=linux-next&id=64491882d399011bb0a4603e8cf481b65f0d3c5d Regards, Hans
Hi and thanks a lot again for the quick reply. Unfortunately I think there is a 3rd patch missing: drivers/acpi/video.c: In function ‘video_enable_native_backlight’: drivers/acpi/video.c:423:31: error: ‘NATIVE_BACKLIGHT_ON’ undeclared (first use in this function) use_native_backlight_dmi = NATIVE_BACKLIGHT_ON; ^ drivers/acpi/video.c:423:31: note: each undeclared identifier is reported only once for each function it appears in scripts/Makefile.build:281: recipe for target 'drivers/acpi/video.o' failed Tormen
Hi, (In reply to Tormen from comment #6) > Hi and thanks a lot again for the quick reply. > > Unfortunately I think there is a 3rd patch missing: > > drivers/acpi/video.c: In function ‘video_enable_native_backlight’: > drivers/acpi/video.c:423:31: error: ‘NATIVE_BACKLIGHT_ON’ undeclared (first > use in this function) > use_native_backlight_dmi = NATIVE_BACKLIGHT_ON; Ah yes, just change the NATIVE_BACKLIGHT_ON to 1 that should do the trick. Regards. Hans
Hi, Thanks again for your ultra-fast reply ! :)) Tried it... but it does not work. I'll attach my video.c file. Do you need maybe: kernel config ? dmesg ? lspci -vvvnk ? cat /proc/cmdline \boot\vmlinuz-4.0.4-desktop-banana05 ro root=UUID=7446ae27-f2a4-41a0-b8d3-fdce0e298a30 hid_apple.iso_layout=0 quiet splash=silent initrd=boot\initrd-4.0.4-desktop-banana05 find /sys -name brightness /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness I am not sure about the different kernel parameters: For me I could fix the problem using "acpi_backlight=vendor". But the patch I think is based on: video.use_native_backlight ? I guess I could try forcing this parameter to a certain value first ? I think I read that there are the possible values: 0, 1 and -1 ? Tormen
Created attachment 180301 [details] drivers/acpi/video.c
Hi, (In reply to Tormen from comment #8) > Hi, > > Thanks again for your ultra-fast reply ! :)) > > Tried it... but it does not work. Ah right, my bad you really need that third patch, this one to be specific: https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/drivers/acpi/video.c?h=linux-next&id=ff92cfe7cbc05c6c62f5b06c7d9090f4c853cd51 And you need to apply them in reverse order as I gave them to you, so in this order: https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/drivers/acpi/video.c?h=linux-next&id=ff92cfe7cbc05c6c62f5b06c7d9090f4c853cd51 https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/drivers/acpi/video.c?h=linux-next&id=64491882d399011bb0a4603e8cf481b65f0d3c5d https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/drivers/acpi/video.c?h=linux-next&id=7f5c1882add891f7420a327e908f206fafed3670 Regards, Hans
Hi, Success :) Any idea when this will be accepted upstream ? (kernel version ?) find /sys -name brightness /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-eDP-1/intel_backlight/brightness /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness cat /proc/cmdline \boot\vmlinuz-4.0.4-desktop-banana05 ro root=UUID=7446ae27-f2a4-41a0-b8d3-fdce0e298a30 hid_apple.iso_layout=0 quiet splash=silent initrd=boot\initrd-4.0.4-desktop-banana05 So with all 3 patches it works. To make life easier for people having the same problem I'll upload my patch (integrating the 3) that applies to a 4.0.4 kernel. Thanks a lot, Tormen
Created attachment 180311 [details] Working patch (kernel 4.0.4) for the described problem. This patch integrates the 3 patches that Hans had pointed to.
(In reply to Tormen from comment #11) > Hi, > > Success :) Good. > Any idea when this will be accepted upstream ? (kernel version ?) The patches are queued up in linux-pm for merging into 4.2 Regards, Hans