Example: dental hygienist

Linux Graphics Drivers: an Introduction

Linux Graphics Drivers: an IntroductionVersion 3St phane 15, 20122 Contents1 overview .. this book does not cover ..82 A Look at the Overview .. types .. and Physical Memory .. of a Graphics Card .. the card .. Hardware Examples .. renderers .. Renderers ..223 The Big X11 infrastructure .. DRI/DRM infrastructure ..264 Framebuffer a framebuffer driver .. operations ..323 CONTENTS5 The Direct Rendering batch buffer submission model .. sharing .. management and security ..386 a basic driver .. acceleration .. acceleration .. acceleration ..417 Video Standards .. decoding pipeline .. DCT .. Compensation .. Space Conversion.

Introduction Accelerating graphics is a complex art which suffers a mostly unjustified reputation of being voodoo magic. This book is intended as an introduction to the inner work-ings and development of graphics drivers under Linux. Throughout this whole book, knowledge of C programming is expected, along with some familiarity with graphics ...

Tags:

  Linux, Introduction, Graphics, Linux graphics

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Linux Graphics Drivers: an Introduction

1 Linux Graphics Drivers: an IntroductionVersion 3St phane 15, 20122 Contents1 overview .. this book does not cover ..82 A Look at the Overview .. types .. and Physical Memory .. of a Graphics Card .. the card .. Hardware Examples .. renderers .. Renderers ..223 The Big X11 infrastructure .. DRI/DRM infrastructure ..264 Framebuffer a framebuffer driver .. operations ..323 CONTENTS5 The Direct Rendering batch buffer submission model .. sharing .. management and security ..386 a basic driver .. acceleration .. acceleration .. acceleration ..417 Video Standards .. decoding pipeline .. DCT .. Compensation .. Space Conversion.

2 Decoding APIs ..498 OpenGL Rendering Pipeline .. processing .. processing .. processing ..519 .. internals .. in mesa ..534 CONTENTS10 Gallium Gallium3D: a plan for a new generation of hardware .. State trackers .. Pipe driver .. Winsys .. Vertex submission .. Writing Gallium3D drivers .. Shaders in Gallium ..5611 GPU Computing5912 Suspend and Resume6113 Technical Obtaining official specifications .. Reverse engineering ..6414 Beyond Testing for conformance .. Debugging .. Upstreaming ..6815 Conclusions695 CONTENTS6 Chapter1 IntroductionAccelerating Graphics is a complex art which suffers a mostly unjustified reputationof being voodoo magic.

3 This book is intended as an Introduction to the inner work-ings and development of Graphics drivers under Linux . Throughout this whole book,knowledge of C programming is expected, along with some familiarity with graphicsprocessors. Although its primary audience is the Graphics driver developer, this bookdetails the internals of the full Linux Graphics stack and therefore can also be usefulto application developers seeking to enhance their vision of the Linux Graphics world:one can hope to improve the performance of one s applications through better under-standing the Linux Graphics stack. In this day and age of pervasive 3D Graphics andGPU computing, a better comprehension of Graphics is a must have! Book overviewThe book starts with an Introduction of relevant hardware concepts (Chapter 2).

4 Onlyconcepts directly relevant to the Graphics driver business are presented there. Then wepaint a high-level view of the Linux Graphics stack in Chapter 3 and its evolution overthe years. Chapter 4 introduces framebuffer drivers, a basic form of Graphics driversunder Linux that, although primitive, sees wide usage in the embedded space. Chap-ter 5 introduces the Direct Rendering Manager (or DRM), a kernel module which is incharge of arbitrating all Graphics activity going on in a Linux system. The next chap-ter (Chapter 6) focuses on drivers and the existing acceleration APIs availableto the developper. Video decoding sees its own dedicated part in Chapter 7. We thenmove on to 3D acceleration with Chapter 8 where we introduce the basic concepts ofOpenGL.

