Implement OpenDRM: Linux DRM/KMS abstraction library and CLI#1
Draft
Implement OpenDRM: Linux DRM/KMS abstraction library and CLI#1
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bootstraps the
opendrmrepository 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)drm_open/drm_closewith capability negotiation (UNIVERSAL_PLANES,ATOMIC,DUMB_BUFFER)drm_prepareenumerates connectors, selects the best matching mode (or preferred if unspecified), allocates a double-buffered ARGB8888 dumb framebuffer pipelinedrm_commitissues test-then-applyDRM_MODE_ATOMIC_ALLOW_MODESETcommits for tear-free updatesdrm_cleanupcorrectly unwinds map → FB → dumb buffer in order; partial allocation paths are safeHeader named
opendrm.h(notdrm.h) to avoid collision with the system libdrm<drm.h>.CLI (
src/main.c)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 binarylibopendrm_lib.a— static library for downstream projectssrc/opendrm.hinstalled to<prefix>/include/opendrm/Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.