diff options
-rw-r--r-- | glamor/glamor_egl.c | 4 | ||||
-rw-r--r-- | glamor/glamor_egl.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 9cc0f8d6e..4bde637a0 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -769,6 +769,10 @@ glamor_egl_init(ScrnInfoPtr scrn, int fd) glamor_egl->display = glamor_egl_get_display(EGL_PLATFORM_GBM_MESA, glamor_egl->gbm); + if (!glamor_egl->display) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, "eglGetDisplay() failed\n"); + goto error; + } #else glamor_egl->display = eglGetDisplay((EGLNativeDisplayType) (intptr_t) fd); #endif diff --git a/glamor/glamor_egl.h b/glamor/glamor_egl.h index 6b05f576f..6bb1185bf 100644 --- a/glamor/glamor_egl.h +++ b/glamor/glamor_egl.h @@ -60,16 +60,12 @@ static inline EGLDisplay glamor_egl_get_display(EGLint type, void *native) { - EGLDisplay dpy = NULL; - /* In practise any EGL 1.5 implementation would support the EXT extension */ if (epoxy_has_egl_extension(NULL, "EGL_EXT_platform_base")) { PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT = (void *) eglGetProcAddress("eglGetPlatformDisplayEXT"); if (getPlatformDisplayEXT) - dpy = getPlatformDisplayEXT(type, native, NULL); - if (dpy) - return dpy; + return getPlatformDisplayEXT(type, native, NULL); } /* Welp, everything is awful. */ |