Dell XPS 15 l502x

Dell XPS 15Dell XPS 15 I've just bought a Dell XPS 15 l502x laptop, with a full HD (1920x1080) 15.6" screen, Sandybridge i7-2670QM CPU (quad core 2.20 GHz, up to 3.1 GHz turbo boost) with a larger 9 cell battery and cool backlit keyboard. Initial indications are good, it is quick, the screen is great and the sound (2.1 - yes, it has a mini sub in it!) from JBL is amazing for a laptop. It also has a 2 GB nvidia GT540M GPU, which is set up using optimus switching technology with the integrated intel HD3000 GPU. This should be interesting to get running with linux, as nvidia don't support optimus with their linux driver. It comes running Windows 7 Home Premium, and while I don't mind Windows 7 (it is certainly much better than earlier efforts), the aim is of course to run linux on it - so let's see how it goes.

I'll be trying to get my distro of choice running on it, Arch Linux, with KDE (4.7.3).



So, what works?

Sound -- Works
USB -- Works
Volume buttons -- Work
Backlit keyboard -- Works
Touchpad -- Works, including multitouch
Webcam -- Works

Ethernet -- RTL8168E/8111 gigabit network controller works fine with the r8169 driver, except for that it doesn't work after suspend/resume. It seems to be fixable by unloading/loading the module at suspend, and then executing (via pm-utils):
ifconfig eth0 hw ether [mac address]

Wifi -- Works for a while, but then seems to just stop responding. Turning power management off seems to fix it.
# iwconfig wlan0 power off

Brightness buttons
Work, but no OSD --> set acpi_backlight=vendor on kernel grub line

Softkeys
The first returns meta+x
The second functions as brightness down and in addition returns dell_wmi: Unknown key e025 pressed
The third functions as media next and in addition returns dell_wmi: Unknown key e026 pressed

SD Card
The reader isn't recognised at all at first, but this can be fixed by inserting the card then running
# echo 1 > /sys/bus/pci/rescan

Touchpad off button
QT/KDE doesn't recognise the keycode, so we can use xbindkeys to run a custom script to toggle the touchpad on and off:

~/.xbindkeysrc

"~/touchpad_toggle.sh"
m:0x0 + c:199
XF86TouchpadToggle


~/.touchpad_toggle.sh

#!/bin/bash
if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{print $2 }') -eq 0 ]; then
        synclient TouchpadOff=1
else
        synclient TouchpadOff=0
fi


Graphics
Now for the fun one. This laptop has two graphics cards, an Intel HD3000 built into the CPU, and a discrete Nvidia GT540M 2GB. The two are hooked together using Nvidia's Optimus technology, whereby the Nvidia card isn't actually connected to any of the outputs - any rendering done on the Nvidia GPU is copied to the Intel framebuffer for display (if I have understood it all correctly). The plan then is that the Nvidia GPU is dynamically turned on and off as needed to provide extra power while minimising battery use. Unfortunately, Nvidia's drivers for linux don't support Optimus, and nor do Nvidia plan to do anything about it. The Intel GPU works just fine, but the Nvidia one is sat there doing nothing consuming power.

We can try to turn it off however, with acpi_call
Install acpi_call, then add the following to /etc/rc.local
modprobe acpi_call
echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call

It is worth noting the Bumblebee project aims to bring Optimus-esque behaviour to linux.