Xgl
Xgl is an X server architecture layered on top of OpenGL. It is at an early stage in development and a number of important pieces are still missing. Xglx is the only server currently available that uses this architecture. It requires an already existing X server, and is only intended for testing and development.
Xegl is a new server based on the Xgl architecture. It runs on standalone OpenGL with the EGL extensions.
Technical Features
Layering X on OpenGL and using a composited desktop opens the door to new features and opportunities. The following are examples of new things which will be possible (a few of which are working today). We'd like to dispel the myth that X on OpenGL is only good for eye candy.
- Decouple window resolution from display resolution. Applications may render windows at a particular resolution, but may be seen on-screen at a different resolution. Consider a background/root gradient. Such a window (texture) may only be a few pixels in size but appear at 1600x1200 or larger.
- Fast, simple screen rotation/flipping/panning/magnification.
Advanced font rendering, including on-the-fly outline font rendering using textures and fragment programs (see http://www.loria.fr/~levy/publications/papers/2005/VTM/vtm.pdf).
- Simulated hardware overlay planes. This long-time workstation graphics feature could be implemented with texture compositing.
- Full-screen color manipulation, including gamma correction, contrast enhancement, dimming/brightening, etc.
- Mixed pixel depths on one screen. Redirected, top-level windows could all have different color depths (8, 16, 24, 32bpp). For example: XTerms may be created with 8bpp (requiring 1/4 the texmem of a 32bpp visual) and displayed with a color-lookup table (fragment program texel lookup).
- Arbitrary per window colormaps (fragment program texel lookup)
- Alternate window color spaces. "video" windows may be stored as YCbCr (smaller than RGB) and converted to RGB on the fly when displayed using texture hardware.
- Window image compression: Use S3TC texture compression to compress windows whose contents seldom change. Best use would be the desktop background stored in the root window. Potentially big memory savings.
- New opportunities for antialiased X rendering with OpenGL multisampled surfaces.
TODO
Item |
Description |
Contact |
Complete |
General |
General Xgl and glitz development |
70% |
|
GLX |
Accelerated indirect GLX rendering |
90% |
|
XV |
YUV surface formats in glitz and YUV pictures in server |
80% |
|
RandR |
Resize support |
- |
100% |
Xagl |
Server running on MacOS (AGL) |
- |
50% |
Xwgl |
Server running on Windows (WGL) |
- |
0% |
Server running on EGL |
60% |
CVS Access
$ cvs -d:pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg login CVS password: <hit return> $ cvs -d:pserver:anoncvs@cvs.freedesktop.org:/cvs/xorg co -r xgl-0-0-1 xserver
Xgl code can be found in hw/xgl sub-directory.
Current Installation Instructions
The most current instructions for getting Xgl and Compiz up and running can be found on the openSUSE wiki.
Build Xgl and compiz from source
prerequisites: Mesa 6.5(CVS HEAD), cairo glitz(CVS HEAD), gnome control-center 2.14 (for compiz gnome-window-decorator) misc GNU Development Tools (automake autoheader autoconfig etc), intltool, libstartup-notification-1.0 (OpenSuSE packages this in startup-notification-devel-0.8.39) and more?... (please add)
Some suggested configure options for building xgl and glitz can be found here, that may prove useful. The above suggestions and general instructions are included here as well with some extra information for your convenience.
Fetch source code from CVS
Create a folder where you'll place the source codes. Let's say:
$ mkdir -p ~/CVS $ cd CVS
login
$ cvs -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/xorg login CVS password: <hit return>
cairo glitz
$ cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/cairo co glitz
Mesa
$ cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/mesa co Mesa
compiz
$ cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/xorg co app/compiz
xserver xgl branch
$ cvs -z3 -d:pserver:anonymous@anoncvs.freedesktop.org:/cvs/xorg co -r xgl-0-0-1 xserver
Build components
optional preparation
You may want to create symbolic links of the source files by using "lndir" to some temporary folder and do the build there. This way the source directories will be kept 'clean' and you can maintain different builds using the same source tree. Also you can apply patches to the symlink directory without effecting the original source tree! e.g.
$ cd /tmp $ mkdir glitz $ cd glitz $ lndir ~/CVS/glitz
lndir, which is available in most distributions and can also be found in xorg's source tree, makes symbolic links of the files but not the directories, which instead re-creates in the destination folder. Thus the compilation output files are stored in the temporary folder rather than the source folder.
optional optimisation flags
Better performance may be achieved if compiler optimisation options, suitable for the target architecture, are used. Use the environment variables CFLAGS and CXXFLAGS for this. e.g. (for pentium-m CPU)
$ export CFLAGS="-O3 -march=pentium-m -mtune=pentium-m -pipe -fomit-frame-pointer -ffast-math" $ export CXXFLAGS=$CFLAGS
The following instructions assume that appropriate symbolic links for all source trees have been made in /tmp folder. Also /opt/Xgl is used as the installation folder. Change as required if that's not the case.
build cairo glitz
$ cd /tmp/glitz $ ./autogen.sh --prefix=/opt/Xgl $ make $ sudo make install
build Mesa (static library)
$ cd /tmp/Mesa $ echo "MKLIB_OPTIONS = -static" >> configs/linux-indirect $ make linux-indirect
build compiz
$ cd /tmp/compiz $ PKG_CONFIG_PATH=/opt/Xgl/lib/pkgconfig ./autogen.sh --prefix=/opt/Xgl --with-gl-libs="/tmp/Mesa/lib/libGL.a -pthread -ldrm" $ make $ sudo make install
build xgl xserver (with DPMS support)
$ cd /tmp/xgl $ PKG_CONFIG_PATH=/opt/Xgl/lib/pkgconfig ./autogen.sh --enable-xgl --disable-xorg --disable-xprint --enable-glx --enable-dri --with-mesa-source=/tmp/Mesa --with-release-snap=1 --disable-xvfb --disable-xnest --enable-xglx --enable-xkb --disable-kdriveserver --prefix=/opt/Xgl $ make $ sudo make install
Test that everything works fine (for gnome desktop)
Assuming the above build sequence ends without errors, you may first want to test everything works before making xgl and compiz your default configuration.
run xgl server
$ /opt/Xgl/bin/Xgl :1 -ac -accel glx:pbuffer -accel xv:pbuffer&
or
$ /opt/Xgl/bin/Xgl :1 -ac -accel glx:pbuffer -accel xv:fbo &
depending on your graphics card (experiment with these options to see which combination is more suitable for you). If you get errors here or you find out later that performance is bad, the following might help:
$ LD_PRELOAD=/usr/lib/libGL.so /opt/Xgl/bin/Xgl :1 -ac -accel glx:pbuffer -accel xv:pbuffer&
where /usr/lib/libGL.so is your installed opengl driver that works well with your default Xorg xserver. If Xgl fails due to missing fonts, use the font path option "-fp" and point to your "misc" fonts directory.
$ /opt/Xgl/bin/Xgl :1 -ac -accel glx:pbuffer -accel xv:pbuffer -fp /usr/share/X11/fonts/misc&
Where path "/usr/share/X11/fonts/misc" may vary depending on your distribution.
run compiz
$ DISPLAY=:1 /opt/Xgl/bin/compiz decoration wobbly fade minimize cube rotate zoom scale move resize place switcher&
run gnome-window-decorator
$ DISPLAY=:1 /opt/Xgl/bin/gnome-window-decorator&
run a terminal or nautilus if you like
$ DISPLAY=:1 /usr/bin/gnome-terminal&
If everything works fine you should now have a wobbly terminal
27 April 2006
Last updated 19 September 2007 by Call Me K


