Skip to content

Commit 6aed2dd

Browse files
committed
Support Linux DRM backend
Implemented DRM-based framebuffer setup, including: - Opening the DRM device - Creating dumb buffers and mapping them to framebuffers - Setting mode and handling CRTC for connected display output The legacy DRM ioctl interface is used as the current implementation does not require atomic mode-setting or page flipping. Atomic mode-setting prevents inconsistent states, supports rollback on failures, and enables mode testing before committing changes. Atomic page flipping synchronizes multiple planes within a VBLANK interval, preventing tearing and improving display updates, especially for power-efficient embedded controllers. While the atomic API enhances KMS with property-based state management, its complexity is unnecessary for now. The legacy interface remains adequate, but future needs may justify adopting atomic mode-setting. Close sysprog21#60
1 parent 9837705 commit 6aed2dd

File tree

5 files changed

+449
-0
lines changed

5 files changed

+449
-0
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"fcntl.h": "c"
4+
}
5+
}

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,15 @@ libtwin.a_files-y += backend/fbdev.c
123123
libtwin.a_files-y += backend/linux_input.c
124124
endif
125125

126+
ifeq ($(CONFIG_BACKEND_DRM), y)
127+
BACKEND = drm
128+
TARGET_LIBS += -ludev
129+
libtwin.a_files-y += backend/drm.c
130+
libtwin.a_files-y += backend/linux_input.c
131+
libtwin.a_cflags-y += $(shell pkg-config --cflags libdrm)
132+
TARGET_LIBS += $(shell pkg-config --libs libdrm)
133+
endif
134+
126135
ifeq ($(CONFIG_BACKEND_VNC), y)
127136
BACKEND = vnc
128137
libtwin.a_files-y += backend/vnc.c

0 commit comments

Comments
 (0)