summaryrefslogtreecommitdiff
path: root/src/egl/drivers/dri2
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2017-10-18 20:23:00 +0200
committerMarek Olšák <marek.olsak@amd.com>2017-10-18 20:23:42 +0200
commit84f3afc2e122cb418573f1e9c61716520f9859c1 (patch)
treefd8f3bbc2b7f5eeb905a5699cf0f5bdec59f95d0 /src/egl/drivers/dri2
parent2cb9ab53dd3ae6850a2611b01695f7449d24614d (diff)
Revert "egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}"
This reverts commit 8cb84c8477a57ed05d703669fee1770f31b76ae6. This fixes crashing shader-db/run.
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 0750dc1946..d7a88b2984 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -3191,11 +3191,16 @@ dri2_interop_export_object(_EGLDisplay *dpy, _EGLContext *ctx,
/**
* This is the main entrypoint into the driver, called by libEGL.
- * Gets an _EGLDriver object and init its dispatch table.
+ * Create a new _EGLDriver object and init its dispatch table.
*/
-void
-_eglInitDriver(_EGLDriver *dri2_drv)
+_EGLDriver *
+_eglBuiltInDriver(void)
{
+ _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;
@@ -3246,4 +3251,6 @@ _eglInitDriver(_EGLDriver *dri2_drv)
dri2_drv->API.DupNativeFenceFDANDROID = dri2_dup_native_fence_fd;
dri2_drv->Name = "DRI2";
+
+ return dri2_drv;
}