Showing posts with label Xorg. Show all posts
Showing posts with label Xorg. Show all posts

Monday, 9 June 2008

U810 Xorg Munging Part 2

XRandR is a valuable feature for laptop and especially tablet users. It handles on-the-fly reconfiguration of Xorg including multiple screens, resolution and orientation changes. This, then is how we get internal/external monitor switching and screen rotation in response to system events (screen swivel etc.) and button presses (Fn A on the U810). Quite how we acquire these non-standard events and presses I will leave till later (if ever!) as these can always be invoked by more conventional methods.

The first thing to do is ensure that the Xorg driver allocates enough screen real-estate to handle multiple monitors. Apparently, the Intel embedded graphics can only handle 2048x2048 pixels with 3D accleration enabled so that's what I'll use - I like my compiz toys!

Open up /etc/X11/xorg.conf in your favourite editor and add the following to each SubSection "Display" within the Section "Screen".

Virtual 2048 2048

Actually, only the 24-bit depth really matters since I'm not likely to use the lower bit depths.

Now, dropping to a shell we can run xrandr and see what it thinks we have...

Screen 0: minimum 320 x 200, current 1024 x 600, maximum 2048 x 2048
VGA disconnected 1024x600+0+0 (normal left inverted right) 0mm x 0mm
1024x600 57.7*
LVDS connected 1024x600+0+0 (normal left inverted right) 0mm x 0mm
1024x600 57.7*+ 60.0 60.0 60.0 60.0
800x600 60.3 60.0 56.2
768x576 60.0
640x480 59.9 60.0
VGA-1 disconnected (normal left inverted right)
TV disconnected (normal left inverted right)
Looks like the VGA output is tied to the screen (which is the LVDS one) and we don't have TV out so let's disable these in xorg.conf. Add the following sections...

Section "Monitor"
Identifier "VGA"
Option "Ignore" "True"
EndSection

Section "Monitor"
Identifier "TV"
Option "Ignore" "True"
EndSection

Once we've plugged in an external monitor using the dock or the dongle we can run xrandr and see that the spurious VGA and TV settings have gone. Now we can do things like...

xrandr --output VGA-1 --mode 800x600 --right-of LVDS
xrandr --output VGA-1 --mode 1024x768 --same-as LVDS
xrandr --output VGA-1 --mode 1024x768 --below LVDS

Which gives us, respectively, a long desktop 1824x600 across the two monitors, mirrored outputs (though the U810 screen only shows the top 600 pixels), and a tall desktop 1024x1368. And we can also turn the LVDS off (--output LVDS --off, strangely enough!) and use just the external monitor which gives us the basic mechanism for laptop display switching.

It turns out the LVDS output on Intel graphics is actually the secondary screen so when you plug in an external monitor it becomes the primary screen so KDE puts the toolbar there and OpenOffice Impress needs to be used carefully in dual monitor mode.

Now logically, we should look at the --left, --right and --invert options which allow screen rotation on a tablet PC but unfortunately there is a bug in the current xorg Intel driver that causes screen updates to stop after changing orientation. There is a patch available so hopefully it will make it to the OpenSuSE repositories soon.

Wednesday, 4 June 2008

U810 Xorg Munging Part 1

Xorg is going to need quite a bit of work so first of all lets just get it working at the right resolution with compiz-fusion (I'm assuming you know what this is and want it!). The installer does a reasonable job of autodetecting except that it gets hung up on 1024x768 instead of 1024x600 - you can set it right with SaX2 but there are another couple of places that need prodding to get the resolution to stick for good without resorting to 915resolution.

  1. boot/grub/menu.lst - ensure that the boot parameters say vga=normal so we don't get the framebuffer in a silly mode
  2. /etc/sysconfig/displaymanager - change the line at the end of the file to DISPLAYMANAGER_RANDR_MODE_auto=
    "1024x600 48.96 1024 1064 1168 1312 600 601 604 622 -HSync -VSync"
Now for compiz-fusion, first of all we need to get the Intel Xorg driver into AIGLX mode, then install compiz-fusion. Sathya Says has an explanation that pretty much matches what I did although I didn't have to do the one-click-install of compiz-manager - that seemed to come with the compiz-fusion install anyway.

The final bit is to start compiz-manager automatically - for some reason, Settings|KDE Components|Session Manager won't let me change the preferred windows manager from kwin. For each user you thus need to:
  1. cd ~/.kde/Autostart
  2. ln -s /usr/bin/compiz-manager
Now go and play!

A couple of gotchas...
  • Updating the system has once resulted in the reversion of the displaymanager edit above.
  • Running SaX2 seems to nobble the AIGLX setting in xorg.conf
  • In /usr/bin/compiz-manager my COMPIZ_OPTIONS were prepended by -- rather than - so I went along with that.