egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}
[mesa.git] / src / egl / drivers / dri2 / egl_dri2.c
index 8b482c90be0e04668fd554e571be48f0fa366d04..e38459de0b138a764d7897f7f2a40edc305f1c1d 100644 (file)
@@ -3255,16 +3255,11 @@ dri2_interop_export_object(_EGLDisplay *dpy, _EGLContext *ctx,
 
 /**
  * This is the main entrypoint into the driver, called by libEGL.
- * Create a new _EGLDriver object and init its dispatch table.
+ * Gets an _EGLDriver object and init its dispatch table.
  */
-_EGLDriver *
-_eglBuiltInDriver(void)
+void
+_eglInitDriver(_EGLDriver *dri2_drv)
 {
-   _EGLDriver *dri2_drv = calloc(1, sizeof *dri2_drv);
-   if (!dri2_drv)
-      return NULL;
-
-   _eglInitDriverFallbacks(dri2_drv);
    dri2_drv->API.Initialize = dri2_initialize;
    dri2_drv->API.Terminate = dri2_terminate;
    dri2_drv->API.CreateContext = dri2_create_context;
@@ -3316,6 +3311,4 @@ _eglBuiltInDriver(void)
    dri2_drv->API.SetBlobCacheFuncsANDROID = dri2_set_blob_cache_funcs;
 
    dri2_drv->Name = "DRI2";
-
-   return dri2_drv;
 }