X.Org 6.9 / 7.0 - Next Generation X11

Next X


The first major X release for over 10 years, X11R7, has finally adopted a modular approach. X11R6.9, which uses the same codebase, is the last monolithic release for existing systems.

By René Rebe

Even as AIGLX and Xgl are making their appearance in the Linux world, the venerable X Window system is getting a new start with a new release that promises to be the biggest change in over 10 years. X Window provides the basic framework for graphics in Linux. Desktop environments like KDE and Gnome operate through X, or more specifically, X11, the reigning version of the X protocol, which has been around since 1987.

The X.org Foundation [1], a non-profit organization that has led X11 development since 2004, recently announced the simultaneous release of X11 versions 6.9 and 7.0. Both versions offer similar features. The main difference is that X11R7 comes with an all-new modular design. This modular architecture will make it easier for software developers and hardware vendors to adapt specific X11 components with minimal effect on the rest of the infrastructure. According to the X.org Foundation, "Xorg 7.0 represents a major change in the development process for X. Developers can work on individual components with less interference from unrelated changes, and users can acquire new features and bug fixes asynchronously from the main release stream. This makes it easier than ever for developers and users to participate in the growth and success of the X Window system."

In this article we'll describe some new features of X11R7, and help you take your own test drive of the latest X11 release.

What's Inside

The box titled "New Features" gives an overview of the enhancements you'll find in X11R7. The collection is comprised of over 200 individual packages. The packages can be built using the standard autoconf tools, although the order is significant. The individual packages include protocols (headers), libraries, the X server, and drivers for individual graphics adapters. The new design means that the numerous utilities and sample programs that X has gathered over the years, such as xterm, xclock, twm, xdm, xedit, or the xmh mail client, are now available separately.

The new structure gives distributions more control over the way Xorg packages are made available, while at the same time giving users the ability to update individual drivers from the source code. On the downside, more calls to configure affect the build time.

The 6.9 release still uses the imake-based build system and is designed for updating existing installations.

New Features
  • Enhanced 2D drivers: Savage, OpenBSD, and NetBSD Framebuffer support (new), Radeon (TV in and DMA operations), NV (NVidia), Via, i810 (support for i915GM/E7721/i945G), sunffb, sisusb (new), r128, Mach64, sis (XGI Chips).
  • EXA acceleration for i128, radeon, and sis.
  • Enhanced 3D drivers: Radeon R300/R400 (Radeon 9500 and later, new).
  • Enhanced XvMC support (video decompression).
  • XRender: Software fallback is not quite as slow as previously.
  • 12 bit PseudoColor and 30 bit TrueColor: more dynamic pixel formats, such as with Matrox Parhelia binary drivers for medical applications.
  • Multiseat: Support for multiple, independent keyboards and mice for multiple users on a workstation.
  • Modular build system using GNU automake and autoconf (Version 7.0 or later).

Transparency

Since the drivers with the previous version did not support graphics acceleration for the new ARGB Visuals, a slow system was what most users experienced when enabling genuine transparency. The only drivers really capable of accelerating Xrender operations were the commercial Nvidia drivers. The reason for this was the legacy XAA driver architecture. XAA (XFree86 Accelerated Architecture) focused on accelerating legacy X operations such as drawing lines, rectangles, circles of various sizes, and with various patterns and fills. It was not designed to handle today's ARGB visuals, and there was no practical or efficient way of integrating these features.

This is what prompted HP's Keith Packard to design a test X server, known as Kdrive, with an architecture that does not support classical drawing operations but focuses on the functions required by today's desktops. Packard concentrated on accelerating XRender and RGBA visuals, and on keeping the server as simple as possible. Zack Rusin from Trolltech integrated this architecture, now dubbed EXA, with the current release and provided a HOWTO on porting an XAA driver to EXA in seven simple steps [2].

EXA focuses on the topics that are important to today's desktops:

EXA ignores the numerous elements of legacy applications, such as lines and circles, all of which are accelerated by XAA.

Most programs make no use of these types of grapic elements in desktops, and the benefits of acceleration are thus minimal. Even with a driver that implements only basic EXA functionality, it should be no trouble to achieve good usability values with transparent windows on recent hardware.

Driver Support

The current Xorg release supports EXA functions for the r128, radeon, and sis drivers. You can enable this support in the "Device" section of your /etc/X11/xorg.conf file:

Option "AccelMethod" "EXA"

Check the "Enabling Composite and EXA" box. Patches for the i810, mach64, nv, savage, tdfx, and via drivers are available from [3].

The sis driver in X11R7 is the first to support XGI chips. Thanks to time-consuming hardware and vendor driver analysis, the R300/R400 generation of Radeon chips (up to Radeon 9800) now support hardware acceleration with free drivers.

