Skip to content

TomHsieh300/Linux-DRM-Explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux-DRM-Explorer

A systematic and deep-dive exploration of the Linux DRM/KMS subsystem on the Rockchip RK3588 (VOP2) platform. This project documents a professional display bring-up journey, transitioning from low-level register verification to modern, high-performance atomic synchronization.

Project Highlights

  • Architectural Mastery: Bridging the mental model between Linux ASoC (Audio) and DRM (Display), treating pixels as a specialized DMA stream.
  • Modern API Transition: Complete migration from Legacy KMS (SetCrtc) to Atomic KMS (Property-based commits).
  • Zero-Copy Pipelines: Implementation of DMA-BUF (PRIME) for efficient cross-device memory sharing without CPU intervention.
  • Performance Optimization: Inner-loop branchless rendering and Fence-based hardware synchronization to eliminate UI jitter and tearing.

The 11-Stage Learning Roadmap

I have structured the bring-up process into 11 progressive experiments:

Phase 1: Hardware & Subsystem Basics

  1. KMS Pipeline Mapping: Analyzing internal VOP2 resources (VP0-VP3) and Plane constraints.
  2. Modetest Mastery: Hands-on with atomic modesetting and troubleshooting object IDs.
  3. DSI Panel Bring-up: Calculating Video Timings and verifying PCLK/DPHY registers.
  4. DRM Master Concepts: Navigating ownership conflicts between fbcon and userspace clients.

Phase 2: Building the Software Pipeline

  1. Composition & Sync: Understanding hardware layering (Z-order) and GEM/Fence roles.
  2. VBlank & Page Flip: Real-time monitoring of VOP interrupts to verify the display "heartbeat."
  3. Userspace KMS C-API: Implementing the first framebuffer renderer using libdrm.
  4. Double Buffering & Branchless: Scaling to multi-buffer architectures and CPU pipeline optimization.

Phase 3: Advanced Atomic & Synchronization

  1. VBlank Sync vs. Tearing: Analyzing the scanout race condition and the physics of screen tearing.
  2. Atomic KMS Mastery: Fully migrating to the Atomic property model and TEST_ONLY validation.
  3. DMA-BUF & Fence Sync: Simulating cross-device pipelines with PRIME and explicit fences (IN_FENCE_FD).

Tools & Environment

  • Target Hardware: LubanCat 5 (Rockchip RK3588, VOP2)
  • Software Stack: Ubuntu Lite (Minimal CLI), libdrm, linux-libc-dev.
  • Analysis Tools: modetest, debugfs (KMS status), GICv3 interrupt analysis.

Technical Insights for IC Design & BSP Teams

  • Unified Memory Coherency: Deep understanding of DMA_BUF_IOCTL_SYNC for cache maintenance on ARM SoCs.
  • Proprietary Driver Strategies: Successfully simulated cross-namespace GEM sharing on platforms with proprietary Mali stacks.
  • Fixed-Point Precision: Handling 16.16 fixed-point source coordinates required by modern display hardware.

Signed-off-by: TomHsieh300 hungen3108@gmail.com

About

A hands-on laboratory for mastering the Linux DRM/KMS subsystem. Focuses on hardware bring-up methodologies, diagnostic tools (modetest, debugfs), and bridging the gap between User-space display requirements and Kernel-space driver logic. Targeted at embedded display driver development and IC design verification.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors