summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglapi.c')
-rw-r--r--src/egl/main/eglapi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c
index eaee9facd82..f0a6f7f9355 100644
--- a/src/egl/main/eglapi.c
+++ b/src/egl/main/eglapi.c
@@ -51,9 +51,12 @@ eglGetDisplay(NativeDisplayType nativeDisplay)
{
_EGLDisplay *dpy;
_eglInitGlobals();
- dpy = _eglNewDisplay(nativeDisplay);
- if (dpy)
- _eglLinkDisplay(dpy);
+ dpy = _eglFindDisplay(nativeDisplay);
+ if (!dpy) {
+ dpy = _eglNewDisplay(nativeDisplay);
+ if (dpy)
+ _eglLinkDisplay(dpy);
+ }
return _eglGetDisplayHandle(dpy);
}