How mroz59/hermes-kms works
Hermes-KMS is a Linux virtual-display DRM/KMS driver whose main workflow is: a userspace owner claims an output and receives a session capability; a compositor drives that output; an authorized capture client waits for and acquires scanout DMA-BUFs; and a real GPU imports them for encoding. The driver also supports cursor capture, synthetic EDID, multiple outputs/cards and runtime card creation. The graph includes documented reference and diagnostic tools. Kernel internals beyond the supplied excerpts are grouped by responsibility; links to unsampled subsystems use README evidence only.
Main entry points: hermes_kms_drm.h DRM ioctl UAPI · hermes_kms.c DRM/KMS driver · hermes_kms_import_check.c VAAPI import check · hermes_egl_import_check.c EGL import check
Components 22
Virtual display
- DRM/KMS driver
kernel/hermes-kms/hermes_kms.c - Virtual outputs
kernel/hermes-kms/hermes_kms.c - Synthetic EDID
kernel/hermes-kms/hermes_kms_edid.h - Vblank and modeset
kernel/hermes-kms/hermes_kms.c - Runtime card creation
kernel/hermes-kms/hermes_kms.c
Capture and sessions
- DRM ioctl UAPI
include/uapi/drm/hermes_kms_drm.h - Scanout tracking
kernel/hermes-kms/hermes_kms.c - Session authorization
kernel/hermes-kms/hermes_kms.c - Frame export
kernel/hermes-kms/hermes_kms.c - Cursor capture
kernel/hermes-kms/hermes_kms.c
Reference clients
- Session helper
tools/hermes_session.h - KMS control client
tools/hermes-kmsctl/hermes_kmsctl.c - VAAPI import check
tools/hermes-kms-import-check/hermes_kms_import_check.c - EGL import check
tools/hermes-egl-import-check/hermes_egl_import_check.c - Pitch detector
tools/hermes-egl-import-check/pitch_detect.c - Pixel inspection
tools/hermes-pixel-peek/hermes_pixel_peek.c
Diagnostics
- Cursor probe
tools/hermes-cursor-probe/hermes_cursor_probe.c - Vblank meter
scripts/hermes-vblank-meter.c
Other components
- Output owner
- Desktop compositor
- Capture consumer
- Real GPU
Connections 24
- Output owner → DRM ioctl UAPI: claims output
README.md - DRM ioctl UAPI → Session authorization: authorizes access
README.md - Output owner → Capture consumer: transfers token
README.md - Capture consumer → DRM ioctl UAPI: binds and requests
README.md - Desktop compositor → Virtual outputs: drives display
README.md - DRM/KMS driver → Virtual outputs: exposes outputs
README.md - DRM/KMS driver → Synthetic EDID: uses generator
kernel/hermes-kms/hermes_kms.c - DRM/KMS driver → Runtime card creation: creates cards
README.md - Virtual outputs → Scanout tracking: tracks scanout
kernel/hermes-kms/hermes_kms.c - Scanout tracking → Frame export: exports frames
README.md - Capture consumer → Frame export: acquires DMA-BUF
README.md - Capture consumer → Cursor capture: acquires cursor
README.md - Real GPU → Frame export: imports DMA-BUF
README.md - Desktop compositor → Vblank and modeset: drives refresh
README.md - Session helper → Session authorization: binds credentials
tools/hermes_session.h - KMS control client → DRM ioctl UAPI: controls and queries
tools/hermes-kmsctl/hermes_kmsctl.c - VAAPI import check → DRM ioctl UAPI: waits and acquires
tools/hermes-kms-import-check/hermes_kms_import_check.c - VAAPI import check → Real GPU: imports with VAAPI
tools/hermes-kms-import-check/hermes_kms_import_check.c - EGL import check → DRM ioctl UAPI: acquires frames
tools/hermes-egl-import-check/hermes_egl_import_check.c - EGL import check → Real GPU: imports with EGL
tools/hermes-egl-import-check/hermes_egl_import_check.c - Pitch detector → Real GPU: checks row pitch
tools/hermes-egl-import-check/pitch_detect.c - Pixel inspection → DRM ioctl UAPI: reads scanout
tools/hermes-pixel-peek/hermes_pixel_peek.c - Cursor probe → DRM ioctl UAPI: inspects cursor
tools/hermes-cursor-probe/hermes_cursor_probe.c - Vblank meter → DRM ioctl UAPI: measures vblank
scripts/hermes-vblank-meter.c