This paper first provides an overview of the Linux graphical areas of infrastructure, and then describes some of the available for embedded Linux systems use advanced graphics libraries, and graphic user interface support system.
Hope on the development of embedded Linux systems. 1Linux graphics area infrastructure this section first describes the Linux graphics field of the common infrastructure. It is called infrastructure, because the system (or library) General as other advanced graphic or graphics applications of basic functions. These systems (or functions) including: XWindow, SVGALib, FrameBuffer, and so on. 1.1XWindow lift graphics on Linux, many people first think of XWindow. This system is currently the class of UNIX systems is in control of the position of desktop graphics system. There is no doubt that the XWindow as a graphical environment is successful, it runs including CAD modeling tools and Office suite, a large number of applications. But it must be noted that, due to XWindow in system interface reasons, limit its games, multimedia support. Users running on the XWindow VCD players, or run a large 3D games, often find the same hardware configuration, but cannot access and Windows operating systems the same graphic effects-even with the acceleration of the XServer, its effect is not satisfactory. In addition, large applications (for example Mozilla browser) is running on the XWindow responsiveness is quite satisfactory. Of course, here is the Linux kernel in the process of scheduling problems, or have the XWindow. XWindow in order to meet the needs for games, multimedia applications on graphics acceleration capability requirements, provided the DGA (direct graphics access) extended through the extensions, applications can be in full-screen mode to directly access the frame buffer to display card, and can provide some acceleration support. 1.2SVGALib SVGALib is Linux system first appeared in the non-X graphics support library. This library was originally on standard VGA compatible chip support, has been developed to support older SVGA chip as well as on today's popular advanced video chip support. It provides users on the console to graphical programming interface that lets the user PC compatible system to easily access graphics support. But the system has the following shortcomings: 1) interface clutter. SVGALib development from initial vgalib, retained the old system of many interfaces, and these interfaces are not good to meet new display chip graphics capabilities. 2) failed to better hide hardware details. Many operations, you cannot automatically use display chip acceleration support. 3) portability. SVGALib is currently only runs on x 86 platforms, on the other platform support is poor (except for the Alpha platform). 4) develops slowly, there are other possible graphics library instead. SVGALib as an old graphics support library, current applications, particularly in the Linux kernel FrameBuffer driver support has been added, have gradually been replacing other graphics libraries. 5) on application of the support is poor. SVAGLib as a graphics library, on the advanced graphics features, such as lines and curves, and so on, are not satisfactory. Although there are many disadvantages to SVGALib, but often other SVGALib graphics library used to initialize the display mode of a particular chip and get mapped into process address space linear display memory first address (i.e. the frame buffer), and other interfaces are rarely used. In addition, SVGALib in areas such as keyboard, mouse and joystick interface, it is rarely used by other applications. Therefore, the use of SVGALib, the author does not recommend users to use the graphics library. Of course, if the user's display card only supports the standard VGA mode, SVGALib still a better choice. 1.3FrameBufer FrameBuffer is appears in the kernel which 2.2.xx a driver interface. This interface will display device abstraction to frame buffer. Users can be regarded as a image display memory, map it to the process address space, you can directly read and write, and write operations can be immediate reaction on the screen. The driver of the device files are generally/dev/fb1/dev/fb0, and so on. For example, suppose the current display mode is 1024x768-8-bit color, you can use the following command to empty screen: $ ddif =/dev/zeroof =/dev/fb0bs = 1024count = 768 in your application, usually by the FrameBuffer device mapped into process address space use, such as the following program will open the/dev/fb0 equipment, and carried out by mmap system call, then use the address mappings will screen empty memset (it is assumed that the display mode is 1024x768-8-bit color mode, linear memory mode): intb; unsignedchar*fb_mem; fb=open(“/dev/fb0”,O_RDWR); fb_mem=mmap(NULL,1024*768,PROT_READ|PROT_WRITE,MAP_SHARED,fb,0); memset(fb_mem,0,1024*768); FrameBuffer device also provides some IOCTL commands, these commands, you can get some fixed display device information (such as display memory size), and display mode related variable information (such as to distinguish theRate, pixel structure, the number of bytes per scan line width), and a pseudo color mode palette information etc. Through the FrameBuffer device, you can get the current kernel support accelerated graphics card type (information through seated), this type is typically associated with a specific display chip. For example, at present the most recent kernel (2.4.9), it contains on S3, Matrox, nVidia, 3Dfx, and so on popular display chip acceleration support. To access the acceleration chip type, the application can use a PCI device memory I/O (memio) mapped to the process's address space. These memio is commonly used to control the display card registers, through the operation of the register, the application can control the specific video acceleration. PCI devices you can add your own control registers are mapped to physical memory space, then, to access these control register, to become a physical memory access. Therefore, these registers is also known as "memio". Once they are mapped to physical memory, the process of ordinary Linux through the mmap will these memory I/O mapped into process address space, so you can directly access these registers. Of course, because different display chips with different acceleration, on the use and definition memio are different, then you need to accelerate chip of different types to write different acceleration. For example, the majority of chip provides on the rectangle's fill of hardware acceleration support, but a different chip implementation in different ways, in this case, the need for different chip type to write different used to complete the function fills the rectangle. Here, the reader may already be aware of the FrameBuffer only a display memory and display chip registers from physical memory mapped to the process address space. Therefore, applications, if you want the FrameBuffer graphics programming on top, you also need to complete a variety of other work. For example, the FrameBuffer, like a piece of canvas, what kind of brush is used, how to draw, you also need you to help yourself. 1.4LibGGI LibGGI trying to establish a general graphics interface, and the abstract interfaces together with the associated input (mouse, keyboard, joystick etc.) together with an abstract interface, you can easily run in XWindow, SVGALib, FrameBuffer, and so on. Built on top of application LibGGI, without recompilation, can these underlying graphical interface. But somehow, LibGGI development almost to a standstill. 2Linux graphics area senior library 2.1Xlib and other related functions in the XWindow system graphics programming, you can choose to work directly with the Xlib. Xlib actual is on the underlying X protocol encapsulation, you can use this function library for General graphics output. If your XServer DGA support, you can access directly through the DGA extension display device to speed up the support. For most users, since Xlib interface is too primitive and complex, and therefore the General graphics program select other advanced some of the graphics libraries as a basis. For example, GTK, QT, etc. These two functions at the same time or some advanced graphical user interface support functions. For various reasons, GTK, QT, etc functions in a huge stock, consume system resources more problems, not suitable for use in embedded systems. At this point, you have the option of using FLTK, this is a lightweight graphical libraries, but its main feature set in the user interface, provides a rich set of controls. 2.2SDL SDL (SimpleDirectMediaLayer) is a cross-platform multimedia game support library. Which contains graphics, sounds, joysticks, thread, etc., now you can run on many platforms, including the XWindow, XWindowwithDGA, LinuxSVGALib LinuxFrameBuffer console, as well as WindowsDirectX, BeOS, etc. Since SDL specifically for gaming and multimedia applications development, so it is very good for graphics support, especially the advanced graphics capabilities, such as Alpha blending, transparent, YUV overlay, Gamma correction, and so on. But in the SDL environment can very easily add support for OpenGL in Mesa library, which provides a 2-d and 3-d graphics support. It can be said that the SDL is to write cross-platform games and multimedia applications platform, has indeed been widely applied. Related information, see http://www.libsdl.org. 2.3Allegro Allegro is a specialized design for x 86 platform game graphics library. The initial Allegro run in DOS environment, which can be run in LinuxFrameBuffe console, LinuxSVGALib, XWindow system. Allegro offers rich graphics capabilities, including the rectangle's fill and spline curve generation, and so on, and a fairly good display of three-dimensional graphics. Because many of the key Allegro is a compilation of code written in the function library has run faster and consume fewer resources. However, there are disadvantages to Allegro: 1) on the thread's support is poor. Allegro's many functions is a non-thread-safe, you cannot at the same time in two or more threads. 2) to the hardware acceleration support, are designed to provide for hardware acceleration. For further information about Allegro, see http://www.allegro.cc/. 2.4Mesa3D Mesa3D is a compatible OpenGL specification of open source libraries, is now on LinuxWith professional 3D graphics support, the only choice. Mesa3D is also a cross-platform libraries that can run on the XWindow, XWindowwithDGA, BeOS, LinuxSVGALib etc platform. For further information about the Mesa3D, see http://www.mesa3d.org/. 2.5DirectB DirectFB is focused on an accelerated LinuxFrameBuffer graphics library, and trying to establish a compatible with GTK GUI for embedded systems. It can mount function library situation provides accelerated FrameBuffer driver support. At present, the
No comments:
Post a Comment