Revert "egl: move alloc & init out of _eglBuiltInDriver{DRI2,Haiku}"
This reverts commit 8cb84c8477
.
This fixes crashing shader-db/run.
This commit is contained in:
@@ -19,12 +19,13 @@ Bootstrapping:
|
||||
When the apps calls eglInitialize() a device driver is selected and loaded
|
||||
(look for _eglAddDrivers() and _eglLoadModule() in egldriver.c).
|
||||
|
||||
The built-in driver's entry point function is then called and given
|
||||
a freshly allocated and initialised _EGLDriver, with default fallback
|
||||
entrypoints set.
|
||||
The built-in driver's entry point function is then called. This driver function
|
||||
allocates, initializes and returns a new _EGLDriver object (usually a
|
||||
subclass of that type).
|
||||
|
||||
As part of initialization, the dispatch table in _EGLDriver->API must be
|
||||
populated with all the EGL entrypoints. Some functions like
|
||||
populated with all the EGL entrypoints. Typically, _eglInitDriverFallbacks()
|
||||
can be used to plug in default/fallback functions. Some functions like
|
||||
driver->API.Initialize and driver->API.Terminate _must_ be implemented
|
||||
with driver-specific code (no default/fallback function is possible).
|
||||
|
||||
|
@@ -54,12 +54,8 @@ _eglGetDriver(void)
|
||||
{
|
||||
mtx_lock(&_eglModuleMutex);
|
||||
|
||||
if (!_eglDriver) {
|
||||
_eglDriver = calloc(1, sizeof(*_eglDriver));
|
||||
if (!_eglDriver)
|
||||
return NULL;
|
||||
_eglInitDriver(_eglDriver);
|
||||
}
|
||||
if (!_eglDriver)
|
||||
_eglDriver = _eglBuiltInDriver();
|
||||
|
||||
mtx_unlock(&_eglModuleMutex);
|
||||
|
||||
|
@@ -81,8 +81,8 @@ struct _egl_driver
|
||||
};
|
||||
|
||||
|
||||
extern void
|
||||
_eglInitDriver(_EGLDriver *driver);
|
||||
extern _EGLDriver*
|
||||
_eglBuiltInDriver(void);
|
||||
|
||||
|
||||
extern _EGLDriver *
|
||||
|
Reference in New Issue
Block a user