Linux: EGL headless context videodriver


We’ve had a use-case where we wanted an application that uses SDL2 for OpenGL context creation to use a headless EGL context rather than anything that would attempt to open a window (similar as done in this blog post). I got this working in SDL2 by stripping the KMS video driver basically of everything that is KMS/Config-specific, and only let it provide an EGL context (very little had to be changed in the EGL bits to make this work). While that seems to work well, it’s a hack, and I wonder if I could contribute this in a cleaner way. Maybe a new simple video driver? Or a hint to the DUMMY video driver? What do you think could be an acceptable way to implement this feature upstream?

Best regards,