克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

BrightnessKeys

Build Status Scan Status

Automatic handling of brightness keys based on ACPI Specification, Appendix B: Video Extensions.
Requires Lilu 1.2.0 or newer.

Boot arguments

  • -brkeysdbg to enable debug printing (available in DEBUG binaries).

Special cases

Typically no DSDT patches are required. Please remove old _Qxx to XQxx ones.
On some models, may be required add ACPI patch _OSI to XOSI and SSDT-XOSI.

Spoiler: On some old ThinkPad models, additional handling may be required.
Here is an example for their "brightness up" EC event.
Method (_Q14, 0, NotSerialized)
{
    If (^HKEY.MHKK (0x8000))
    {
        ^HKEY.MHKQ (0x1010)                // Vendor-specific event: TP_HKEY_EV_BRGHT_UP
    }

    If (NBCF) // Whether
    {
        If (VIGD)
        {
            Notify (^^^VID.LCD0, 0x86)     // Send 0x86 "Increase Brightness" to integrated graphics
        }
        Else
        {
            Notify (^^^PEG.VID.LCD0, 0x86) // Send 0x86 "Increase Brightness" to discrete graphics
        }
    }
    Else
    {
        Local0 = BRLV                      // Local variable to store current brightness level
        If ((Local0 != 0x0F))
        {
            Local0++
            BRLV = Local0
        }

        If (VIGD)
        {
            UCMS (0x16)                    // SMI access for integrated graphics
            BRNS ()
        }
        Else
        {
            VBRC (Local0)                  // SMI access for discrete graphics
        }

        ^HKEY.MHKQ (0x6050)                // Vendor-specific event: TP_HKEY_EV_BACKLIGHT_CHANGED
    }
}

When NBCF is set to zero by default, the method will not notify graphics devices and try to adjust brightness directly. To override that, set NBCF = 0x01 in SSDT hotpatch, or just replace its declaration using a simple patch.

  • For DSDT compiled with older iasl, replace Name (NBCF, 0x00) to Name (NBCF, 0x01):
    Find: 08 4E424346 0A 00 // NameOp "NBCF" BytePrefix "00"
    Repl: 08 4E424346 0A 01 // NameOp "NBCF" BytePrefix "01"

  • For DSDT compiled with newer iasl, replace Name (NBCF, Zero) to Name (NBCF, One):
    Find: 08 4E424346 00 // NameOp "NBCF" ZeroOp
    Repl: 08 4E424346 01 // NameOp "NBCF" OneOp

Credits

BSD 3-Clause License Copyright (c) 2020, zhen-zen All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

暂无描述 展开 收起
C++
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化