Re: ACPI Lenovo X121e (Model 3045-79G, i3, HD3000) Suspend and LCD Brightness

From: Kevin Oberman <rkoberman_at_gmail.com>
Date: Sat, 6 Jul 2013 17:49:27 -0700
On Sat, Jul 6, 2013 at 11:59 AM, Matthias Petermann <matthias_at_d2ux.net>wrote:

> Hello,
>
> on a Lenovo X121e (Model 3045-79G, i3, HD3000) I try FreeBSD since 9.1.
> Wifi, LAN, Audio, USB peripherials and Video (with KMS patch) just working
> fine. Anyway, there are some open items:
>
> * LCD brightness control doesn't work
> * Suspend to RAM (S3) doesn't restore video after resume
>
> That's why I upgraded my system to 10.0-CURRENT and looked in more detail
> at it:
>
>   root_at_thinkpad:/usr/home/**mpeterma # uname -a
>   FreeBSD thinkpad.local 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r252853: Sat
> Jul  6 02:01:48 CEST 2013 root_at_thinkpad.local:/usr/obj/**usr/src/sys/GENERIC
>  amd64
>
> # LCD Brightness
>
> First, on LCD brightness: The X121e is expected to increase/decrease LCD
> brightness by Fn+F9/Fn+F8.  This is not working right now. So I tried the
> following:
>
> ## Attempts
>
> ### acpi_video / sysctl hw.acpi.video.lcd0.brightness
>
> This is what is working on most of the other laptops I tried it.
>
>   root_at_thinkpad:/usr/home/**mpeterma # kldload acpi_video
>   acpi_video0: <ACPI video extension> on vgapci0
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl -a |grep bright
>   hw.acpi.video.lcd0.brightness: 35
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl
> hw.acpi.video.lcd0.brightness=**100
>   hw.acpi.video.lcd0.brightness: 35 -> 100
>
> Result: LCD brightness doesn't change after sysctl call, Fn+F9/Fn+F8 not
> working.
>
> ### acpi_ibm / sysctl dev.acpi_ibm.0.lcd_brightness
>
> This is what worked on some older Thinkpads.
>
>   root_at_thinkpad:/usr/home/**mpeterma # kldload acpi_ibm
>   acpi_ibm0: <IBM ThinkPad ACPI Extras> on acpi0
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl -a | grep bright
>   hw.acpi.video.lcd0.brightness: 90
>   dev.acpi_ibm.0.lcd_brightness: 7
>   root_at_thinkpad:/usr/home/**mpeterma #
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl
> dev.acpi_ibm.0.lcd_brightness=**1
>   dev.acpi_ibm.0.lcd_brightness: 7 -> 1
>
> Result: LCD brightness doesn't change after sysctl, Fn+F9/Fn+F8 still not
> working.
>
> ### Activate sysctl dev.acpi_ibm.0.events
>
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl -a | grep
> dev.acpi_ibm.0.availmask
>   dev.acpi_ibm.0.availmask: 67733756
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl dev.acpi_ibm.0.events=1
>   dev.acpi_ibm.0.events: 0 -> 1
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl
> dev.acpi_ibm.0.handlerevents='**0x03 0x04 0x10 0x11'
>
> Result: Fn+F9/Fn+F8 still not working.
>
> ### Direct ACPI calls with acpi_call
>
>    root_at_thinkpad:/usr/home/**mpeterma # cd /usr/ports/sysutils/acpi_call/
>    root_at_thinkpad:/usr/ports/**sysutils/acpi_call # make install clean
>    root_at_thinkpad:/usr/ports/**sysutils/acpi_call # kldload acpi_call
>
>    root_at_thinkpad:/usr/ports/**sysutils/acpi_call # acpi_call -p '\VBRU'
>    root_at_thinkpad:/usr/ports/**sysutils/acpi_call # acpi_call -p '\VBRD'
>
> Result: on each acpi_call, \VBRU increases and \VBRD decreases LCD
> brightness by one step.
> Fn+F9/Fn+F8 still not working.
>
> ## Summary
>
> Direct ACPI calls are sufficient as workaround. I would like to support a
> real solution. What are the next steps to find out what is wrong here? I
> think a solution for this problem will help not just X121e users but any
> user of more recent thinkpads. I saw similiar postings for X230 and X220.
>
> # Suspend to RAM
>
> The following observations I made without the i915 KMS module loaded (in
> console mode).
>
> ## Attempts
>
> ### Supported Sleep states as reported by sysctl
>
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl -a |grep supported
>   hw.acpi.supported_sleep_state: S3 S4 S5
>
> ### S3, hw.acpi.reset_video=0
>
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl hw.acpi.reset_video=0
>    hw.acpi.reset_video: 0 -> 0
>   root_at_thinkpad:/usr/home/**mpeterma # acpiconf -s 3
>
> Result: System suspends, no video after resume, black screen
>
> ### S3, hw.acpi.reset_video=1
>
>   root_at_thinkpad:/usr/home/**mpeterma # sysctl hw.acpi.reset_video=1
>   hw.acpi.reset_video: 0 -> 1
>   root_at_thinkpad:/usr/home/**mpeterma # acpiconf -s 3
>
> Result: system reboots immediately
>
> ## Adding more debug output
>
> In ACPI Debugging guide it is recommended to recompile the ACPI module
> with additional debug mode.
> Anyway, when I try so, I get a warning:
>
>   root_at_thinkpad:/home/mpeterma # cd /sys/modules/acpi/acpi
>   root_at_thinkpad:/sys/modules/**acpi/acpi # make clean
>   make: "/usr/src/sys/modules/acpi/**acpi/Makefile" line 4: "The ACPI
> module is deprecated, set FORCE_BUILD to force it"
>   root_at_thinkpad:/sys/modules/**acpi/acpi #
>
> Is this still the way to go, or doesn't the guide reflect the state of
> FreeBSD 10?
>
> # Detail information to X121e
>
> I uploaded the following details regarding the X121e:
>
> * dmesg
> * ACPI ASL
> * Sysctl ACPI keys
>
> to: *https://d2ux.org/owncloud/**public.php?service=files&t=**
> 7022f90cea5e48da7fa65806c0d660**91*<https://d2ux.org/owncloud/public.php?service=files&t=7022f90cea5e48da7fa65806c0d66091*>
>
>
> Any help is welcome. Please let me know when I can provide more details /
> testing.
>
> Kind regards,
> Matthias
>

Can't help with suspend/resume, but I can point you to the brightness
solution.

This is probably the same issue that impacts most recent Lenovo laptops. If
so, there is a fix in the thread titled "Fixing X220 Video The Right Way"
on this (acpi_at_) mailing list with the patch by jhb on Feb. 28, but be usre
to a followup message on using the fix posted on June 14. It' a tricky
issue with getting a string with quoted characters parsed correctly.

There have been a number of discussions on ThinkPad suspend/resume, but I
have not seen a reliable fix. (I can't resume mine at this time, though it
suspends fine :-)
-- 
R. Kevin Oberman, Network Engineer
E-mail: rkoberman_at_gmail.com
Received on Sat Jul 06 2013 - 22:49:28 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:39 UTC