Skip to content

Support Linux handheld displays and multitouch - #202

Merged
treeform merged 22 commits into
treeform:masterfrom
monofuel:anbernic-handhelds
Nov 11, 2026
Merged

treeform merged 22 commits into
treeform:masterfrom
monofuel:anbernic-handhelds

Conversation

@monofuel

@monofuel monofuel commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

I need Windy to support fbdev and DRM for my launcher and emulator frontend on Linux handhelds.

  • The handhelds run without a window server. The RG SP uses fbdev, and the RG DS Plus needs two DRM displays and multitouch. I want to use Windy with displays and touch but also be compatible with x11 desktops.
  • Larger desktop windows made CPU rendering too slow when upscaling lower resolutions to larger windows. Uploading a 256×224 image at 4× took 18.7 ms in an Xvfb benchmark; it now takes 2.1 ms. For emulator playback, the opt-in X11 GPU presenter also moves scaling to the GPU and supports GLX vsync.
  • Emulator rendering was also too slow on the RG SP. A faster CPU path for its 32-bit framebuffer writes whole pixels directly, avoiding generic color conversion and individual byte writes. Uploading a 720×480 frame to fbdev dropped from 43.8 ms to 4.0 ms.
  • Using two X11 windows exposed a bug with events reaching the wrong window in release builds. My app needs input to reach the window it belongs to.
  • Scrolling games showed tearing on DRM. With vsync enabled, Windy now uses two buffers and asks DRM to switch between them during vertical blank, between display refreshes. It waits for the page flip to complete before reusing a buffer, avoiding writes to the frame being displayed.
  • CPU scaling and splitting emulator frames across the DS Plus displays also used too much time. The paired GPU presenter uploads the source image once, scales both regions on the GPU and submits both displays in one atomic DRM transaction. Presentation waits for both displays to complete before reusing the old buffer, keeping their frame updates together.

I've manually tested both an Anbernic rg sp and rg ds plus, including dual-screen multitouch and paired GPU presentation on the DS Plus. Native tests and headless X11 CPU/GLX/GPU tests pass in debug and release. The direct display backends and GPU presenters are experimental; touch delivery is evdev-only.

@monofuel
monofuel marked this pull request as ready for review November 10, 2026 22:05

@treeform treeform left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are touching the other platforms very little, good!

You are adding touch events but stubbing them out for other platforms. That's OK.

Comment thread src/windy/platforms/linux/drmpixels.nim Resolved
Comment thread docs/x11-pixels.md Resolved
@treeform
treeform merged commit 2c71135 into treeform:master Nov 11, 2026
3 checks passed
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