5 Chapter 9 and 10 are dedicated to Mesa and Gallium 3D, the two founda-tions of 3D Graphics acceleration under Linux used as the framework for 3D 11 tackles an emerging field, GPU computing. Next, we discuss suspend andresume in Chapter 12. We then discuss two side issues with Linux Graphics Drivers: technical specifications in Chapter 13 and what you should do aside pure developmentin Chapter 14. Finally, we conclude in Chapter chapter finishes with the takeaways , a number of relevant points that we madeduring said What this book does not coverComputer Graphics move at a fast pace, and this book is not about the past. Obsoletehardware (isa, vlb, ..), old standards (the vga standard and its dreadful int10, vesa),outdated techniques (user space modesetting) and old X11 servers (Xsun, XFree86, ) will not be Look at the HardwareBefore diving any further into the subject of Graphics drivers, we need to understandthe graphcs hardware.

6 This chapter is by no means intended to be a complete descrip-tion of all the inner workings of your average computer and its Graphics hardware, butonly as an Introduction thereof. The goal of this section is just to cover the bases onthe knowledge we will require later on. Notably, most hardware concepts that will sub-sequently be needed are introduced here. Although we sometimes have to go througharchitecture-specific hoops, we try to stay as generic as possible and the concepts de-tailed thereafter should generalize Hardware OverviewToday all computers are architectured the same way: a central processor and a numberof peripherals. In order to exchange data, these peripherals are interconnected by a busover which all communications go.

7 Figure outlines the layout of peripherals in astandard first user of the bus is the CPU. The CPU uses the bus to access system mem-ory and other peripherals. However, the CPU is not the only one able to write andCPUS ystemMemoryGraphicsCardNetworkCard BusFigure : Peripheral interconnection in a typical A Look at the Hardwareread data to the peripherals, the peripherals themselves also have the capability to ex-change information directly. In particular, a peripheral which has the ability to readand write to memory without the CPU intervention is said to be DMA (Direct Mem-ory Access) capable, and the memory transaction is usually called a DMA. This typeof transaction is interesting, because it allows the driver to use the GPU instead of theCPU to do memory transfers.

8 Since the CPU doesn t need to actively work any moreto achieve those transfers, and since it allows better asynchronicity between the CPUand the GPU, better performance can be attained. Common uses of DMA include im-proving the performance of texture uploads or streaming video. Today, all graphicsprocessors feature this ability (named DMA bus mastering) which consists in the cardrequesting and subsequently taking control of the bus for a number of a peripheral has the ability to achieve DMA to or from an uncontiguous list of mem-ory pages (which is very convenient when the data is not contiguous in memory), it issaid to have DMA scatter-gather capability (as it can scatter data to different memorypages, or gather data from different pages).

9 Notice that the DMA capability can be a downside in some cases. For example on realtime systems, this means the CPU is unable to access the bus while a DMA transac-tion is in progress, and since DMA transactions happen asynchronously this can leadto missing a real time scheduling deadline. Another example is small DMA memorytransfers, where the CPU overhead of setting up the DMA is greater than the gain inasynchronicity and therefore transfers slow down. So while DMA has a lot of advan-tages from a performance viewpoint, there are situations where it should be Bus typesBuses connect the machine peripherals together; each and every communication be-tween different peripherals goes over (at least) one bus. In particular, a bus is the waymost Graphics card are connected to the rest of the computer (one notable exceptionbeing the case of some embedded systems, where the GPU is directly connected to theCPU).

10 As shown in Table , there are many bus types suitable for Graphics : PCI, AGP,PCI-X, PCI-express to name a (relevant) few. All the bus types we will detail are vari-ants of the PCI bus type, however some of them feature singular improvements overthe original PCI (Peripheral Component Interconnect)PCI is the most basic bus allowing connecting Graphics peripherals today. One of itskey feature is called bus mastering. This feature allows a given peripheral to take holdof the bus for a given number of cycles and do a complete transaction (called a DMA,Direct Memory Access). The PCI bus is coherent, which means that no explicit flushesare required for the memory to be coherent across Bus typesBus typeBus widthFrequencyBandwidthCapabilitiesPCI32 bits33 Mhz133 MB/s (33 Mhz)-AGP32 bits66 Mhz2100 MB/s (8x)SBA, FW,GARTPCI-X64 bits33, 66,533 MB/s (66 Mhz)-133 MhzPCI-Express ( ) Ghz4 GB/s (16 lanes)-PCI-Express ( )Serial4 Ghz16 GB/s (16 lanes)-Figure : Common bus (Accelerated Graphics Port)AGP is essentially a modified PCI bus with a number of extra features compared to itsancestor.


Related search queries