summaryrefslogtreecommitdiff
path: root/src/egl/drivers/glx
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/drivers/glx')
-rw-r--r--src/egl/drivers/glx/Makefile2
-rw-r--r--src/egl/drivers/glx/egl_glx.c48
2 files changed, 29 insertions, 21 deletions
diff --git a/src/egl/drivers/glx/Makefile b/src/egl/drivers/glx/Makefile
index 5f041a268f..20ef0352ad 100644
--- a/src/egl/drivers/glx/Makefile
+++ b/src/egl/drivers/glx/Makefile
@@ -58,7 +58,7 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(OBJECTS)
install:
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
- $(INSTALL) $(TOP)/$(LIB_DIR)/$(DRIVER_NAME) $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(MINSTALL) $(TOP)/$(LIB_DIR)/$(DRIVER_NAME) $(DESTDIR)$(INSTALL_LIB_DIR)
clean:
rm -f *.o
diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c
index 155caa413c..207b1ea779 100644
--- a/src/egl/drivers/glx/egl_glx.c
+++ b/src/egl/drivers/glx/egl_glx.c
@@ -532,7 +532,10 @@ GLX_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
if (!GLX_ctx)
return EGL_NO_CONTEXT;
- if (!_eglInitContext(drv, dpy, &GLX_ctx->Base, config, attrib_list)) {
+ conf = _eglLookupConfig(drv, dpy, config);
+ assert(conf);
+
+ if (!_eglInitContext(drv, &GLX_ctx->Base, conf, attrib_list)) {
free(GLX_ctx);
return EGL_NO_CONTEXT;
}
@@ -546,9 +549,6 @@ GLX_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
GLX_ctx_shared = GLX_egl_context(shareCtx);
}
- conf = _eglLookupConfig(drv, dpy, config);
- assert(conf);
-
#ifdef GLX_VERSION_1_3
if (GLX_drv->fbconfigs)
GLX_ctx->context = glXCreateNewContext(disp->Xdpy, GLX_drv->fbconfigs[(int)config-1], GLX_RGBA_TYPE, GLX_ctx_shared ? GLX_ctx_shared->context : NULL, GL_TRUE);
@@ -564,7 +564,7 @@ GLX_eglCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
return EGL_FALSE;
#endif
- return _eglGetContextHandle(&GLX_ctx->Base);
+ return _eglLinkContext(&GLX_ctx->Base, disp);
}
@@ -619,18 +619,22 @@ GLX_eglCreateWindowSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
_EGLDisplay *disp = _eglLookupDisplay(dpy);
struct GLX_egl_surface *GLX_surf;
uint width, height;
+ _EGLConfig *conf;
+
+ conf = _eglLookupConfig(drv, dpy, config);
+ assert(conf);
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf)
return EGL_NO_SURFACE;
- if (!_eglInitSurface(drv, dpy, &GLX_surf->Base, EGL_WINDOW_BIT,
- config, attrib_list)) {
+ if (!_eglInitSurface(drv, &GLX_surf->Base, EGL_WINDOW_BIT,
+ conf, attrib_list)) {
free(GLX_surf);
return EGL_FALSE;
}
- _eglSaveSurface(&GLX_surf->Base);
+ _eglLinkSurface(&GLX_surf->Base, disp);
GLX_surf->drawable = window;
get_drawable_size(disp->Xdpy, window, &width, &height);
@@ -648,19 +652,23 @@ GLX_eglCreatePixmapSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
_EGLDisplay *disp = _eglLookupDisplay(dpy);
struct GLX_egl_surface *GLX_surf;
+ _EGLConfig *conf;
int i;
+ conf = _eglLookupConfig(drv, dpy, config);
+ assert(conf);
+
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf)
return EGL_NO_SURFACE;
- if (!_eglInitSurface(drv, dpy, &GLX_surf->Base, EGL_PIXMAP_BIT,
- config, attrib_list)) {
+ if (!_eglInitSurface(drv, &GLX_surf->Base, EGL_PIXMAP_BIT,
+ conf, attrib_list)) {
free(GLX_surf);
return EGL_FALSE;
}
- _eglSaveSurface(&GLX_surf->Base);
+ _eglLinkSurface(&GLX_surf->Base, disp);
for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
switch (attrib_list[i]) {
@@ -683,20 +691,24 @@ GLX_eglCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);
_EGLDisplay *disp = _eglLookupDisplay(dpy);
struct GLX_egl_surface *GLX_surf;
+ _EGLConfig *conf;
int attribs[5];
int i = 0, j = 0;
+ conf = _eglLookupConfig(drv, dpy, config);
+ assert(conf);
+
GLX_surf = CALLOC_STRUCT(GLX_egl_surface);
if (!GLX_surf)
return EGL_NO_SURFACE;
- if (!_eglInitSurface(drv, dpy, &GLX_surf->Base, EGL_PBUFFER_BIT,
- config, attrib_list)) {
+ if (!_eglInitSurface(drv, &GLX_surf->Base, EGL_PBUFFER_BIT,
+ conf, attrib_list)) {
free(GLX_surf);
return EGL_NO_SURFACE;
}
- _eglSaveSurface(&GLX_surf->Base);
+ _eglLinkSurface(&GLX_surf->Base, disp);
while(attrib_list[i] != EGL_NONE) {
switch (attrib_list[i]) {
@@ -726,13 +738,9 @@ GLX_eglDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface)
_EGLSurface *surf = _eglLookupSurface(surface);
return EGL_TRUE;
if (surf) {
- _eglHashRemove(_eglGlobal.Surfaces, (EGLuint) surface);
- if (surf->IsBound) {
- surf->DeletePending = EGL_TRUE;
- }
- else {
+ _eglUnlinkSurface(surf);
+ if (!surf->IsBound)
free(surf);
- }
return EGL_TRUE;
}