/* Linux and Android Graphics Stack Alison Chaiken alchaiken@gmail.com http://www.exerciseforthereader.org/, http://she-devel.com 8/9/2011 Docs: ======= Graphviz: http://www.graphviz.org/Documentation.php OpenGLES, EGL: http://www.khronos.org/ X11: http://www.bitwiz.org.uk/s/how-dri-and-drm-work.html http://wiki.x.org/wiki/Development/Documentation/HowVideoCardsWork GEM and TTM: https://lwn.net/Articles/283793/, http://www.x.org/wiki/ttm http://yangman.ca/blog/2009/10/linux-graphics-driver-stack-explained/ Android: Sasken Communications Technologies' "Graphics in Android," http://www.scribd.com/doc/52905278/Graphics-in-Android-an-Introduction http://developer.android.com/sdk/ndk/index.html file:///opt/android-ndk-r6/docs/STABLE-APIS.html Create SVG file: dot -Tsvg GraphicsStack.dot -o GraphicsStack.svg View with browser, or from command-line: eog GraphicsStack.svg */ digraph "parallel_graphics_stacks" { graph [fontsize=12,label="Android and Linux Graphics Stacks\n\n",labelfontsize=24,labelloc="t"]; // ,rankdir="LR" node [fontsize=10,fillcolor=thistle,style=filled,color=lightslateblue]; edge [fontsize=12,color=springgreen3]; //top-level nodes { node [fillcolor=pink,style=filled,color=pink] xRoot [label="Linux program\n(X11 client)"]; aRoot [label="Android app"]; } //Note [label="Need new modification or wrapping",fontcolor="red",style=""]; //{rank = source xRoot; aRoot; Note} {rank = source xRoot; aRoot} // breaks node coloration declaration if it precedes it //unused Android nodes /* WindowManager [label="WindowManager"]; SurfaceHeapManager [label="SurfaceHeapManager"]; MemoryDealer [label="MemoryDealer"]; renderscript [label="renderscript"]; */ SurfaceFlingerIn [label="SurfaceFlinger "]; X11In [label="X11 server"]; { rank=same; SurfaceFlingerIn; X11In } EGL [label="EGL (embedded)\nor GLX (desktop)"]; // EGLwrapper [label="EGL wrapper",fontcolor=red]; aEGL [label="EGL",fontcolor=black]; {rank = same; EGL; aEGL} DRI2in [label="DRI2 "]; gralloc[label="gralloc",fontcolor=black]; {rank = same; DRI2in; gralloc} OpenGLES [label="OpenGLES (embedded)\nor OpenGL (desktop)"]; aOpenGLES [label="OpenGLES "]; EXAin [label="EXA (native X11)\nor OpenVG"]; UXAin [label="UXA (Intel X11)"]; Skia [label="Skia"]; agl [label="agl"]; {rank = same; OpenGLES; EXAin; UXAin; aOpenGLES;Skia; agl} { node [fillcolor=palegoldenrod,style=filled] TTM [label="TTM DRM KM"]; GEM [label="GEM DRM KM"]; GPU [label="GPU KM"]; aDRM [label="DRM KM"]; aGPU [label="GPU KM"]; } {rank = same; TTM; GEM; GPU; aDRM; aGPU} // breaks node coloration declaration if it precedes it DRI2out [label="DRI2 "]; UXAout [label="UXA "]; aEGLout [label="EGL",fontcolor=black]; SurfaceFlingerOut [label="SurfaceFlinger "]; Compositor [label="Compositor\n(mutter or\nkwin)"]; { rank = same; SurfaceFlingerOut; Compositor } { rank = same; DRI2out; UXAout} Framebuffer [label="Framebuffer"]; aFramebuffer [label="Framebuffer"]; {rank=same; Framebuffer; aFramebuffer}; { edge [headport=n] xRoot -> X11In -> EGL; aRoot -> SurfaceFlingerIn; SurfaceFlingerIn -> aEGL; EGL -> OpenGLES [label="3D",fontcolor=springgreen3]; EGL -> EXAin [label="2D",fontcolor=springgreen3,style=dashed]; EGL -> UXAin [label="2D",fontcolor=springgreen3,style=dashed]; aEGL -> aOpenGLES [label="3D",fontcolor=springgreen3]; aEGL -> Skia [label="2D",fontcolor=springgreen3]; aEGL -> agl [label="SW rendering\nfallback",fontcolor=red,style=dashed,color=red] OpenGLES -> DRI2in [label="3D",fontcolor=springgreen3]; EXAin -> DRI2in [label="2D",fontcolor=springgreen3,style=dashed]; UXAin -> GEM [label="2D data",fontcolor=springgreen3,style=dashed]; UXAin -> GPU [label="2D instructions",fontcolor=blue,color=blue,style=dashed]; aOpenGLES -> gralloc; agl -> gralloc; Skia -> gralloc; aDRM -> aEGLout -> SurfaceFlingerOut; } // double-headed edge [headport=w] TTM -> GPU; edge [headport=w] aDRM -> aGPU; edge [headport=e] GPU-> TTM; edge [headport=e,tailport=w,style=dashed] GEM -> GPU; edge [headport=w,tailport=e,style=dashed] GPU-> GEM; edge [headport=e,tailport=w] aGPU-> aDRM; { edge [labelangle=-90.0,lp=8,fontcolor=blue,label="instructions",labeldistance=0,tailport=s,headport=n,color=blue,style=solid] DRI2in -> GPU; gralloc -> aGPU; } { edge [tailport=s,headport=n,label="data",distance=0,fontcolor=springgreen3,style=solid] DRI2in -> TTM ; gralloc -> aDRM; } { edge [headport=n,tailport=s] TTM -> DRI2out [fontcolor=springgreen3]; GEM -> UXAout [fontcolor=springgreen3,style=dashed]; } DRI2out -> Compositor [fontcolor=springgreen3,headport=n,tailport=s,style=solid]; UXAout -> Compositor [fontcolor=springgreen3,headport=n,tailport=s,style=dashed]; Compositor -> Framebuffer [fontcolor=springgreen3,headport=n,tailport=s,style=solid]; SurfaceFlingerOut -> aFramebuffer [fontcolor=springgreen3,headport=n,tailport=s]; { rank=same; SurfaceFlingerOut; Compositor } }