Linux Graphics Library

This article is basically for person who is facing challenges regarding real world graphics performance on embedded system. It is very difficult to choose between  x11 linux graphics library and framebuffer .

Overview

x11 and framebuffer are graphics technology widely used on Linux system. In embedded system graphic performance is very critical consideration in product design.

x11 is graphic library which provides framework for UI programming, screen interaction with mouse and keyboards.   x11 works with client-server architecture. Protocol is simple and optimized, generally used via Xlib or Xcb.

Linux framebuffer (fbdev) is graphic hardware independent abstract layer for UI programming.

Some more information on x11 and framebuffer in Qt framework perspective

In addition to the more common usage of Qt on the desktop, Qt is also great for developing apps to run on embedded Linux devices. The term “embedded Linux” here basically just refers to a device running Linux without an X11 server. Instead of painting via X11, Qt when built for embedded Linux draw directly onto the framebuffer.

Source  https://wiki.qt.io/Qt_for_Embedded_Linux

Real World Scenario

Performance is the key parameter in Embedded system. I would like to address simple comparison between x11 and framebuffer . Lets see which one is suitable for particular application.

Case 1:  HMI(Human Machine Interface) Web Browser (Thin Client) using framebuffer and x11

Operating System – Linux Yocto with framebuffer and x11
Backend Framework – qtwebengine
CPU – iMX6 Solo based     –i.MX (Innovative Multimedia eXtension ) from NxP
Frequency – 1GHz
RAM – 1GB DDR3
eMMC (Storage) – 4GB

i.MX SoLo Block diagram  Source : i.MX6 SoLo Product Page

FPS (frame per second) performance on test HTML page

So basically  we are accessing html pages on web server and checking the performance .

Framebuffer – 32 FPS  ( Running at 32 frames per seconds )
X11 – Browser failed to load due to heavy graphics.

For framebuffer its 32 FPS and its very good in embedded system. But for x11, even browser failed to load the page so we can not measure FPS in this case . Now you understand how it’ll impact on real world application. For framebuffer, its benchmark performance but for x11, even you cannot able to load the HTML pages.

Case 2: HMI Graphics Library Application

Operating System – Linux Yocto with x11
Graphics Engine – Qt
CPU – iMX6 UL
Frequency – 580 MHz

RAM – 512MB DDR3
eMMC (Storage) – 4GB

i.MX  UL  block diagram Source : i.MX 6 UltaLite Product Page

In case 1, we noticed graphic acceleration is in the Multimedia section of SoC itself. Qt uses GPU for better performance and it is recommended to use HW with GPU. However one can port Qt where GPU is not supported in HW  as in the case of  iMX6 UL. Here due to absence of GPU(Graphics Processing Unit) in iMX6 UL platform, Qt is not supported for framebuffer.

So, for x11  graphics ,  performance is at acceptable level and FPS is around 8 to 9 for test application. Also, for typical HMI application, performance is acceptable level but when your application included with heavy graphics then performance may degrade.

Verdict

For embedded Linux, undisputed platform would be framebuffer for its benchmark performance but for some light weight application, x11 is also good choice.

References

https://elinux.org/X11
http://ijiset.com/vol4/v4s3/IJISET_V4_I03_30.pdf
https://shareknowlege29.wordpress.com/2018/08/12/linux-embedded-platform-qtwebkit-or-
qtwebengine/

https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i.mx-applications-processors/i.mx-6-processors:IMX6X_SERIES

https://www.nxp.com/docs/en/brochure/FLYRIMXPRDCMPR.pdf

Author      Pravin Yadav 

C++, Linux/Windows Embedded Developer

B.Tech. (Electrical, Electronics and Communication Engineering

Thanks for reading till end. If you liked it, Please share in your network.

Have a look at Embedkari Low Cost Products 

You may  find interesting topics at HowTo

Also subscribe  Embedkari for other interesting topics.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.