From owner-freebsd-current@FreeBSD.ORG Sun Jul 7 00:49:28 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A9C5522 for ; Sun, 7 Jul 2013 00:49:28 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-ob0-x22a.google.com (mail-ob0-x22a.google.com [IPv6:2607:f8b0:4003:c01::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 1922A1B19 for ; Sun, 7 Jul 2013 00:49:28 +0000 (UTC) Received: by mail-ob0-f170.google.com with SMTP id ef5so4286232obb.15 for ; Sat, 06 Jul 2013 17:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=R8WxyX+gZghjHuBpDMhGo+YquLlg775NW31I8q1D3Xk=; b=hgSRZ0SuwaixFnVWe3Y+7y8hN3hJHE0qGuiQ1+TUWvnmIwpARokU4saZ3+ejMJNVlq uTrpwB55dhHv4OyEdVCOrSHRKOl+ohKdz3jx7jRb7uprUDQmcWi5tEv9o/D7gLkIoZ+u g5c5d7UyF3C3zj976Cw9v2MWyk+dKhCNyxsFxhfCJnd5lfRgYL8Wwc463hCybO0X9PQE Aa9m3zSMqk82ZtGxMe78zVu17ozFOw5NXg7UFsOhLc5lpe5DKOictGp1jhB/6/9nUt6O DdEB4n0qeOo9/lz8RTaTNRqlyAON2/qCLeTQX0J82jy+Uq4FlE3zArLNWn5SZA3adYhB 7SQQ== MIME-Version: 1.0 X-Received: by 10.182.50.200 with SMTP id e8mr16438826obo.35.1373158167531; Sat, 06 Jul 2013 17:49:27 -0700 (PDT) Sender: kob6558@gmail.com Received: by 10.76.112.212 with HTTP; Sat, 6 Jul 2013 17:49:27 -0700 (PDT) In-Reply-To: <51D86927.5090907@d2ux.net> References: <51D86927.5090907@d2ux.net> Date: Sat, 6 Jul 2013 17:49:27 -0700 X-Google-Sender-Auth: 0Ih8f_A8LBRFlJX5lYLHJx0fjtA Message-ID: Subject: Re: ACPI Lenovo X121e (Model 3045-79G, i3, HD3000) Suspend and LCD Brightness From: Kevin Oberman To: Matthias Petermann Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 00:49:28 -0000 On Sat, Jul 6, 2013 at 11:59 AM, Matthias Petermann 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@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: 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: 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=** > 7022f90cea5e48da7fa65806c0d660**91* > > > 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@) 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@gmail.com