gma50_gfx works, use CONFIG_DRM_GMA500=m (or y). The console has to use framebuffer, though. To get bigger fonts on the console, I've used FONT="Uni3-Terminus32x16.psf.gz" in /etc/default/console-setup. To get bigger fonts from the very beginning, I set up CONFIG_FONT_SUN12x22=y in the kernel config and fbcon=font:SUN12x22 kernel parameter (GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub).
Brightness can be set up by echoing a value to /sys/class/backlight/psb-bl/brightness.
You should use Driver "modesetting" in the /etc/X11/xorg.conf file. However, Debian driver (at the time of writing) xserver-xorg-video-modesetting 0.3.0-1 does not work and you have to get a newer version. Get version 0.5.0 from http://cgit.freedesktop.org/xorg/driver/xf86-video-modesetting/ and compile it. You need to install the packages libdrm-dev libkms-dev xserver-xorg-dev pkg-config along with all the dependencies and then ./configure; make. You need just the file xf86-video-modesetting-0.5.0/src/.libs/modesetting_drv.so - first strip it: strip modesetting_drv.so and then replace /usr/lib/xorg/modules/drivers/modesetting_drv.so with this version.
You can get the file compiled for my system here; it might (or might not) work on your system... With this, pm-hibernate works (and there is no need to save/restore the videocard state, nor change into framebuffer console), but upon resuming, the screen is garbled - you need to switch resolutions with xrandr to restore it (most likely by typing blindly). I have created a python script zoomlcd that changes resolution, while keeping aspect ratio. Use: zoomlcd + to zoom in (decrease the resolution) or zoomlcd - to zoom out (increase the resolution). I bound this commands to the zoom in/zoom out keys (Fn F9/Fn F10), and also incorporated into the hibernate script:
#!/bin/sh brightness=`cat /sys/class/backlight/psb-bl/brightness` sync rfkill block all sync echo 3 > /proc/sys/vm/drop_caches sync pm-hibernate su - garabik -c "DISPLAY=:0.0 exec zoomlcd +" su - garabik -c "DISPLAY=:0.0 exec zoomlcd - echo $brightness > /sys/class/backlight/psb-bl/brightnessto hibernate and:
echo mem > /sys/power/stateto sleep. Using pm-hibernate --quirk-vbemode-restore or --quirk-vbestate-restore does not restore the graphics.
3G modem works, but I had to downgrade ppp to 2.4.4rel-10.1 - the wheezy version cannot connect when called from scripts (as opposed to the command line) - see Debian bug #598551.
GPS probably works - first initialise it with:
$ screen /dev/ttyHS4 9600 AT_OGPS=2and then get the raw data with screen /dev/ttyHS1 (hint taken from this page). The devices can be different in your case. I did not investigate the GPS further.
The picture is shifted by about 2 pixels upwards - I can live with that.
You have to use Driver "fbdev" in the /etc/X11/xorg.conf file - Driver "modesetting" does not work (with xserver-xorg-video-modesetting 0.3.0-1). This unfortunately means that xrandr won't work.
Brightness can be set up by echoing a value to /sys/class/backlight/psb-bl/brightness.
External display kind of works - the results differ depending on whether you plug in the display after booting, or boot with the display attached. In the former case, only a 1024x768 rectangle is visible on the external display. In the latter case, the resolution of the internal display is set up to 1024x768 and the external is duplicated. EDID does not work - there is a kind of workaround by setting CONFIG_DRM_LOAD_EDID_FIRMWARE=y and putting options drm_kms_helper edid_firmware=edid/1920x1080.bin (assuming your monitor can take 1920x1080 resolution) in /etc/modprobe.d/drm-kms-helper.conf file. 1680x1050.bin does not work well - the console is OK, but the X11 display is cut in the middle and the halves are transposed.
Suspending and hibernating work. I am using following script
#!/bin/sh chvt 1 sync rfkill block all vbstate=/var/lib/vbetool.state vbetool vbestate save > $vbstate sync echo 3 > /proc/sys/vm/drop_caches sync pm-hibernate vbetool vbestate restore < $vbstate chvt 7to hibernate and:
echo mem > /sys/power/stateto sleep. Using pm-hibernate --quirk-vbemode-restore or --quirk-vbestate-restore does not work, and the computer does not wake up from pm-suspend.
Update: with kernel 2.6.36, the kernel does not recognise 3G modem, neither wifi nor bluetooth. As if the devices were not there. I am therefore back to 126.96.36.199.
The only major issue that I have not been able to resolve is missing GPS - the kernel simply does not see the device.
The Sony has 2GB RAM, 60 GB HDD (unfortunately, I could not get the SSD version), 8" LCD, wifi, 2× USB, SD Card reader, bluetooth, 3G HSDPA, 1.33GHz Z520 Intel Atom CPU, external VGA and ethernet via an adapter and Windows Vista.
Standard text mode (80x25) is fine, the resolution is so high that you do not see the pixelisation, unfortunately the screen is too wide -- wide enough to be uncomfortable (the characters are wider that their height). Framebuffer works well, but the native resolution has tiny tiny letters, almost unreadable. So good bye text console... we'll do our daily work in fullscreen xterm (or rxvt).
There are two possibilities how to run the X11 in non-native mode. One is fbdev, another one vesa. Both work well, both run on the native resolution, both are equally slow. The slowness would not be much of an issue (I am not going to play OpenArena on this), but what is crucial is that neither of them supports external display. And that is essential (yes, I do a lot of presentations).
So that left me with attempts to run native psb drivers.
The X11 driver won't work without corresponding kernel module and some binary blobs; the last kernel module available is for 2.6.28, it does not even compile with 2.6.30, due to some changes in API.
At the end, I used the method outlined at http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=30;bug=533450 I used jaunty instead of intrepid, though.
So now I am running 2.6.28, debian lenny, with X11 server from jaunty, I added psb to the /etc/modules file.
I had to add Option "IgnoreACPI" "true" to the /etc/X11/xorg.file and boot the kernel with mem=1800M.
The X feels pretty slow, but not unusably so. Running it in 16bpp mode helps a bit. It is accelerated, though -- playing video through mplayer and xv works perfectly.
The X11 server was rather unstable, from time to time (after ~1 hour of work) X11 stopped reacting to keyboard -- not even Crtl+Alt+Bksp nor Ctrl+Alt+Fn. Mouse worked, I could ssh into the machine, I could kill X with Alt+SysRq+K and blindly log in and start new X, which worked for another hour. First I thought the xmonad window manager is responsible, but after some trials and errors I booted kernel in uniprocessor mode (kernel parameter nosmp) and had no crash ever since.
Opera was still unusably slow, though. While browsing was OKish, editing forms was impossible -- it took 2 seconds from pressing a key for the character to display. Firefox was fine, though. Finally I discovered that turning xft fonts off (via about:config) helped -- without them, opera is super fast again. The glyphs are a bit jarred, unfortunately.
#!/bin/sh umountpy sync sudo chvt 1 sudo sh -c '(echo mem > /sys/power/state)' sudo chvt 7and this to hibernate to disk:
#!/bin/sh umountpy sync sudo chvt 1 sudo sh -c '(echo shutdown > /sys/power/disk)' sudo sh -c '(echo disk > /sys/power/state)' sudo sh -c '(echo 3 > /proc/sys/vm/drop_caches)' sudo chvt 7Waking from suspend to RAM still takes a while, because the X server has to re-initialise the graphics adapter.
Using "proper" desktop environment, there will be probably an icon for these actions, displayed when logging off.
I decided to wait until poulsbo driver becomes available for kernels >=2.6.30 and then patch my kernel with TuxOnIce, which will give it better hibernate speeds.
Without poulsbo driver (console, vesa or fbdev X11) setpci -s 00:02.0 F4.B=XX, where XX∈<0, FF> (hexadecimal) (see also zbright script) can be used to change the brightness.
However, with poulsbo X11, this no longer works, but xbacklight does - so I guess that with appropriate hotkey/window manager configuration, it will work out of the box
There are these files connecting with backlight control:
I am using following script to change LCD monitor resolution:
#!/bin/sh x="$1" # x resolution y="$2" # y resolution r="$3" # refresh rate, use 60 out=`gtf $x $y $r |grep Modeline` name=`echo $out|cut -d ' ' -f 2` mode=`echo $out|cut -d ' ' -f 2-` str="xrandr --newmode $mode" $str xrandr --addmode LVDS0 $name xrandr --output LVDS0 --mode $nameI saved it as setmodes.sh and I am using it e.g. setmodes 1000 480 60. The native resolution is so great that there is no pixelization visible, and you do not have to turn up DPI to an insanely huge value (like 220) and using huge fonts (size 20+), which messes up layout of some pages etc... And lower resolution is easier on the CPU when playing fullscreen games :-)
HSDPA is not recognised in 2.6.28, however in 2.6.30, kernel sees the USB device. I have not investigated the matter further, having no spare SIM card. I am connecting either via Huawei 220 USB dongle (works perfectly) or bluetooth via my phone (works perfectly, but I have to issue hcitool scan at the beginning of the first connection, otherwise the phone won't be found, despite being already paired). 3g via bluetooth takes by ~10% less battery power than via USB.
You can install Ubuntu lpia packages (they are optimized for the Atom processor), e.g. from https://launchpad.net/ubuntu/karmic/lpia, they perform faster than stock debian i386 packages. However, you have to force their install: dpkg -i --force-architecture package.deb, because lpia is considered a different architecture.
lpia version of rxvt-unicode-ml definitely feels snappier. Calculating simple function (l(f(2000), where f is a recursively defined factorial) went down from 12 seconds with stock debian unstable bc to 8 seconds for the lpia version (bc_1.06.94-3ubuntu1_lpia.deb), but increased up to 20 seconds (!) with bc_1.06.94-3.1_lpia.deb.
So at the end I installed libdrm-poulsbo1_2.3.0-0ubuntu1~904um1_lpia.deb linux-backports-modules-2.6.28-11-lpia_2.6.28-11.11_lpia.deb linux-headers-2.6.28-11-lpia_2.6.28-11.41_lpia.deb linux-image-2.6.28-11-lpia_2.6.28-11.42_lpia.deb psb-modules_4.40-0ubuntu1~904um1_lpia.deb rxvt-unicode-ml_9.06-1_lpia.deb wireless-crda_1.7_lpia.deb xpsb-glx_0.18-0ubuntu1~904um1_lpia.deb xserver-xorg-video-psb_0.31.0-0ubuntu1~904um1_lpia.deb xpsb-glx_0.18-0ubuntu1~904um1_lpia.deb and xserver-xorg-video-psb_0.31.0-0ubuntu1~904um1_lpia.deb. Installing the kernel significantly improved time of resuming from suspend to RAM. (Display initialisation was much faster). Though that probably has nothing to do with gcc optimisation.