
INFORMATION TECHNOLOGIES 217 VISUALIZATION OF GRAPHIC INFORMATION IN THE GENERAL-PURPOSE OPERATING SYSTEMS Konstantin V. Pugin, Kirill A. Mamrosenko, Alexander M. Giatsintov Scientific Research Institute of System Analysis of the RAS, Center of Visualization and Satellite Information Technologies, https://niisi.ru Moscow 117218, Russian Federation [email protected], [email protected], [email protected] Abstract. Article describes solutions for developing programs for interaction between Linux operating system and display controller. Operating system architecture encourages creating a driver — component, which task is to perform interaction of hardware controller and OS kernel with the use of many protocols. The development of drivers for the open source OS is difficult due to continuous changes in the structure of the kernel, which breaks backward compatibility frequently. Several approaches to display controller driver development are provided in the article. Basic concepts of these drivers include Kernel Mode Setting (or KMS), meant to provide driver in the kernel and User Mode Setting, meant to provide driver in graphical server. Specific way is used for develop Linux kernel drivers - it is half-procedural, and half-object oriented. Sometimes it is called as “OOP in C”, because it is based on GNU C Language extensions usage to simulate object-oriented techniques. GNU C usage almost prevents using non-GNU compilers to build a driver. Newest concept of writing display controller driver for Linux kernel is based upon atomic mode setting concept, in modern Linux it is achieved via state concept - intermediate states of an object are stored and modified without side effects to other objects. In order to make this concept work, driver should conform to the principle “disable function undoes all effects of enable and nothing more”. Several approaches for display driver development are provided in this article, and most modern method – atomic KMS mode setting, - is described in detail. Keywords: drivers, embedded, KMS, kernel module, development UDC 004.454 Bibliography - 11 references Received 23.01.2019, accepted 05.02.2019 RENSIT, 2019, 11(2):217-224 DOI: 10.17725/rensit.2019.11.217 CONTENTS 1. INTRODUCTION 1. INTRODUCTION (217) Currently, due to the increase in the share 2. COMPONENTS OF THE GRAPHIC SYSTEM of various wearable and embedded systems, (218) it is a relevant objective to develop drivers 3. LINUX GRAPHIC SYSTEMS AND DRIVERS for them. Many embedded systems use the (2182) Linux OS, which has the support of a large 4. KERNEL MODE SETTING AND USER MODE number of processor architectures, as well SETTING. HISTORicAL BAckgROUND (219) as the support of loadable modules, which 5. OBJECT MODEL OF THE LINUX KERNEL allows the process of adding a driver to be (220) greatly simplified. 6. KMS ATOMIC DROVERS. BASIC ENTITIES On many Linux-based embedded systems, AND INTERFACES NECESSARY FOR displaying information has its own specifics. IMPLEMENTATION (221) Often, a certain embedded system requires 7. DEBUGGING DRIVER (222) the development of specialized drivers for 8. CONCLUSION (223) the applicable display controller. REFERENCES (223) RENSIT | 2019 | Vol. 11 | No.2 218 KONSTANTIN V. PUGIN, KIRILL A.MAMROSENKO, ALEXANDER M. GIATSINTOV INFORMATION TECHNOLOGIES When developing a display controller interacting with video capture devices, driver based on the Linux operating system, and specialized random access memory it is necessary to take into account a number (Graphics Double Data Rate, GDDR) of aspects related to the kernel development for use by the graphic accelerator. style, development patterns, and rapid This list of components is not mandatory, changes in the kernel interaction interface since there are graphic subsystems in which (API). There are also few documents on one or more components are missing or not the development of open-source display involved. For example, in some NVIDIA controller drivers, and are mainly limited to Optimus solutions installed in laptops, the extracts from comments in the source code on-screen display controller is not involved, files of the Linux kernel, or schemes based the entire configuration of monitor modes on them. This article will look at a modern occurs through the controller of another approach to writing a display controller driver graphics card - Intel. Only a graphics for the Linux OS. accelerator is used from NVIDIA. You can also find systems with a different combination 2. COMPONENTS OF THE of selected components of the graphics GRAPHIC SYSTEM system. Due to the need for 3D rendering, high- intensity calculation of shaders, high- 3. LINUX GRAPHIC SYSTEMS AND resolution video processing and other DRIVERS requirements of a modern user of computer The graphic system in Linux is represented systems, the PC graphic subsystem has by a graphic stack and various libraries used become significantly more complicated in in it (Fig. 1) [2]. comparison with it in the early years, and If we consider the components of the most often a modern graphic system includes Linux graphical stack from top to bottom, [1]: we can say that the vast majority of them 1. A Graphic accelerator (Graphics are designed to interact with the GPU, in Processing Unit, GPU). It is its particular: most of the Wayland and libdrm, performance that is mainly measured by fully EGL and almost completely X. Only tests and various prototype software (for a small part of DDX. (Device Dependent example, by startup of 3D applications X) (Fig. 1.) and Wayland, as well as libgbm at maximum settings or specially created interacts with the on-screen display controller. scenes), it runs the shaders using a specialized multi-threaded architecture. 2. The display controller. This part of the graphics subsystem is used to determine the modes of graphics displaying, as well as to interact with monitors (obtaining available monitor resolutions, sending a finished frame, etc.). 3. You can also find specialized chips in the graphic system for video output, for Fig. 1. Graphic stack Linux. No. 2 | Vol. 11 | 2019 | RENSIT VISUALIZATION OF GRAPHIC INFORMATION IN 219 INFORMATION TECHNOLOGIES GENERAL-PURPOSE OPERATING SYSTEMS 4.KERNEL MODE SETTING power management, and deleting the old AND USER MODE SETTING. code of the frame buffer drivers (in the era HISTORICAL BACKGROUND of tables and VBE (and for some drivers Initially, there was only user mode setting, even now), the kernel also contained a which was produced in the DDX drivers frame buffer management subsystem, which and enabled to set the mode for displaying allowed graphic output to be used without graphical information. [3] The detemination loading the graphic server for displaying was often executed through mode tables, console messages, or for drawing console and was not extensible, or it was done using programs). algorithms within a code that were unique to The first version of the KMS protocol [5] each chip. There was also a solution such as was built on the XRandR 1.2 model, which VBE (Vesa BIOS Extensions), an extension was good enough at that time to install modes for IBM PC BIOS, which allowed for some on ordinary workstations. But with the advent limited operations of installing modes with of mobile devices, the capabilities of the first its use (without writing a direct algorithm KMS specification began to be insufficient - for interacting with the graphics subsystem). in order to reduce energy consumption, the Gradually, most drivers for IBM PCs concept of unified planes was developed, switched to VBE. But VBE had some serious which was used to display video on a certain downsides: screen, to activate the hardware cursor (in the • Lack of support for multiple CRT first versions of KMS, the hardware cursor controllers (in most cases it is necessary interacted with the screen mode controller to support output from multiple graphic according to a separate protocol), and for accelerators to several displays or output other such cases. to TV). Then support for other KMS objects • Problems if there were several different was added, which allowed the gamma of the outputs (and they could be different on displayed output to be changed, the displayed the same chip series). image to be rotated directly in the driver, and • Problems of use of several different so on [6]. timers. There is one problem with all of this - for To solve these problems in 2008, an the interaction of these subsystems with the extension was accepted to the kernel [4], kernel, a large number of ioctl was required. which provided support for setting modes And when trying to interact, each device inside the kernel (kernel mode setting, or had to check every ioctl, which was very KMS). Along with the problems that this inconvenient. extension brought (such as some decrease in Due to these KMS problems on mobile the stability of the kernel due to the fact that devices, Google has developed its own the drivers are written not very properly, as interface to set modes, the Android Atomic well as the expansion of the kernel because Display Framework (ADF), for the Linux it includes many graphic drivers), there were kernel as part of the Android OS [7]. also some advantages, such as simplified Despite many advantages (atomic update debugging (because there is the entire mode of layers, ease of new drivers’ development), tuning code inside the kernel), simplified ADF had the following disadvantages: RENSIT | 2019 | Vol. 11 | No.2 220 KONSTANTIN V. PUGIN, KIRILL A.MAMROSENKO, ALEXANDER M. GIATSINTOV INFORMATION TECHNOLOGIES • There is only one update queue, and, This is how KMS introduced the concept therefore, the support of multi-screen of atomic updates. The modern driver of modes is very poor. If there were 2 the display controller must be written in the displays with different update rates, the kernel space using this concept. update rate was led to the same (most 5. OBJECT MODEL OF THE LINUX often less) one, which resulted in either KERNEL jerking at a faster display or slowing down To write a driver in kernel space, it is necessary at a slower one.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-