GithubHelp home page GithubHelp logo

sirfz / nvidiabl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guillaumezin/nvidiabl

0.0 2.0 0.0 18.98 MB

Linux driver for setting the backlight brightness on laptops using NVIDIA GPU

Makefile 5.16% C 40.49% Shell 3.82% C++ 50.53%

nvidiabl's Introduction

I wrote a little Linux driver based on Andy Wingo's work
(http://wingolog.org/pub/nvbacklight-0.1.tar.bz2) and MacTel Team
(https://launchpad.net/~mactel-support) that enables the control of laptop backlight connected
to NVIDIA chip using the /sys/class/backlight interface.

Kubuntu 9.10 for instance uses this interface to control the backlight from powerdevil. It is
tested with a Sony AW11M/H laptop (Nvidia 9300M GS). Other users successfully tested it on
other laptops (have a look at the nvidiabl-laptops.h file).


Installation from nvidiabl-dkms_xxxx_all.deb file (Debian and distributions based on it):
_________________________________________________________________________________________

Install the file from your favorite software manager or type:

sudo dpkg -i nvidiabl-dkms_xxxx_all.deb


Uninstallation (after installation from nvidiabl-dkms_xxxx_all.deb file):
_________________________________________________________________________

Uninstall the nvidiabl package from your favorite software manager or type:

sudo dpkg -r nvidiabl


Installation from nvidiabl-x.xx-source-only.dkms.tar.gz file:
_____________________________________________________________

If not already done, install DKMS, for instance with Ubuntu:

sudo aptitude update && sudo aptitude install dkms

Then:

sudo dkms ldtarball --archive=nvidiabl-x.xx-source-only.dkms.tar.gz build install

Where x.xx is the nvidiabl module version.


Uninstallation (after installation from nvidiabl-x.xx-source-only.dkms.tar.gz file):
____________________________________________________________________________________

cd /usr/src/nvidiabl-x.xx
make dkms-remove

Where x.xx is the nvidiabl module version. To know what version are installed on your system,
type:

dkms status

If nvidiabl is the last module to use DKMS, you can remove the DKMS package, for instance with
Ubuntu, type:

sudo aptitude remove dkms


Installation from source files:
_______________________________

If not already done, install DKMS, for instance with Ubuntu, type:

sudo aptitude update && sudo aptitude install dkms

Uncompress the source files and from that directory, type:

make dkms-install

Then you can erase the directory where source files have been uncompressed.


Create a package:
_________________

For instance for version 0.72:

sudo dkms mkdeb mktarball --source-only -m nvidiabl -v 0.72

Then the package should be available here:
/var/lib/dkms/nvidiabl/0.72/tarball/nvidiabl-0.72-source-only.dkms.tar.gz


Uninstallation (after installation from nvidiabl-x.xx-source-only.dkms.tar.gz file or from
source files version 0.59 or newer):
__________________________________________________________________________________________

cd /usr/src/nvidiabl-x.xx
make dkms-remove

Where x.xx is the nvidiabl module version. To know what versions are installed on your system,
type:

dkms status

If nvidiabl is the last module to use DKMS, you can remove the DKMS package, for instance with
Ubuntu, type:

sudo aptitude remove dkms


Uninstallation (after installation from source files or from
nvidiabl-x.xx-source-only.dkms.tar.gz for version 0.58 or older):
_________________________________________________________________

sudo dkms remove -m nvidiabl -v x.xx --all
sudo rm -rf /usr/src/nvidiabl-x.xx

Where x.xx is the nvidiabl module version 0.58 or previous. To know what version are installed
on your system, type:

dkms status

On some older version, the package name can be nvbacklight or nvidia_bl.

If nvidiabl is the last module to use DKMS, you can remove the DKMS package, for instance with
Ubuntu, type:

sudo aptitude remove dkms


Driver loading:
_______________

The driver autoloads at boot up for Sony Vaio VGN AW11, FZ11 and FZ38 laptops and other
laptops, have a look in the nvidiabl-laptops.h file.

To load the driver manually, you need to add a line containing nvidiabl in /etc/modules. If
you want the driver to autoload for your laptop without adding a line to /etc/modules, please
give me the output of:

lspci -nn
cat /sys/class/dmi/id/sys_vendor
cat /sys/class/dmi/id/product_name


Driver debug:
_____________

If you know Linux driver programming, you can modify yourself the nvidiabl-laptops.h and send
me the line you added.

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");

For instance, if you want to test 50 as min value and 500 as max value, type:

sudo modprobe -r nvidiabl
sudo modprobe nvidiabl min=50 max=500


I can change the backlight value from the power settings GUI but my Fn keys are not working:
____________________________________________________________________________________________

On https://github.com/guillaumezin/nvidiabl/blob/master/scripts, there are bash (in
/usr/local/sbin) and ACPI (in /etc) scripts examples that permit on my laptop to use Fn keys
to change the backlight settings. This is an ugly workaround (you don't have OSD this way),
good practice should be to have a look at the /usr/share/doc/udev/README.keymap.txt.gz and
fill a bug report.

There is some intereting scripts here too: http://dev.osource.se/software/obacklight.


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 type:

sudo rmmod thinkpad_acpi
sudo modprobe nividabl
sudo modprobe thinkpad_acpi

Instead of a modprobe option you may reconfigure the boot loader and add
thinkpad_acpi.brightness_enable=0 to the command line.


nVidia staff is of course free to ship this driver with theirs!

Guillaume

nvidiabl's People

Contributors

akanouras avatar alip avatar davidegrayson avatar fragonca avatar gijsdeheij avatar guillaumezin avatar mspacek avatar rhollencamp avatar richardmansfield avatar rrockru avatar rwstauner avatar sirfz avatar tehbawb avatar tiran avatar wbond avatar xaser66 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.