Ubuntu Linux - KMS - Kernel Mode Setting komputes Version 0.1 - For use with console-presenter Last modified 2010/08/02 What is a mode? Mode A "mode" is a term which consists of a combination of resolution and color depth. What is Kernel Mode Setting (KMS)? Kernel Mode Setting (KMS) = Feature that was introduced in linux 2.6.29. = = Shifts responsibility from X.org to the kernel for selecting and setting up the graphics mode = = Bulk of the graphics driver code out of the X server and putting it into the Kernel = = When X.org is initialized, it then detects and uses the mode without any further mode changes = = Included but disabled in 9.10 (KMS was in its infancy) = = Included and enabled in 10.04 = What are the benefits of KMS? Benefits of KMS = Faster booting = = High-color/resolution splash screen during boot = = Seamless transition into the X server (no black screen) = = Seamless transition between X servers = = Fast resume (no blinking text cursor) = How does KMS work? KMS Explained = Two things that know how to set the mode (1)Video BIOS and (2)Graphics Driver = = KMS only currently supported under nouveau, radeon or i915 = KMS Explained [continued] Mode is set at many different points during boot: 1 - Video BIOS sets initial mode at boot 2 - Boot loader sets mode using the Video BIOS or VBE (VESA BIOS Extensions) 3 - X server starts, sets accelerated mode using card’s native protocols KMS Explained [continued] Mode can also be set at other points: 1 - Setting between X server and VTs 2 - Resuming from suspend/hibernate 3 - Manual mode switch Known Issues = Suspend/resume = = Setting VTs = = Non-supported driver resulting in ugly 16-color low res boot = Enabling KMS at boot (9.10 - enables KMS and DRI2*) Boot parameters: radeon.modeset=1 i915.modeset=1 nouveau.modeset=1 Enabling KMS by default in 9.10: # ATI Radeon: echo options radeon modeset=1 > /etc/modprobe.d/radeon-kms.conf # Intel: echo options i915 modeset=1 > /etc/modprobe.d/i915-kms.conf # Nvidia (this should revert you to using -nv or -vesa): echo options nouveau modeset=1 > /etc/modprobe.d/nouveau-kms.conf Disabling KMS at boot (10.04 - allows X.org to manage mode switches) Boot parameters: radeon.modeset=0 i915.modeset=0 nouveau.modeset=0 Disabling KMS by default in 10.04: # ATI Radeon: echo options radeon modeset=0 > /etc/modprobe.d/radeon-kms.conf # Intel: echo options i915 modeset=0 > /etc/modprobe.d/i915-kms.conf # Nvidia (this should revert you to using -nv or -vesa): echo options nouveau modeset=0 > /etc/modprobe.d/nouveau-kms.conf How to tell is KMS is enabled in your currently running session? KMS compatible, non-intel drivers emit messages in dmesg such as: [ 15.602350] [drm] radeon defaulting to kernel modesetting. KMS compatible, intel drivers emit messages in dmesg such as: [ 2.197492] fb0: inteldrmfb frame buffer device How to tell if KMS is enabled in your currently running session? The kernel ring buffer will have a message in it showing the framebuffer device to be used. $ dmesg | egrep -i "drm|kms" [ 2.197492] fb0: inteldrmfb frame buffer device - proc/fb contains a list of frame buffer devices, with the frame buffer device number and the driver that controls it. If one of the following drmfb's are in /proc/fb any of the drmfb's are in there it's using KMS nouveaufb radeondrmfb or inteldrmfb $ grep -E '(nouveau|drm)fb' /proc/fb 0 inteldrmfb Glossary: DRI: Direct Rendering Infrastructure - The Direct Rendering Infrastructure, also known as the DRI, is a framework for allowing direct access to graphics hardware under the X Window System in a safe and efficient manner. It includes changes to the X server, to several client libraries, and to the kernel (DRM, Direct Rendering Manager). The most important use for the DRI is to create fast OpenGL implementations providing hardware acceleration for Mesa. Several 3D accelerated drivers have been written to the DRI specification, including drivers for chipsets produced by 3DFX, AMD (formerly ATI), Intel and Matrox. It is a way for X clients to send commands directly to the graphics card. Primarily used to make GLX go fast, but also involved in accelerating XvMC. All the open drivers, and many of the closed drivers, use the DRI to accelerate GLX. DRM: Direct Rendering Module - module is loaded and when a card is found. Shipped with the kernel, loads before starting X, detects cards and decides which driver will manage the device, provides 3D and modesetting for most of the drivers. XvMC - X-Video Motion Compensation, is an extension of the X video extension (Xv) for the X Window System. The XvMC API allows video programs to offload portions of the video decoding process to the GPU video-hardware.