Understanding Linux Graphics Drivers

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
nosignal
Posts: 8
Joined: Mon 07 Apr 2008, 14:07

Understanding Linux Graphics Drivers

#1 Post by nosignal »

Recently I have been wrapping my head around the complexity of linux graphics drivers, and decided to summarise my research for any reliative linux newbies that want to understand this better.
I am also getting a wiki account to put an editable version under http://puppylinux.org/wikka/TextSearch? ... ryHardware

Suggestions would be appreciated - I am sure I haven't covered everything. For starters, it has a slant towards VIA graphics.
(oh, and apologies for posting as code - the only way to retain nested bullets. But it does make urls unclickable).

Code: Select all

In order for graphics card hardware acceleration to work, four levels of support have to come together (http://en.wikipedia.org/wiki/X_video_extension):
1) The graphics card hardware has to support the required features.
2) The device driver software for the graphics card. 
3) The X server programs have to support the required features (e.g. XVideo interface).
4) The application software (e.g. video playback) has to make use of this interface.

The following 4 sections roughly address each of these four levels.

There are a number of different features that can be hardware accelerated (http://wiki.openchrome.org/tikiwiki/tiki-index.php?page=HardwareCaveats):
- 2D accel. - benefits general desktop use.
  Sometimes refers to XV - see below (but I think is more than just XV?).
- 3D accel. - benefits OpenGL (anything else?).
- XV - The X video extension. http://en.wikipedia.org/wiki/X_video_extension
  Is a video output mechanism for the X Window System. 
  Rescales video playback, performs color space conversions, 
  can be used to change contrast, brightness and hue.
- XvMC - X-Video Motion Compensation (XvMC). http://en.wikipedia.org/wiki/XvMC
  Is an extension of the X video extension (Xv) for the X Window System.
  Provides MPEG2 playback acceleration, and on some chips, MPEG4 playback acceleration.
  - ?? Does anyone know if XvMC acceleration works for Adobe Flash Video (FLVs) ?? 
    ?? Does it work for all FLV codecs (Spark, OnVP6, MP4), or just some ?? 
  Software that uses XvMC includes: MPlayer, MythTV, VLC, FFmpeg and xine.
  XvMC accelerates:  motion compensation (mo comp), inverse discrete cosine transform (iDCT), 
    and "Variable-Length Decoding", more commonly known as "slice level acceleration" (VLD).
  NOTE: some hadware does not support XvMC, but does support mo comp and iDCT (Intel and ATI). 
    These are not as good - VLD decoding offloads much more CPU load.
- Other features: Dual head, Panel, HDTV.
Each feature has to have all four levels of support workng (see above): hardware, device driver, X server and software.

VIA linux graphics drivers are a complicated area. http://wiki.openchrome.org/tikiwiki/tiki-index.php?page=The+Different+Unichrome+family+display+drivers lists that there are 6 different projects with 6 different drivers, all with their strengths and weaknesses: VIA proprietary, Xorg, OpenChrome (related to xorg), Kdrive, the Unichrome project, the XFree86 driver.
The strengths and weaknesses often include partial implementations of hardware acceleration features. For example, a driver may have 3D but not MPEG4 implemented. 
For most people, this can be reduced to 3 choices:
- Xorg - basic functionality for many chipsets, maybe more functionality, but not cutting edge. 
- OpenChrome - http://wiki.openchrome.org/tikiwiki/tiki-index.php
  - A free and Open Source video driver for the VIA/S3G UniChrome, UniChrome Pro and Chrome9 graphics chipsets.
  - is basically the Xorg driver with some experimental enhancements for 
    the community to try out before they are commited to Xorg.
  - CX700M(2) is supported,  but like all chipsets - not fully implemented:
    - 2D accel - OK. 3D accel - OK. XV - OK. MPEG2 - not implemented (up to 2048x2048). 
    - MPEG4 - not implemented. Dual head - not implemented. Panel - needs VBE.
      - ?? So OpenChrome have not implemented XvMC for any VIA hardware. Is this true ?? 
        ?? I thought I got the impression elsewhere that it would work. ??
- Manufacturer Proprietary drivers - e.g. http://www.viaarena.com/
  - VIA proprietary drivers. Contain support for most chipsets, mpeg2 and mpeg4 acceleration, 
  - but are of low quality and often unstable. Insecure - the 3D driver leaves 
    your system open for attack by malicious clients, and furthermore, 
  - applications that accelerate mpeg2 and mpeg4 must be run as root, which is a very 
    bad idea if they contain vulnerabilities (and they do). 
  - Avoid using these drivers unless you know what you are really doing! (or is a kiosk??)
  - Also, these drivers are distribution specific and a driver for different distribution 
    other than yours might not work.
  - Supports: UMA Chipset series: S3 Graphics UniChrome™ Pro IGP Series, 
    Chipset Name: CX700(M)(M2), Graphics Device ID: 3157
  - Has CX700M driver for Ubuntu 7.1. With Binary/Kernel binary. Version - 0.8, 04 December 2007
    - Work on Xubuntu too? Does it support all the hadware stuff?
  - Has CX700M driver for Debian 3.1r4/4.0, Fedora Core 4/5/6, Mandriva 2007/2007.1, 
    openSUSE 10.2 and Ubuntu 6.10/7.04 Desktop. 
    Source with documentation. Version - 0.83	07 June 2007. 
    Supports 2D, MP2, MP4, “Hardware Video Overlay

nosignal
Posts: 8
Joined: Mon 07 Apr 2008, 14:07

#2 Post by nosignal »

The main unanswered questions that have arisen from this for me are:
  • Has anyone tried the VIA proprietary drivers in Puppy Linux. Do they work and how do you get them working?
  • The OpenChrome website suggests they have not implemented XvMC for any VIA hardware. Is this true? I thought I got the impression elsewhere that it would work.
  • Does anyone know if XvMC acceleration works for Adobe Flash Video (FLVs)? Does it work for all FLV codecs (Spark, OnVP6, MP4), or just some?

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#3 Post by tempestuous »

I compiled the OpenChrome Xorg driver in early 2006 when Puppy was at version 1.08. 3D and XvMC were working perfectly with a VIA CLE266 chipset on a VIA Epia board.
http://www.murga-linux.com/puppy/viewtopic.php?t=5701
Puppy's version of Xorg has changed significantly since then, and the OpenChrome features have been integrated into the standard Xorg via driver ... but various forum members have had trouble getting Unichrome 3D to work. I seem to recall that dvw86 has had success, but his chipset is older. I think it's the newer Unichrome chipsets which are troublesome. Unichrome is currently being discussed on the forum here -
http://www.murga-linux.com/puppy/viewtopic.php?t=22933
nosignal wrote:Has anyone tried the VIA proprietary drivers in Puppy Linux.
The proprietary VIA Xorg driver has a bad reputation. The opensource Xorg driver, based on development by the OpenChrome project, is regarded as much better.
nosignal wrote:The OpenChrome website suggests they have not implemented XvMC for any VIA hardware.
Absolutely wrong. One of the major features of Openchrome development is XvMC support. You may be getting OpenChrome confused with their parent project: unichrome.sf.net. This earlier development project did, indeed, rip out XvMC support.
nosignal wrote:Does anyone know if XvMC acceleration works for Adobe Flash Video (FLVs)? Does it work for all FLV codecs (Spark, OnVP6, MP4)
XvMC acceleration currently only supports MPEG1 and MPEG2. MPEG4 support is planned, but not ready.
The original Flash Video format, Sorensen Spark, as well as the VP6, H.263 and H.264 codecs are all part of the MPEG-4 family, so all are currently unsupported by XvMC. However, this shouldn't matter for most Flash content available on the web, which is typically of modest resolution.
XvMC is particularly useful for full standard definition DVD content (720x576) and, indeed, for the latest high definition DVD content (1920x1080).

Post Reply