XvMC, which handles hardware-based acceleration for video decoding, has been reworked in this latest X11 version, and the XRender software implementation shows some performance improvements.

Multiseat support is also new with the arrival of X11R7. Multiseat support provides the dedicated allocation of keyboards and mice to individual video outputs, which means that multiple users can now work on a single workstation. However, this multiseat feature is still experimental.

Xorg still does not support the latest X1000 generation of Ati cards. As the commercial Ati driver does not support these cards either, users are forced to resort to the Vesa driver as a workaround. However, Ati has announced that they will be offering hardware-accelerated Linux drivers for these cards in the near future.

Enabling Composite and EXA

By default, neither the composite extension, nor EXA acceleration, are enabled, as both are quite new. To use these features, you need to make two minor changes to your /etc/X11/xorg.conf configuration file. The following is required at any position within the file for the composite extension:

Section "Extensions"
    Option "Composite" "Enable"
EndSection

To enable EXA acceleration, assuming your drivers supports this feature, modify the driver section, as shown in this example for a Radeon card:

Section "Device"
    Identifier "Card1"
    Driver "ati"
    Option "AccelMethod" "EXA"
EndSection

If you do not have an EXA-capable driver at present, but do have a fast machine, you can use an intermediate layer that stores screen contents, and thus allows for fast CPU access, for improved results:

Option "ShadowFB" "true"

And if your driver does not support ShadowFB directly either, you may need to disable acceleration completely to use software rendering:

Option "NoAccel" "true"

After modifying the configuration file, don't forget to relaunch the server.

Theory and Practice

As of this writing, not all graphics adapters support transparency at high speeds - but more and more programs can use ARGB visuals. For example, the latest version of the rxvt-unicode terminal emulators uses transparency for color definitions to give users the ability to enable transparency for some display areas - typically the background. The MacOSD tool, which handles OSD displays on PPC machines, now uses transparent windows, rather than colored screenshots (Figure 1). And KDE 3.4 integrates a composite manager with the kwin window manager (Figure 2).

Figure 1: Transparent windows are now far quicker thanks to EXA.

Figure 2: KDE introduced a composite manager in version 3.4.

For Developers

Another major change is evidenced by the fact that X.org now does without a binary format for the hardware drivers. X11R7 now uses standard ELF Shared Objects (.so files). The major benefit is easier porting to new architectures and easier bug hunting. Developers previously had to patch the GNU Debugger to teach GDB the special proprietary X format before starting serious work on X driver development.

OpenGL Fever

Development has also continued on Xgl [4], Novell's OpenGL-based X server implementation. The aim is to do without 2D acceleration for modern graphics cards and to use the 3D engine for all graphics rendering tasks. This will not only facilitate development, it will also force vendors to publish stable, high-performance OpenGL drivers for free operating systems.

Red Hat is also pursuing an interest in X's new 3D features through their work with AIGLX (Accelerated Indirect GL X) [5]. AIGLX supports OpenGL for compositing. Enhancements for Xgl or AIGLX to X.org or the free Mesa3D OpenGL library often benefit both projects and have helped development progress by leaps and bounds.

Xgl and AIGLX both use an inertia effect when moving windows, allowing windows to wobble, as shown in Figure 3. Arbitrary scaling of windows is also supported. For more information, see the articles on Xgl and AIGLX in this issue.

Figure 3: Xql and AIGLX leverage OpenGL to support arbitrary window transformations.

Conclusions

The seventh major X11 release has enhanced hardware support. 3D support for the Ati R300 and R400 series finally provides an open source driver for a widespread generation of chips.

The new EXA architecture, and the composite and damage extensions introduced with the latest version, help X11R7 hold its own against commercial systems. In fact, X11R7 has a slight lead over Windows. Now it's time for the vendors to start supplying high-performance drivers, or better still, to disclose their card specifications to allow open source developers to work efficiently and speed up the bug fixing process.

X11R7 is also good news for newcomers to the world of X development. The excellent EXA HOWTO and the individual driver packages, make it easier than ever to get started.

INFO
[1] X.Org homepage: http://www.x.org/
[2] EXA in seven steps: http://lists.freedesktop.org/archives/xorg/2005-June/008356.html
[3] EXA status: http://wiki.x.org/wiki/ExaStatus
[4] Xgl: http://en.opensuse.org/Xgl
[5] AIGLX: http://fedoraproject.org/wiki/RenderingProject/aiglx
THE AUTHOR

René Rebe, who studies computer science at the TFH in Berlin, Germany, did not discover Linux until 1997. He contributes to various open source projects, such as T2 and Sane. You can contact René at <rene@exactcode.de>.