<story><title>The Linux graphics stack in a nutshell</title><url>https://lwn.net/SubscriberLink/955376/b3fba3bbfabbc411/</url></story><parent_chain><item><author>pcwalton</author><text>2D acceleration is generally done through the same APIs, specifically OpenGL and Vulkan. Classically, the X compositor would use the GLX_EXT_texture_from_pixmap extension to import an X pixmap representing a window surface into OpenGL, where it can be used like any other texture. For the Wayland compositor, I believe you&amp;#x27;d use EGL_WL_bind_wayland_display to bind a Wayland surface to an EGLImage, and then glEGLImageTargetTexture2DOES (can&amp;#x27;t believe I have that function name memorized) to bind that EGLImage to an OpenGL texture, where it can be used in the same way. Vulkan has similar extensions.&lt;p&gt;On the client side, I think most Linux apps still draw their UIs on CPU, usually accelerated with SIMD. Firefox and Chrome (I think SkiaGL is enabled on Linux?) are exceptions; they use OpenGL and&amp;#x2F;or Vulkan to draw their UI. Video playback is a different beast and in theory relies on vendor-specific extensions to decode the video in hardware. However, the last time I looked at Linux video decoding (which was years ago), the drivers were awful and interfacing with each vendor&amp;#x27;s APIs was a huge pain, and so most apps just did video decoding on CPU. (Besides, the Linux ecosystem prefers open codecs, and hardware has only recently gotten support for non-patent-encumbered video formats.)</text></item><item><author>userbinator</author><text>This is about 3D rendering, to be precise; I believe 2D acceleration goes through the same lower layers but the higher ones are very different.&lt;p&gt;Incidentally, one thing I noticed when I was trying to port Linux GPU drivers to Windows some time ago is what appeared to be an excessive amount of indirection; there are so many layers and places where things could be simpler.</text></item></parent_chain><comment><author>Denvercoder9</author><text>&amp;gt; However, the last time I looked at Linux video decoding (which was years ago), the drivers were awful and interfacing with each vendor&amp;#x27;s APIs was a huge pain, and so most apps just did video decoding on CPU.&lt;p&gt;Nowadays VA-API is near universally supported, and any half-decent video player uses it to do hardware decoding.</text></comment>
<story><title>The Linux graphics stack in a nutshell</title><url>https://lwn.net/SubscriberLink/955376/b3fba3bbfabbc411/</url></story><parent_chain><item><author>pcwalton</author><text>2D acceleration is generally done through the same APIs, specifically OpenGL and Vulkan. Classically, the X compositor would use the GLX_EXT_texture_from_pixmap extension to import an X pixmap representing a window surface into OpenGL, where it can be used like any other texture. For the Wayland compositor, I believe you&amp;#x27;d use EGL_WL_bind_wayland_display to bind a Wayland surface to an EGLImage, and then glEGLImageTargetTexture2DOES (can&amp;#x27;t believe I have that function name memorized) to bind that EGLImage to an OpenGL texture, where it can be used in the same way. Vulkan has similar extensions.&lt;p&gt;On the client side, I think most Linux apps still draw their UIs on CPU, usually accelerated with SIMD. Firefox and Chrome (I think SkiaGL is enabled on Linux?) are exceptions; they use OpenGL and&amp;#x2F;or Vulkan to draw their UI. Video playback is a different beast and in theory relies on vendor-specific extensions to decode the video in hardware. However, the last time I looked at Linux video decoding (which was years ago), the drivers were awful and interfacing with each vendor&amp;#x27;s APIs was a huge pain, and so most apps just did video decoding on CPU. (Besides, the Linux ecosystem prefers open codecs, and hardware has only recently gotten support for non-patent-encumbered video formats.)</text></item><item><author>userbinator</author><text>This is about 3D rendering, to be precise; I believe 2D acceleration goes through the same lower layers but the higher ones are very different.&lt;p&gt;Incidentally, one thing I noticed when I was trying to port Linux GPU drivers to Windows some time ago is what appeared to be an excessive amount of indirection; there are so many layers and places where things could be simpler.</text></item></parent_chain><comment><author>MBCook</author><text>Why are toolkits still rendered on the CPU?</text></comment>