Re: KMS/DRM context for the GL/GLES renderer

"sigmaris" <[email protected]>
Newsgroups gmane.comp.lib.sdl
Message-ID <[email protected]>
I've recently been working on a KMS/DRM videodriver for SDL2, in this branch on Github: https://github.com/sigmaris/SDL-mirror/tree/kmsdrm
I've been copying the Raspberry Pi videodriver quite closely.
It doesn't use anything from DirectFB - only libdrm, GBM, and Mesa EGL.
My motivation is basically to get EmulationStation from RetroPie working, using this videodriver, without X11 on a Raspberry Pi 3 (not using dispmanx but using Mesa and Eric Anholt's open-source vc4 drivers).
It's at an early-ish stage, but it's working to the extent that EmulationStation can be built against SDL2 with this driver, and starts up and shows its UI on the frame buffer.

A few things are missing or still to be done, though, and there are bugs.

* There's no support for mouse cursor yet. It could be done with drmModeSetCursor on platforms that support hardware cursors, but I don't know what to do for a software fallback.
* There's no support for changing the screen mode with SDL.
* There's no support for multiple displays.
* It'd be nice to have dynamic loading support for libdrm/libgbm/etc, like the Wayland and X11 videodrivers.
* There's no way to have more than one (fullscreen) SDL window (Maybe this is OK as a limitation of this platform though)
* I've only added it into the CMake build system, not the autotools system.


Right now I'm investigating a problem where EmulationStation shuts down its SDL video system (calls SDL_VideoQuit) and launches another program, then when that program finishes, ES re-initialises its SDL video. After it re-inits the video subsystem, I keep getting Access Denied when calling drmModePageFlip(). So it works the first time, but not after quit and re-init, even though I close the /dev/dri/card0 file descriptor in VideoQuit and re-open it in VideoInit.

_______________________________________________
SDL mailing list
[email protected]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.