virgl/egl: add support for native platform interface.

This fixes vtest on glvnd.

Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Dave Airlie 7 years ago
parent 737c335085
commit 74fd068175
  1. 21
      src/virgl_egl_context.c

@ -155,7 +155,26 @@ struct virgl_egl *virgl_egl_init(void)
if (!d->gbm_dev)
goto fail;
d->egl_display = eglGetDisplay((EGLNativeDisplayType)d->gbm_dev);
const char *client_extensions = eglQueryString (NULL, EGL_EXTENSIONS);
if (strstr (client_extensions, "EGL_KHR_platform_base")) {
PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
(PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress ("eglGetPlatformDisplay");
if (get_platform_display)
d->egl_display = get_platform_display (EGL_PLATFORM_GBM_KHR,
(EGLNativeDisplayType)d->gbm_dev, NULL);
} else if (strstr (client_extensions, "EGL_EXT_platform_base")) {
PFNEGLGETPLATFORMDISPLAYEXTPROC get_platform_display =
(PFNEGLGETPLATFORMDISPLAYEXTPROC) eglGetProcAddress ("eglGetPlatformDisplayEXT");
if (get_platform_display)
d->egl_display = get_platform_display (EGL_PLATFORM_GBM_KHR,
(EGLNativeDisplayType)d->gbm_dev, NULL);
} else {
d->egl_display = eglGetDisplay((EGLNativeDisplayType)d->gbm_dev);
}
if (!d->egl_display)
goto fail;

Loading…
Cancel
Save