Hands On Projects For The Linux Graphics Subsystem 2021 | GENUINE × HANDBOOK |

Developing for the Linux graphics subsystem involves bridging the gap between high-level user applications and low-level kernel drivers. This complex stack includes the Direct Rendering Manager (DRM), Kernel Mode Setting (KMS), and userspace components like Mesa 3D and compositors (Wayland/X11).

  • Learning outcomes:

    Project 3: Patch Mesa to Add a Custom debug printf

    Goal: Recompile Mesa (the open-source GPU driver stack) with a custom log that prints every time a shader is compiled. Hands On Projects For The Linux Graphics Subsystem

    Virtual Kernel Mode Setting (VKMS) Implementation: A highly recommended academic project is contributing to or building upon VKMS, a software-only model of a KMS driver used for testing. Learning outcomes:

    1. Install libwayland-dev.
    2. Write a Wayland client that connects to the compositor.
    3. Use wl_display_get_registry to bind to the compositor interfaces.
    4. Create a Surface (wl_surface) and a Shell Surface.
    5. Allocate a shared memory buffer (shm) manually in C.
    6. Write pixel data (RGBA values) directly into that memory buffer to draw a gradient or solid color.
    7. Attach the buffer to the surface and commit it.