I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions
A deeper look into GPUs and the Linux Graphics Stack
Martin Peres CC By-SA 3.0
Nouveau developer Ph.D. student at LaBRI
November 26, 2012
1 / 75
A deeper look into GPUs and the Linux Graphics Stack Martin Peres - - PowerPoint PPT Presentation
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions A deeper look into GPUs and the Linux Graphics Stack Martin Peres CC By-SA 3.0 Nouveau developer Ph.D. student at LaBRI November 26, 2012 1 /
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions
Nouveau developer Ph.D. student at LaBRI
1 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions General overview
1
2
3
4
5
2 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions General overview
3 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions General overview
CPU Flash ROM (BIOS)
Super I/O
Serial Port Parallel Port Floppy Disk Keyboard Mouse
Northbridge
(memory controller hub)
Southbridge
(I/O controller hub) IDE SATA USB Ethernet Audio Codec CMOS Memory
Onboard graphics controller
Clock Generator
Graphics card slot High-speed graphics bus (AGP or PCI Express) Chipset Front-side bus Memory bus Memory Slots PCI Bus PCI Slots LPC Bus Internal Bus PCI Bus Cables and ports leading
4 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions General overview
5 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Driving screens
1
2
3
4
5
6 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Driving screens
crtc0 VGA Encoder Display Port Encoder DVI Encoder crtc1 VGA Conn DP Conn DVI Conn
7 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Driving screens
8 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Driving screens
HBlank
Line 0 Line 1 Line Y - 1 Line Y
CRTC Scanout
VBlank HBlank HBlank HBlank
Line Y - 2
9 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Driving screens
EDID signal Video
EDID EEPROM
VGA cable
10 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Driving screens
11 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Driving screens
12 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Host < − > GPU communication
1
2
3
4
5
13 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Host < − > GPU communication
14 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Host < − > GPU communication
Disk RAM
Another process's memory
Example of a CPU process's virtual memory space
0xffffffff
PCI-01:00 BAR0
0xffffff
Unused Unused
GPU 0, BAR 0 Register Space
0xffffffff
(swap) Logical address Physical address 15 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Host < − > GPU communication
MMU
Logical address Page T able Physical address
CROSSBAR
BIOS
GPU MMU
Logical address Physical address
IOMMU
Bus address
Host RAM GPU Device Device
P h y s i c a l a d d r e s s Location of functions: CPU GPU BIOS
programs
Chipset RAM Device Glossary:
MMU: Memory-Management Unit IOMMU: Input/Output MMU BIOS: Basic I/O System
Page T able Page T able
(optional)
16 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Host < − > GPU communication
Exposes a linear buffer from multiple RAM pages;
17 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Host < − > GPU communication Location of the address/memory: CPU GPU GTT/GART(references RAM) RAM
GPU virtual address (VRAM + GART)
Providing the GPU with easy access to the Host RAM
Physical address
Device
BAR 0 BAR 1 ...
Process virtual address space (VM)
18 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Host < − > GPU communication
19 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions General overview
1
2
3
4
5
20 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions General overview
21 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions General overview
22 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions General overview
Kernel space User space Xorg Applications Hardware drm radeon intel nouveau GPU xlib x-server network libdrm ddx mesa CPU Rasterizer If UCS* Qt gtk nexuiz
23 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Overview
1
2
3
4
5
24 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Overview
25 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Kernel Mode Setting
1
2
3
4
5
26 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Kernel Mode Setting
27 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Graphics buffer management
1
2
3
4
5
28 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Graphics buffer management
29 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Graphics buffer management
30 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Graphics buffer management
31 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Graphics buffer management
32 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Graphics buffer management
33 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions How to contribute code
1
2
3
4
5
34 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions How to contribute code
35 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Mesa
1
2
3
4
5
36 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Mesa
37 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Mesa
Applications Mesa State Trackers pipe drivers Mesa Classics Weston egl x-server xorg mplayer VDPAU xonotic libgl Qt OpenGL intel radeon nouveau_vieux swrast Gallium softpipe llvmpipe r600g r300g nvc0 nv50 ... nv30 CPU LLVM GPU (through libdrm)
38 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions OpenGL
1
2
3
4
5
39 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions OpenGL
40 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions OpenGL 41 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions OpenGL 42 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Video Acceleration
1
2
3
4
5
43 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Video Acceleration
44 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Video Acceleration
45 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Video Acceleration
46 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Overview
1
2
3
4
5
47 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Overview
Kernel space User space Xorg Applications Hardware drm radeon intel nouveau GPU xlib x-server network libdrm ddx mesa CPU Rasterizer If UCS* Qt gtk nexuiz
48 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X11
1
2
3
4
5
49 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X11
50 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X11
51 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
1
2
3
4
5
52 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
53 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
Client Server DDX Acceleration Architectures DIX Extensions Hardware devices Cairo OpenGL Xlib or xcb Pango Mesa Dispatch Toolkit Event_Queue Input Drivers Xinput Video Drivers Acceleration_2D Acceleration_Video Display Pixman Render RandR GLX Keyboard Mouse Gallium FrameBuffer
54 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
55 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
56 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
57 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
58 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
59 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
60 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
61 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
62 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
63 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X-Server
64 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Overview
1
2
3
4
5
65 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Overview
66 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Overview
67 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Overview
68 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X11 vs Wayland
1
2
3
4
5
69 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X11 vs Wayland
70 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions X11 vs Wayland
71 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Attributions
1
2
3
4
5
72 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Attributions
73 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Attributions
74 / 75
I - GPU & Hardware II - Host: summary DRM Mesa X11 and the XServer Wayland Attributions Attributions
75 / 75