-
-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
egl/display: ensure provider after version check #1690
Conversation
See comments in `Display::sanitize_libglvnd_aliasing`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably fit a more descriptive title than "aliasing issue" without going over any character limit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need a changelog entry for this.
Documented changes made by the PR.
Done! |
libglvnd
aliasing issue for EGL.libglvnd
aliasing eglGetPlatformDisplay
and eglGetPlatformDisplayEXT
and causing errors at surface creation due to use of KHR functions when the EGL version for the dispaly is 1.4.
Rephrased from "fix" to "workaround".
https://registry.khronos.org/EGL/sdk/docs/man/html/eglQueryString.xhtml It's unfortunate that we cannot use |
Reading somewhat further, we don't ever check if https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_client_extensions.txt works and following that, https://registry.khronos.org/EGL/extensions/EXT/EGL_EXT_platform_base.txt is available before calling |
If by call you mean querying the client extensions, then, as far I can see, |
… comments inside the sanitization function
Yes I mean us calling I was wondering if we could use something like that to detect and prevent the failure case from happening (by never calling Also, reading back the PR description, can you reword it to provide a summary of both the problem and proposed solution, rather than linking through to an 18-comment-dense issue thread "for further details"? |
Could also link to upstream issue I've just opened. |
Co-authored-by: Marijn Suijten <marijns95@gmail.com>
Co-authored-by: Marijn Suijten <marijns95@gmail.com>
…s in the comments for the sanitization function
Sure, relevant information provided. |
Apologies in advance for being so messy @janKilika - it looks like we're in a situation where we're deciding whether and how the current workaround is sensible or could be written in a different way (while also reviewing the existing implementation) while I'm also suggesting light changes on the current workaround and comments (which could be superseded by the former) 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review based on upstream interactions.
…comments in accord with the requested changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope that this is the last one.
libglvnd
aliasing eglGetPlatformDisplay
and eglGetPlatformDisplayEXT
and causing errors at surface creation due to use of KHR functions when the EGL version for the dispaly is 1.4.
Issue addressed: EGL's
Display::new
making aKhr
display (those are only valid for 1.5) when EGL version for the platform is actually 1.4, which causes errors when 1.5 surface creation is attempted afterwards. Caused bylibglvnd
"aliasing"eglGetPlatformDisplay
andeglGetPlatformDisplayEXT
(as in both functions call the same vendor function internally), which makes the former succeed and create a display that is only valid as anExt
display despite what otherwise would be expected according to specification.Solution: Check for the version after performing an
eglInitialize
call, as it returns the actual version for the platform's implementation of EGL and therefore enables us to detect whether the aliasing issue occurred and downgrade the display fromKhr
toExt
if it did.Changes: The only actual change is that it is checked in
Display::initialize_display
with theDisplay::sanitize_libglvnd_aliasing
function whether (a)EglDisplay
is of variantKhr
and (b) version is equal to 1.4, and if both conditions are true,EglDisplay
is downgraded fromKhr
toExt
. This seems to be safe, aseglGetPlatformDisplay
andeglGetPlatformDisplayEXT
in practice are made to be aliases of each other bylibglvnd
, and if any of the attributes passed are invalid for the underlying function, it is presumed that it would return with an error.See issue #1689 for further details.
Also see issue #251 on
libglvnd
's repository.