Performance of Window System in Embedded Linux

Source: Internet
Author: User
In the current embedded Linux environment, the architecture is dominated by arm, and the analysis here will also be dominated by ARM chips.
In the ARM architecture, the GPU itself has no video memory, and it reserves a part of the system memory for the GPU, so that the CPU, GPU, and LCD are connected to the memory through the AHB Bus.
In this way, the LCD periodically obtains data from the display memory, occupying the bandwidth of the bus. Its impact on performance is described in another article.
To display a picture without blinking, we usually first draw this picture in the memory and copy it to the copy video memory. This involves writing a screen of memory, the reading of one screen memory and writing of one screen memory greatly occupy the system memory.
When the resolution of the device increases, the data volume on each screen also increases sharply, and the bus will inevitably become a performance bottleneck.

Next we will compare the architecture of embedded devices and PCs.
1. In the current embedded device, the bus width is 32 bits, while in the PC device, the bus width is 64 bits.
2. For embedded devices, SDRAM is generally used. Currently, DDR is also used, and the bus frequency is generally lower than 133 MHz. in PC, DDR and DDR2 memory are widely used, its memory bus frequency is much higher.
3. In embedded devices, the CPU cache is generally small, while the PC cache is much larger.
4. LCD periodic refresh occupies the memory bus. in PC, if a built-in graphics card is used, LCD refresh occupies the memory bus. If an independent graphics card is used, LCD refresh does not occupy the memory bus.
5. The screen resolution of embedded devices is generally small, which is advantageous. The resolution of a PC is generally large.

In this regard, the current ARM chip cortex-a8 has reached 1 GHz, it should be said that the clock speed is not a problem, its architecture determines in support of high-resolution equipment, its bus will become a bottleneck.
Some methods can be taken on the software to reduce the memory bus usage.
1. Use the dual buffer mechanism in the graphic system, so that we do not have to write the memory when generating a screen, and then copy it to the video memory. You can directly write it to the video memory.
2. Reduce the LCD refresh frequency.
3. Use the thumb command to increase the code density and reduce the time that the Code occupies the bus.
4. When writing memory, it is best to fill up 32 bits at a time to make full use of the bus width.
5. Use registers as much as possible and use less memory. Replace large memory with computing-intensive.

Linux desktop systems have always been very inefficient. Especially for Embedded window systems, QT/E is relatively large, but mature, but it is costly for commercial use. Directfb may be faulty when supporting multiple processes. Although GTK + XWindow is free of charge, it is inefficient.
In Windows, the window system is built into the operating system. In this way, the process Displays bitmaps, or the window location can be obtained only by the system call. In XWindow, inter-process communication occurs. Frequent drawing operations will inevitably lead to frequent inter-process switching, resulting in low system efficiency.
Linux has always been proud of the fact that if the graphics system crashes, the kernel is still normal and it has always used this to laugh at windows. However, for Embedded Linux devices, if the graphic system crashes, the kernel is normal and meaningless. Therefore, it is feasible to load some Windows systems in Linux into the kernel in the form of modules.

There is another problem that seriously limits the system performance.
For example, to draw a line, if I want to use the Hard acceleration feature of the GPU, it is necessary that the area to be drawn must be in the video memory, and the GPU does not know the virtual memory, in this way, the graphics system is separated between the CPU and GPU.
If we apply for memory directly in the video memory when using the window system, we can use the GPU Hard acceleration function. However, embedded devices must reserve a lot of memory for the graphics system, this part of memory cannot be used by applications and will inevitably lead to a waste of resources.
As a result, although the GPU has many capabilities, it is not applied in most Windows systems.

The root cause of this phenomenon is that the GPU does not know the virtual memory. The CPU has dedicated memory management, but the GPU does not. However, as more and more CPUs are integrated with GPU functions in embedded devices, it is impossible for GPUs to recognize virtual memory. At that time, the window system will be easier to use the GPU hardware acceleration function. When the GPU processes the video memory in parallel, the memory bus will become a bottleneck.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.