Skip to content
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

wlc: Use eglGetPlatformDisplayEXT where available #233

Merged
merged 1 commit into from
Jan 31, 2017

Conversation

jwrdegoede
Copy link
Contributor

eglGetDisplay does not know what sort of handle it is getting passed
in (a gbm device handle or an X11 display pointer) on systems without
glvnd some poking into internal X11 / gbm structures is used to figure
this out, which is somewhat dangerous but works.

On system using glvnd this does not work and eglGetDisplay returns NULL.

This commit makes wlc track the EGLNativeDisplayType pointer's
underlying type and uses eglGetPlatformDisplayEXT where available so
that the EGL implementation does not need to guess the type of the
handle it is being passed.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1413579
Signed-off-by: Hans de Goede hdegoede@redhat.com

eglGetDisplay does not know what sort of handle it is getting passed
in (a gbm device handle or an X11 display pointer) on systems without
glvnd some poking into internal X11 / gbm structures is used to figure
this out, which is somewhat dangerous but works.

On system using glvnd this does not work and eglGetDisplay returns NULL.

This commit makes wlc track the EGLNativeDisplayType pointer's
underlying type and uses eglGetPlatformDisplayEXT where available so
that the EGL implementation does not need to guess the type of the
handle it is being passed.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1413579
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
static EGLDisplay
get_display(struct ctx *context, EGLint type, void *native)
{
PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this accidental duplicate definition? Otherwise this looks quite good. Scary but good :)

@jwrdegoede
Copy link
Contributor Author

jwrdegoede commented Jan 31, 2017 via email

@Cloudef Cloudef merged commit 813d519 into Cloudef:master Jan 31, 2017
@Cloudef Cloudef mentioned this pull request Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants