We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3856

Summary: Fix detection of EGL support when using DRM
Product: SDL Reporter: Olivier <olivier.schonken>
Component: buildAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: sezeroz
Version: 2.0.6   
Hardware: ARM   
OS: Linux   
Attachments: Patch to modify configure.in

Description Olivier 2017-10-02 10:39:52 UTC
Created attachment 2963 [details]
Patch to modify configure.in

In the compile test to check for EGL, gbm.h must be included to
satisfy the EGL/eglplatform.h check #elif defined(__GBM__) when libdrm and gbm is used with MESA OpenGLES.

This will then define SDL_VIDEO_OPENGL_EGL which is checked in the drmkms driver.  It will also correctly typedef EGLNativeDisplayType,
EGLNativePixmapType and EGLNativeWindowType.

Tested with testgles and testgles2 on RaspberryPi3 with
libdrm, VC4 gallium driver and Mesa 17.2.1

The same change should be made for CMakeLists.txt and sdlchecks.make.

The attached patch only serves to illustrate the problem with a crude fix.  The bottom line is that in the compile tests for EGL, gbm.h needs to be included when using DRMKMS, else OpenGles will not work.