summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl/egl_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/egl/egl_context.c')
-rw-r--r--src/gallium/state_trackers/egl/egl_context.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/egl/egl_context.c b/src/gallium/state_trackers/egl/egl_context.c
index 36548fae26..e2da2180f7 100644
--- a/src/gallium/state_trackers/egl/egl_context.c
+++ b/src/gallium/state_trackers/egl/egl_context.c
@@ -113,9 +113,9 @@ drm_create_context(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext
if (!ctx)
goto err_c;
- _eglInitContext(drv, dpy, &ctx->base, config, attrib_list);
+ _eglInitContext(drv, &ctx->base, conf, attrib_list);
- ctx->pipe = drm_api_hooks.create_context(dev->screen);
+ ctx->pipe = dev->api->create_context(dev->api, dev->screen);
if (!ctx->pipe)
goto err_pipe;
@@ -129,8 +129,8 @@ drm_create_context(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext
if (!ctx->st)
goto err_gl;
- /* generate handle and insert into hash table */
- _eglSaveContext(&ctx->base);
+ /* link to display */
+ _eglLinkContext(&ctx->base, _eglLookupDisplay(dpy));
assert(_eglGetContextHandle(&ctx->base));
return _eglGetContextHandle(&ctx->base);
@@ -147,10 +147,8 @@ EGLBoolean
drm_destroy_context(_EGLDriver *drv, EGLDisplay dpy, EGLContext context)
{
struct drm_context *c = lookup_drm_context(context);
- _eglRemoveContext(&c->base);
- if (c->base.IsBound) {
- c->base.DeletePending = EGL_TRUE;
- } else {
+ _eglUnlinkContext(&c->base);
+ if (!c->base.IsBound) {
st_destroy_context(c->st);
c->pipe->destroy(c->pipe);
free(c);