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 4349 - [patch] SDL_CreateWindow fails with KMS/DRM after upgrading Mesa to 18.2.3
Summary: [patch] SDL_CreateWindow fails with KMS/DRM after upgrading Mesa to 18.2.3
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-31 19:41 UTC by Rainer Sabelka
Modified: 2018-10-31 22:17 UTC (History)
0 users

See Also:


Attachments
fix eglChooseConfig(), ignore all configuartions without an matching EGL_NATIVE_VISUAL_ID" (2.93 KB, patch)
2018-10-31 19:41 UTC, Rainer Sabelka
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Sabelka 2018-10-31 19:41:47 UTC
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.
Comment 1 Sam Lantinga 2018-10-31 22:17:09 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/cfc65d4d49ae