← Back to team overview

sony-vaio-z-series team mailing list archive

Re: Backlight with NVidia driver on Vaio Z11

 

Hey, nice work!

I guess that was the only major gripe left on this device!

I'll test as soon as I have the chance to try it.

Cheers!

----- Original Message -----
From: "Carlchristian Eckert" <Carli-Eckert@xxxxxx>
To: sony-vaio-z-series@xxxxxxxxxxxxxxxxxxx
Sent: Saturday, August 25, 2012 10:20:11 PM
Subject: Re: [Sony-vaio-z-series] Backlight with NVidia driver on Vaio Z11

I guess I found a solution for the backlight issue (I'm running 
ArchLinux 64bit Kernel 3.5.2 on a VGN-Z21VN with the NVidia 9300GS and 
driver version 304.37 ).

Steps that I did:
- adding acpi_backlight=vendor as a kernel parameter in Grub
- adding Option "RegistryDwords" "EnableBrightnessControl=1" in 
xorg.conf (as found on several nvidia-related forums. Still not sure if 
that was necessary, but I will figure that out later)
- installing nvidia-bl module (version 0.17.3-1)
- the brightness is a value between 0 and 2047 in the file 
/sys/class/backlight/nvidia_backlight/brightness

for convenience, I wrote the following script, which might be called 
e.g. with parameters "up" and "down" from your acpi-deamon (please 
forgive my bash-illiteracy :D )

#!/bin/bash
VALUES=( 0 30 80 200 400 600 2047 )

IndexOf(){
     local i=0 S=$1; shift
     while [ $S != $1 ]
     do    ((i++)); shift
         [ -z "$1" ] && { i=0; break; }
     done
     echo $i
}

cd /sys/class/backlight/nvidia_backlight
BRIGHTNESS=`cat brightness`
index=`IndexOf $BRIGHTNESS ${VALUES[@]}`

if [ "$1" = "up" ]
then
	# the number of brighness values minus 1
	if [ "$index" = "6" ]; then
		exit 0
	else
		DISPLAY=:0 xset dpms force on
		(( index++ ))
	fi
else
	if [ "$index" = "0" ]; then
		DISPLAY=:0 xset dpms force off
	else
		(( index-- ))
	fi
fi

NEW_BRIGHTNESS=${VALUES[index]}

echo $NEW_BRIGHTNESS > brightness
exit 0



if you have any improvements, don't hesitate to add :)

Carlchristian


_______________________________________________
Mailing list: https://launchpad.net/~sony-vaio-z-series
Post to     : sony-vaio-z-series@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~sony-vaio-z-series
More help   : https://help.launchpad.net/ListHelp


References