Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 06 Jul 2013 20:59:51 +0200
From:      Matthias Petermann <matthias@d2ux.net>
To:        freebsd-current@freebsd.org
Subject:   ACPI Lenovo X121e (Model 3045-79G, i3, HD3000) Suspend and LCD Brightness
Message-ID:  <51D86927.5090907@d2ux.net>

next in thread | raw e-mail | index | archive | help
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@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@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@thinkpad:/usr/home/mpeterma # kldload acpi_video
   acpi_video0: <ACPI video extension> on vgapci0
   root@thinkpad:/usr/home/mpeterma # sysctl -a |grep bright
   hw.acpi.video.lcd0.brightness: 35
   root@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@thinkpad:/usr/home/mpeterma # kldload acpi_ibm
   acpi_ibm0: <IBM ThinkPad ACPI Extras> on acpi0
   root@thinkpad:/usr/home/mpeterma # sysctl -a | grep bright
   hw.acpi.video.lcd0.brightness: 90
   dev.acpi_ibm.0.lcd_brightness: 7
   root@thinkpad:/usr/home/mpeterma #
   root@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@thinkpad:/usr/home/mpeterma # sysctl -a | grep 
dev.acpi_ibm.0.availmask
   dev.acpi_ibm.0.availmask: 67733756
   root@thinkpad:/usr/home/mpeterma # sysctl dev.acpi_ibm.0.events=1
   dev.acpi_ibm.0.events: 0 -> 1
   root@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@thinkpad:/usr/home/mpeterma # cd /usr/ports/sysutils/acpi_call/
    root@thinkpad:/usr/ports/sysutils/acpi_call # make install clean
    root@thinkpad:/usr/ports/sysutils/acpi_call # kldload acpi_call

    root@thinkpad:/usr/ports/sysutils/acpi_call # acpi_call -p '\VBRU'
    root@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@thinkpad:/usr/home/mpeterma # sysctl -a |grep supported
   hw.acpi.supported_sleep_state: S3 S4 S5

### S3, hw.acpi.reset_video=0

   root@thinkpad:/usr/home/mpeterma # sysctl hw.acpi.reset_video=0
    hw.acpi.reset_video: 0 -> 0
   root@thinkpad:/usr/home/mpeterma # acpiconf -s 3

Result: System suspends, no video after resume, black screen

### S3, hw.acpi.reset_video=1

   root@thinkpad:/usr/home/mpeterma # sysctl hw.acpi.reset_video=1
   hw.acpi.reset_video: 0 -> 1
   root@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@thinkpad:/home/mpeterma # cd /sys/modules/acpi/acpi
   root@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@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=7022f90cea5e48da7fa65806c0d66091*


Any help is welcome. Please let me know when I can provide more details 
/ testing.

Kind regards,
Matthias




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51D86927.5090907>