Skip to content

Commit 13085d7

Browse files
committed
cs linux: graphics stack
add group theory. Rename application to docs vault.
1 parent df6a1ea commit 13085d7

File tree

5 files changed

+538
-9
lines changed

5 files changed

+538
-9
lines changed

cs/linux/graphics.tex

+276
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
1+
\documentclass[11pt]{article}
2+
\usepackage[utf8]{inputenc}
3+
\usepackage[T1]{fontenc} % Fix weird character
4+
\usepackage{geometry}
5+
\usepackage{amsmath}
6+
\usepackage{amssymb}
7+
\usepackage{gensymb}
8+
\usepackage{spalign}
9+
\usepackage{xfrac}
10+
\usepackage{parskip}
11+
\usepackage{float} % figure[H]
12+
\usepackage[english]{babel}
13+
\usepackage[style=ieee,backend=biber,urldate=iso,date=iso]{biblatex}
14+
\usepackage[breaklinks=true,bookmarks=true,hidelinks]{hyperref}
15+
\usepackage{tikz}
16+
\usepackage{pgfplots}
17+
\usepackage{circuitikz}
18+
\usepackage{subcaption}
19+
\usepackage[yyyymmdd]{datetime}
20+
\usepackage{url}
21+
\usetikzlibrary {arrows.meta}
22+
\pgfplotsset{compat=newest,compat/show suggested version=false}
23+
24+
% Custom shape
25+
\makeatletter
26+
\pgfdeclareshape{dflowpass}{
27+
\inheritsavedanchors[from=rectangle]
28+
\inheritanchorborder[from=rectangle]
29+
\inheritanchor[from=rectangle]{center}
30+
\anchor{left}{\pgfpoint{-0.5cm}{0cm}}
31+
\anchor{right}{\pgfpoint{0.5cm}{0cm}}
32+
% Add more custom anchors if needed
33+
\backgroundpath{
34+
% Draw the switch shape (rectangle with diagonal lines)
35+
\pgfsetlinewidth{0.85pt}
36+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
37+
\pgfpathmoveto{\pgfpoint{-0.35cm}{0.125cm}}
38+
\pgfpathlineto{\pgfpoint{0.15cm}{0.125cm}}
39+
\pgfpathlineto{\pgfpoint{0.35cm}{-0.2cm}}
40+
\pgfusepath{draw}
41+
}
42+
}
43+
\pgfdeclareshape{dfhighpass}{
44+
\inheritsavedanchors[from=rectangle]
45+
\inheritanchorborder[from=rectangle]
46+
\inheritanchor[from=rectangle]{center}
47+
\anchor{left}{\pgfpoint{-0.5cm}{0cm}}
48+
\anchor{right}{\pgfpoint{0.5cm}{0cm}}
49+
\backgroundpath{
50+
% Draw the switch shape (rectangle with diagonal lines)
51+
\pgfsetlinewidth{1pt}
52+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
53+
\pgfpathmoveto{\pgfpoint{0.35cm}{0.125cm}}
54+
\pgfpathlineto{\pgfpoint{-0.15cm}{0.125cm}}
55+
\pgfpathlineto{\pgfpoint{-0.35cm}{-0.2cm}}
56+
\pgfusepath{draw}
57+
}
58+
}
59+
\pgfdeclareshape{dfbandpass}{
60+
\inheritsavedanchors[from=rectangle]
61+
\inheritanchorborder[from=rectangle]
62+
\inheritanchor[from=rectangle]{center}
63+
\anchor{left}{\pgfpoint{-0.5cm}{0cm}}
64+
\anchor{right}{\pgfpoint{0.5cm}{0cm}}
65+
\backgroundpath{
66+
% Draw the switch shape (rectangle with diagonal lines)
67+
\pgfsetlinewidth{1pt}
68+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
69+
\pgfpathmoveto{\pgfpoint{-0.35cm}{-0.2cm}}
70+
\pgfpathlineto{\pgfpoint{-0.20cm}{0.125cm}}
71+
\pgfpathlineto{\pgfpoint{0.15cm}{0.125cm}}
72+
\pgfpathlineto{\pgfpoint{0.35cm}{-0.2cm}}
73+
\pgfusepath{draw}
74+
}
75+
}
76+
\pgfdeclareshape{quantizer}{
77+
\inheritsavedanchors[from=rectangle]
78+
\inheritanchorborder[from=rectangle]
79+
\inheritanchor[from=rectangle]{center}
80+
\anchor{left}{\pgfpoint{-0.5cm}{0cm}}
81+
\anchor{right}{\pgfpoint{0.5cm}{0cm}}
82+
\backgroundpath{
83+
% Draw the switch shape (rectangle with diagonal lines)
84+
\pgfsetlinewidth{0.8pt}
85+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
86+
\pgfpathmoveto{\pgfpoint{-0.25cm}{-0.25cm}}
87+
\pgfpathlineto{\pgfpoint{0cm}{-0.25cm}}
88+
\pgfpathlineto{\pgfpoint{0cm}{0.25cm}}
89+
\pgfpathlineto{\pgfpoint{0.25cm}{0.25cm}}
90+
\pgfusepath{draw}
91+
}
92+
}
93+
\pgfdeclareshape{quantamp}{
94+
\inheritsavedanchors[from=op amp]
95+
\inheritanchorborder[from=op amp]
96+
\inheritanchor[from=op amp]{center}
97+
\inheritanchor[from=op amp]{+}
98+
\inheritanchor[from=op amp]{-}
99+
\inheritanchor[from=op amp]{out}
100+
\inheritanchor[from=op amp]{up}
101+
\inheritanchor[from=op amp]{down}
102+
\backgroundpath{
103+
\pgfsetlinewidth{0.8pt}
104+
\pgfpathmoveto{\pgfpoint{-0.5cm}{0.55cm}}
105+
\pgfpathlineto{\pgfpoint{0.5cm}{0}}
106+
\pgfpathlineto{\pgfpoint{-0.5cm}{-0.55cm}}
107+
\pgfpathclose
108+
\pgfpathmoveto{\pgfpoint{-0.35cm}{-0.2cm}}
109+
\pgfpathlineto{\pgfpoint{-0.2cm}{-0.2cm}}
110+
\pgfpathlineto{\pgfpoint{-0.2cm}{0.2cm}}
111+
\pgfpathlineto{\pgfpoint{-0.05cm}{0.2cm}}
112+
\pgfusepath{draw}
113+
}
114+
}
115+
\pgfdeclareshape{decimation}{
116+
\inheritsavedanchors[from=rectangle]
117+
\inheritanchorborder[from=rectangle]
118+
\inheritanchor[from=rectangle]{center}
119+
\anchor{left}{\pgfpoint{-0.5cm}{0.0cm}}
120+
\anchor{right}{\pgfpoint{0.5cm}{0.0cm}}
121+
\anchor{top}{\pgfpoint{0.0cm}{0.5cm}}
122+
\anchor{bot}{\pgfpoint{0.0cm}{-0.5cm}}
123+
\backgroundpath{
124+
\pgfsetlinewidth{0.8pt}
125+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
126+
\pgfpathmoveto{\pgfpoint{-0.25cm}{0.25cm}}
127+
\pgfpathlineto{\pgfpoint{-0.25cm}{-0.25cm}}
128+
\pgfpathmoveto{\pgfpoint{-0.30cm}{-0.185cm}}
129+
\pgfpathlineto{\pgfpoint{-0.25cm}{-0.25cm}}
130+
\pgfpathlineto{\pgfpoint{-0.20cm}{-0.185cm}}
131+
\pgfusepath{draw}
132+
}
133+
}
134+
\makeatother
135+
136+
\geometry{
137+
a4paper,
138+
hmargin=2.54cm,
139+
tmargin=1.27cm,
140+
bmargin=1.27cm,
141+
includeheadfoot
142+
}
143+
\setcounter{secnumdepth}{0} % Disable section numbering
144+
145+
\begin{filecontents}{linux-graphics-stack.bib}
146+
@misc{navlgs,
147+
author = {{Pengutronix}},
148+
title = {{ELCE 2022: Navigating the Linux Graphics Stack}},
149+
year = {2022},
150+
howpublished = {\url{https://youtu.be/WaF7mVhnhtE}},
151+
note = {Accessed: 2024-12-25}
152+
}
153+
\end{filecontents}
154+
\addbibresource{linux-graphics-stack.bib}
155+
156+
\begin{document}
157+
\section{Linux Graphics Stack}
158+
159+
\cite{navlgs}
160+
161+
\subsection{Some Acronyms}
162+
\begin{verbatim}
163+
ls /sys/class/drm/card0-HDMI-A-1
164+
\end{verbatim}
165+
166+
\begin{verbatim}
167+
ls /sys/kernel/debug/dri/0
168+
\end{verbatim}
169+
170+
\begin{verbatim}
171+
echo 0x1ff > /sys/module/drm/parameters/debug
172+
\end{verbatim}
173+
\begin{itemize}
174+
\item Wayland
175+
\item DRI - Direct Rendering Infrastructure
176+
\item DRM - Direct Rendering Manager
177+
\item KMS - Kernel Mode Settings
178+
\item FB - Frame Buffer
179+
\item EGL
180+
\item OpenGL
181+
\end{itemize}
182+
183+
\subsection{Topics}
184+
185+
\begin{itemize}
186+
\item Pixel buffer onto display
187+
\item Draw pixel into a pixel buffer
188+
\item Compose multiple pixel buffers
189+
\end{itemize}
190+
191+
\subsection{Display - Acronyms}
192+
193+
\begin{itemize}
194+
\item DRI - Direct Rendering Infrastructure
195+
196+
A framework in the X Window System that enables direct access to
197+
graphics hardware, allowing applications to perform rendering without
198+
the overhead of inter-process communication.
199+
200+
\item DRM - Direct Rendering Manager
201+
202+
A subsystem of the Linux kernel responsible for managing graphics
203+
processing units (GPUs), providing an API for user-space programs to
204+
perform operations like configuring display modes and rendering
205+
graphics.
206+
207+
\item KMS - Kernel Mode Settings
208+
209+
A component of the Direct Rendering Manager (DRM) that moves
210+
responsibility for display mode setting (such as resolution and color
211+
depth) from user space to the kernel, improving system stability and
212+
reducing flickering during mode changes.
213+
214+
\item FB - Frame Buffer
215+
216+
A portion of RAM containing a bitmap that drives a video display; in
217+
Linux, the framebuffer device provides a simple interface to graphics
218+
hardware, allowing applications to write directly to the display
219+
buffer.
220+
\end{itemize}
221+
222+
\subsection{Display Stack}
223+
224+
\subsection{Kernel Debugging}
225+
226+
\begin{verbatim}
227+
ls /sys/class/drm/card0-HDMI-A-1
228+
\end{verbatim}
229+
230+
\begin{verbatim}
231+
ls /sys/kernel/debug/dri/0
232+
\end{verbatim}
233+
234+
\begin{verbatim}
235+
echo 0x1ff > /sys/module/drm/parameters/debug
236+
\end{verbatim}
237+
238+
\subsection{GPU - Acronyms}
239+
240+
\begin{itemize}
241+
\item OpenGL - Open Graphics Library
242+
243+
A cross-platform API for rendering 2D and 3D vector graphics,
244+
facilitating hardware-accelerated rendering by interfacing with the GPU.
245+
246+
\item GLSL - OpenGL Shading Language
247+
248+
A high-level shading language with C-like syntax, enabling developers to
249+
write shaders for programmable stages of the graphics pipeline, such as
250+
vertex and fragment shaders
251+
252+
\item EGL - Native Platform Graphics Interface API
253+
254+
Provides an interface between OpenGL and the native windowing system
255+
for managing rendering surfaces.
256+
\end{itemize}
257+
258+
In the Direct Rendering Manager (DRM) framework, only one application can hold
259+
the DRM master status at a time, granting it exclusive control over display
260+
resources.
261+
262+
Traditional toolkits and applications often lack direct support for Kernel Mode
263+
Setting (KMS), making it challenging for multiple applications to manage display
264+
outputs concurrently.
265+
266+
To address this limitation, a window compositor, such as Wayland, is employed.
267+
The compositor acts as the sole DRM master, managing access to display resources
268+
and facilitating the coordination of multiple applications' rendering requests.
269+
270+
This architecture enables a more efficient and secure management of graphical
271+
resources, allowing applications to render content without requiring direct
272+
control over the display hardware.
273+
274+
\newpage
275+
\printbibliography
276+
\end{document}

0 commit comments

Comments
 (0)