| Summary: | [patch] SDL_CreateWindow fails with KMS/DRM after upgrading Mesa to 18.2.3 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Rainer Sabelka <saba> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | fix eglChooseConfig(), ignore all configuartions without an matching EGL_NATIVE_VISUAL_ID" | ||
Patch added, thanks! https://hg.libsdl.org/SDL/rev/cfc65d4d49ae |
Created attachment 3429 [details] fix eglChooseConfig(), ignore all configuartions without an matching EGL_NATIVE_VISUAL_ID" After I did an upgrade of my arch Linux installation (resulting in an update of Mesa to version 18.2.3), all my SDL2 applications which use the KMS/DRM driver stopped working. Reason: Creating a Window with SDL_CreateWindow failed because the call to EGL eglCreateWindowSurface() returns an error "EGL_BAD_MATCH". After investigating with the debugger I figured, that the configuration, which has been selected from the output of eglChooseConfig(), has an "EGL_NATIVE_VISUAL_ID" which does not match the "format" of the underlying gbm surface. The attached patch fixes the problem. It does so, by mimicking Weston's behavior. All configurations returned from eglChooseConfig() which have an visual_id different from the gbm format are discarded, and only from the remaining ones the "best" match is selected.