← Back to team overview

sony-vaio-z-series team mailing list archive

Re: LibGL problems on Graphics switching

 

At Tue, 07 Dec 2010 19:48:19 +0000,
Simon Brown wrote:
> Ah, I was being a bit slow. In Adams updated vaio_gfx_config it does
> the xorg.conf swap. I clobbered that when I made Rutgers
> changes. Putting those changes back in removes the need for the
> rc.local script. It seems to work but the nouveau blacklisting is
> unreliable.
> 
> There is a nvidia-graphics-drivers.conf in /etc/modprobe that should
> blacklist nouveau but it doesn't seem to work. So I've also added it
> to blacklist.conf
> 
> I wonder if it will be reliable. But it's a lot better with Rutgers
> changes.

I've fixed the script as included below and it works very
well. However I now have to boot into Adam's switch status checking
kernel every time I boot the computer which is tiresome and so close
to good enough. 

I understand I can hack the BIOS to set the register according to the
switch position at startup, but I really don't want to do that. Is
there any other way to ensure that the switch position is honoured at
boot time?

Thanks,

Simon

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.


modprobe sony-laptop 2>/dev/null

set_alternatives_to_intel()
{
    echo "Intel card active."
    update-alternatives --set gl_conf /usr/lib/mesa/ld.so.conf
    ldconfig
    if [ -f /etc/X11/xorg.conf ]
    then
	grep "\<nvidia\>" /etc/X11/xorg.conf 2>/dev/null >/dev/null  && mv -f /etc/X11/xorg.conf /etc/X11/xorg.conf.nvidia 2>/dev/null
    fi
    return 0
}

set_alternatives_to_nvidia()
{
    echo "NVidia card active."
    update-alternatives --set gl_conf /usr/lib/nvidia-current/ld.so.conf
    ldconfig
    [ ! -f "/etc/X11/xorg.conf" ] && [ -f "/etc/X11/xorg.conf.nvidia" ] && echo "Copy nvidia xorg.conf" && cp /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf
    return 0
}

if uname -r | grep -e "-vaioz$" >/dev/null
then
    [ "$(cat /sys/devices/platform/sony-laptop/speed_stamina)" = "stamina" ] && set_alternatives_to_intel || set_alternatives_to_nvidia
fi

exit 0



References