From owner-freebsd-acpi@FreeBSD.ORG Tue Mar 30 03:32:59 2010 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00BAD106564A for ; Tue, 30 Mar 2010 03:32:59 +0000 (UTC) (envelope-from dan@obluda.cz) Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz [78.128.192.10]) by mx1.freebsd.org (Postfix) with ESMTP id 916178FC15 for ; Tue, 30 Mar 2010 03:32:57 +0000 (UTC) X-Envelope-From: dan@obluda.cz Received: from kgw.obluda.cz (kgw.obluda.cz [193.179.199.50]) by smtp1.kolej.mff.cuni.cz (8.14.3/8.14.3) with ESMTP id o2U3Wt9R030896 for ; Tue, 30 Mar 2010 05:32:56 +0200 (CEST) (envelope-from dan@obluda.cz) Message-ID: <4BB170E7.3030407@obluda.cz> Date: Tue, 30 Mar 2010 05:32:55 +0200 From: Dan Lukes User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.8) Gecko/20100221 SeaMonkey/2.0.3 MIME-Version: 1.0 To: freebsd-acpi@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Brightness change on notebook that follow ACPI specification (par. B.7) X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2010 03:32:59 -0000 Most notebooks have special keys (mostly Fn+something) to change brightness of LCD display. Some of them (my notebok, for example) follows the ACPI specification (paragraph B.7) how to announce the user request for brightness change to OS. I implemented such handling as part of acpi-video module. It's verified to work on my HP Mini 5101 & FreeBSD 8.0. No test on other notebook done as I have no other notebook. No test on other OS version, but verified that patched module can be compiled on 6.4-R, 7.2-R, 8.0-R. I assume (not verified) it's compilable on all 6.x-8.x. I assume (not verified) it should work on all of these versions. If someone want to test it then the patch is here: http://www.freebsd.cz/~dan/patch-acpi-video installation: cd /usr/src ; patch < patch-acpi-video then compile the module: http://www.freebsd.org/doc/handbook/acpi-debug.html#ACPI-DEBUGOUTPUT then kldload acpi_video then try keys for brightness change. I'm interested to know on which notebook and FreeBSD version is verified to be (not)working. If it doesn't work it may be either: 1. bug in my patch 2. your notebook doesn't follow ACPI specification (par. B.7) If you are skilled user and you want to know more (and you have compiled ACPI modules with ACPI_DEBUG) you can set debug.acpi.level="ACPI_LV_ALL_EXCEPTIONS" then look on console messages what happens when you press the special keys. Dan P.S. Brief info how it works: Specification claim the ACPI will send notification of the type 0x85-0x88 (brightness cycle/inc/dec/zero) to the output device handler. It's catched by my code (in acpi_video module) so I know what key user pressed. With such knowledge and current brightness (obtained from _BCQ method evaluation) and list of allowed brightnesses (obtained from _BCL method evaluation), I can calculate new brightness. It's set using _BCM method. No more fun here ...