Skip to content

Implement OpenDRM: Linux DRM/KMS abstraction library and CLI#1

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/add-opendrm-integration
Draft

Implement OpenDRM: Linux DRM/KMS abstraction library and CLI#1
Copilot wants to merge 2 commits intomasterfrom
copilot/add-opendrm-integration

Conversation

Copy link

Copilot AI commented Mar 6, 2026

Bootstraps the opendrm repository with a generic Linux DRM/KMS abstraction layer targeting OpenIPC embedded devices (cameras, FPV ground stations) that need direct display output without a compositor.

Library (src/opendrm.h / src/opendrm.c)

  • Device managementdrm_open / drm_close with capability negotiation (UNIVERSAL_PLANES, ATOMIC, DUMB_BUFFER)
  • Output setupdrm_prepare enumerates connectors, selects the best matching mode (or preferred if unspecified), allocates a double-buffered ARGB8888 dumb framebuffer pipeline
  • Atomic commitsdrm_commit issues test-then-apply DRM_MODE_ATOMIC_ALLOW_MODESET commits for tear-free updates
  • Clean teardowndrm_cleanup correctly unwinds map → FB → dumb buffer in order; partial allocation paths are safe

Header named opendrm.h (not drm.h) to avoid collision with the system libdrm <drm.h>.

CLI (src/main.c)

opendrm [options] <command>

Commands:
  list        Print WxH@R for every connected display
  info        Dump connector / CRTC / plane topology

Options:
  -d <device>  DRM node (default: /dev/dri/card0)

Command is validated before the device is opened so unknown-command errors are clear.

Build (CMakeLists.txt)

CMake (≥ 3.10, C99) with pkg-config libdrm. Produces:

  • opendrm — CLI binary
  • libopendrm_lib.a — static library for downstream projects
  • src/opendrm.h installed to <prefix>/include/opendrm/
Original prompt

OpenDRM


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: flyrouter <68112357+flyrouter@users.noreply.github.com>
Copilot AI changed the title [WIP] Add integration for OpenDRM support Implement OpenDRM: Linux DRM/KMS abstraction library and CLI Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants