Skip to content

A little Linux driver that enables the control of laptop backlight connected to NVIDIA chip

Notifications You must be signed in to change notification settings

yellowgh0st/nvidiabl

 
 

Repository files navigation

Little Linux driver based on Andy Wingo's, guillaumezin and madsherlock work that enables
the control of laptop backlight connected to NVIDIA chip using the /sys/class/backlight interface.

This fork supports systems with linux kernel >= 4.0.0.

Compile and install
____________________

git clone https://github.com/crmlt/nvidiabl.git
pushd nvidiabl
make dkms-install

Load module on the fly
______________________

sudo modprobe nvidiabl

Kernel parameters that may be necessary
______________________________________

Try one of these:

acpi_backlight=video
acpi_backlight=vendor
acpi_backlight=native

It should be added to the GRUB_CMDLINE_LINUX_DEFAULT line of /etc/default/grub.

Uninstall driver:
______________

pushd nvidiabl
sudo modprobe -r nvidiabl
make dkms-remove

Driver loading:
_______________

The driver autoloads at boot up for laptops defined in the nvidiabl-laptops.h file.

To load the driver manually, you need to add a line containing nvidiabl in /etc/modules.

Driver debug:
_____________

You can modify yourself the nvidiabl-laptops.h

If you want to test custom brightness min and max values pass these parameters:

sudo modprobe nvidiabl min=50 max=500

You can debug the driver with the following options:

module_param_named(off, off, long, 0644);
MODULE_PARM_DESC(off, "value to put in the register to disable the backlight, negative value
is interpreted as percentage of maximum, -101 for default, autodetect otherwise");

module_param_named(min, min, long, 0644);
MODULE_PARM_DESC(min, "minimum register value for the backlight, negative value is interpreted
as percentage of maximum, -101 for default, autodetect otherwise");

module_param_named(max, max, long, 0644);
MODULE_PARM_DESC(max, "maximum register value for the backlight, -101 for default, autodetect
otherwise");

module_param_named(screen_type, screen_type, long, 0644);
MODULE_PARM_DESC(max, "screen type, 0 for default, 1 for auto, 2 to force LVDS, 3 to force
EPD");

module_param_named(pci_id, pci_id, ulong, 0644);
MODULE_PARM_DESC(pci_id, "PCI ID of the Nvidia card - usefull only when not using
autodetection and more than one Nvidia PCI device");

module_param_named(model, model, charp, 0644);
MODULE_PARM_DESC(model, "backlight model, must be empty for autodetection, nv4x, or nv5x");

module_param_string(type, bl_type, BL_TYPE_SIZE, 0644);
MODULE_PARM_DESC(type, "Backlight type (raw|platform|firmware) default is raw");

Redirect brightness control Fn keys on Lenovo's Thinkpads
_________________________________________________________

In order to redirect the brightness control Fn keys to nvidiabl you have to disable the
brightness feature of the thinkpad acpi module.

Simple create the file:

/etc/modprobe.d/thinkpad.conf

and add the line:

options thinkpad_acpi brightness_enable=0

then:

sudo rmmod thinkpad_acpi
sudo modprobe nividabl
sudo modprobe thinkpad_acpi

Instead of a modprobe option you may reconfigure the boot loader:

thinkpad_acpi.brightness_enable=0

About

A little Linux driver that enables the control of laptop backlight connected to NVIDIA chip

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 48.8%
  • C 40.0%
  • Shell 6.2%
  • Makefile 5.0%