egl: Move context functions in egldisplay.[ch] to eglcontext.[ch].
[mesa.git] / src / egl / main / egldisplay.c
index 896d60dbe1027140318c8ce239c210aebef8c100..e14d0c1b63b94b54924cecb3885cfbd26b7d297c 100644 (file)
@@ -39,36 +39,6 @@ _eglFiniDisplay(void)
 }
 
 
-/**
- * If the first character is '!' we interpret it as specific driver name
- * (i.e. "!r200" or "!i830").  Whatever follows ':' is interpreted as
- * arguments.
- *
- * The caller may free() the returned driver name.
- */
-char *
-_eglSplitDisplayString(const char *dpyString, const char **args)
-{
-   char *drv, *p;
-
-   if (!dpyString || dpyString[0] != '!')
-      return NULL;
-   drv = _eglstrdup(dpyString + 1);
-   if (!drv)
-      return NULL;
-
-   p = strchr(dpyString, ':');
-   if (p) {
-      drv[p - dpyString] = '\0';
-      p++;
-   }
-   if (args)
-      *args = p;
-
-   return drv;
-}
-
-
 /**
  * Allocate a new _EGLDisplay object for the given nativeDisplay handle.
  * We'll also try to determine the device driver name at this time.
@@ -81,12 +51,6 @@ _eglNewDisplay(NativeDisplayType nativeDisplay)
    _EGLDisplay *dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay));
    if (dpy) {
       dpy->NativeDisplay = nativeDisplay;
-
-      dpy->DriverName = _eglPreloadDriver(dpy);
-      if (!dpy->DriverName) {
-         free(dpy);
-         return NULL;
-      }
    }
    return dpy;
 }
@@ -218,48 +182,6 @@ _eglCleanupDisplay(_EGLDisplay *disp)
 }
 
 
-/**
- * Link a context to a display and return the handle of the link.
- * The handle can be passed to client directly.
- */
-EGLContext
-_eglLinkContext(_EGLContext *ctx, _EGLDisplay *dpy)
-{
-   ctx->Display = dpy;
-   ctx->Next = dpy->ContextList;
-   dpy->ContextList = ctx;
-   return (EGLContext) ctx;
-}
-
-
-/**
- * Unlink a linked context from its display.
- * Accessing an unlinked context should generate EGL_BAD_CONTEXT error.
- */
-void
-_eglUnlinkContext(_EGLContext *ctx)
-{
-   _EGLContext *prev;
-
-   prev = ctx->Display->ContextList;
-   if (prev != ctx) {
-      while (prev) {
-         if (prev->Next == ctx)
-            break;
-         prev = prev->Next;
-      }
-      assert(prev);
-      prev->Next = ctx->Next;
-   }
-   else {
-      ctx->Display->ContextList = ctx->Next;
-   }
-
-   ctx->Next = NULL;
-   ctx->Display = NULL;
-}
-
-
 /**
  * Link a surface to a display and return the handle of the link.
  * The handle can be passed to client directly.
@@ -326,27 +248,6 @@ _eglCheckDisplayHandle(EGLDisplay dpy)
 }
 
 
-/**
- * Return EGL_TRUE if the given handle is a valid handle to a context.
- */
-EGLBoolean
-_eglCheckContextHandle(EGLContext ctx, _EGLDisplay *dpy)
-{
-   _EGLContext *cur = NULL;
-
-   if (dpy)
-      cur = dpy->ContextList;
-   while (cur) {
-      if (cur == (_EGLContext *) ctx) {
-         assert(cur->Display == dpy);
-         break;
-      }
-      cur = cur->Next;
-   }
-   return (cur != NULL);
-}
-
-
 /**
  * Return EGL_TRUE if the given handle is a valid handle to a surface.
  */