Channels

Services

Kernel Log: Coming in 2.6.34 (Part 3) - Graphics

by Thorsten Leemhuis

The AMD and Intel graphics drivers now support a wider range of chips and make better use of power saving features on the older chips. A major revamp of the recently introduced KMS driver for NVIDIA graphics hardware means that the Nouveau driver for X.org will in future make use of kernel-based mode setting.

Having renamed Linux kernel 2.6.34-rc5Sheep on Meth, late last week Linus Torvalds released the sixth pre-release version of Linux 2.6.34. The rate and scope of changes is, as usual at this stage in the development cycle, slowly declining, but, apart from a vague suggestion that 2.6.34 is close to completion, Torvalds has given no indication of when it will be released – expectations are that it will be out in one to three weeks.

The Kernel Log will continue its reporting on the changes in 2.6.34 – this article, Part 3 in the "Coming in 2.6.34" series looks at changes to the code for supporting graphics hardware. Parts one and two were devoted to the major changes in the network support and file system fields.

AMD

One of the changes with the greatest long-term significance is likely to be the merger of patches which add rudimentary support for the Evergreen/R800 graphics chip to the Radeon DRM driver responsible for kernel-based mode setting (KMS). This will allow the kernel to address many of the Radeon HD-5000 series graphics cards introduced since the autumn which use this graphics chip. The driver doesn't at present make use of the acceleration features offered by these GPUs, but the drivers for older Radeon graphics hardware also started out this way, and they now do a pretty fine job.

From 2.6.34, the KMS driver for older Radeon GPUs will be able to activate some of the dynamic power saving features offered by Radeon hardware. Many other enhancements in this area are in preparation for forthcoming versions of the kernel. In order to protect against malicious code, the Radeon DRM driver will in future check that commands forwarded to the graphics chip are legitimate.

Intel

The Intel KMS driver in 2.6.34 will already support the graphics cores known only by the codename Sandybridge, which Intel is expected to release early next year. The driver now activates memory self-refresh on Intel 9xx series chip-sets when the CPU goes into deep sleep mode. According to the commit comments, this reduces power consumption on an idling netbook containing the 945GSE chip-set by 0.8 Watts.

The kernel can now adjust the clock speed of 'Ironlake' graphics cores used in Intel i3 and i5 core series CPUs. This function is also required to turbo boost the graphics core clock speed above the nominal speed on the mobile version of these processors. However, further changes required to be able to use the intelligent power sharing feature are currently in development.

NVIDIA

The Nouveau driver for GeForce graphics hardware now includes everything you need to dynamically generate open source firmware for NV50 GPUs on demand, so that 8xxx, 9xxx and GTX2x0 series GeForce graphics chips will now run without the controversial ctxprogs, generated using proprietary graphics drivers. Other major rejigging of the driver means that the Nouveau driver for X.org for Linux 2.6.33 will not work with the 2.6.34 kernel and nor will the reverse combination. This kind of incompatible change to driver interfaces with userspace is not normally permitted, but, kernel hackers have decreed, is acceptable in this case because Nouveau is still a staging driver. The Nouveau development team has nonetheless been forced to endure a torrent of criticism from Torvalds on the Linux kernel mailing list. He is particularly concerned that the change makes it harder for testers to switch between different kernel versions in order to find out when a particular bug arose.

One of the reasons for adapting the API was the removal of a number of interfaces which the X.org driver relied on for non-KMS operation. Because the development team has also removed their counterparts for user mode setting (UMS) from the development branch of the X-org driver, KMS will from now on be compulsory for Nouveau – just as it is for the latest version of the graphics driver for Intel GPUs. The latest versions of the Radeon X.org driver all still contain UMS code, but this too is likely to be removed at some point in the future.

Switching

On some laptops equipped with both onboard graphics and a separate graphics chip, the kernel can now switch between the two and switch off whichever is not being used in order to save power. 'VGA Switcheroo' currently only works on some laptops and does not offer the ease of use of Windows, as it only switches when X Server is restarted – something which is not expected to change in the near future. Background information on VGA Switcheroo can be found in several old blog postings by Dave Airlie (1, 2, 3, 4, 5).

Minor gems

Many further minor, but by no means insignificant, changes can be found in the list below, which contains the commit headers referring to the respective change. Like many of the references in the text above, the links point to the relevant commit in the web front end of the Git branch for the kernel sources maintained by Linus Torvalds at kernel.org. The commit comments and the patches themselves provide extensive further information on the respective changes.