summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/egl_xlib/egl_xlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/egl_xlib/egl_xlib.c')
-rw-r--r--src/gallium/winsys/egl_xlib/egl_xlib.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/winsys/egl_xlib/egl_xlib.c b/src/gallium/winsys/egl_xlib/egl_xlib.c
index c10e3c00ff..9914dff964 100644
--- a/src/gallium/winsys/egl_xlib/egl_xlib.c
+++ b/src/gallium/winsys/egl_xlib/egl_xlib.c
@@ -345,7 +345,7 @@ xlib_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
return EGL_NO_CONTEXT;
/* let EGL lib init the common stuff */
- if (!_eglInitContext(drv, dpy, &ctx->Base, config, attrib_list)) {
+ if (!_eglInitContext(drv, &ctx->Base, conf, attrib_list)) {
free(ctx);
return EGL_NO_CONTEXT;
}
@@ -370,7 +370,7 @@ xlib_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
return EGL_NO_CONTEXT;
}
- _eglSaveContext(&ctx->Base);
+ _eglLinkContext(&ctx->Base, _eglLookupDisplay(dpy));
return _eglGetContextHandle(&ctx->Base);
}
@@ -381,6 +381,7 @@ xlib_eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx)
{
struct xlib_egl_context *context = lookup_context(ctx);
if (context) {
+ _eglUnlinkContext(&context->Base);
if (context->Base.IsBound) {
context->Base.DeletePending = EGL_TRUE;
}
@@ -491,13 +492,13 @@ xlib_eglCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
return EGL_NO_SURFACE;
/* Let EGL lib init the common stuff */
- if (!_eglInitSurface(drv, dpy, &surf->Base, EGL_WINDOW_BIT,
- config, attrib_list)) {
+ if (!_eglInitSurface(drv, &surf->Base, EGL_WINDOW_BIT,
+ conf, attrib_list)) {
free(surf);
return EGL_NO_SURFACE;
}
- _eglSaveSurface(&surf->Base);
+ _eglLinkSurface(&surf->Base, disp);
/*
* Now init the Xlib and gallium stuff
@@ -534,7 +535,7 @@ xlib_eglDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface)
{
struct xlib_egl_surface *surf = lookup_surface(surface);
if (surf) {
- _eglHashRemove(_eglGlobal.Surfaces, (EGLuint) surface);
+ _eglUnlinkSurface(&surf->Base);
if (surf->Base.IsBound) {
surf->Base.DeletePending = EGL_TRUE;
}