From 0eaa02c836821556c1e8d0141f49f57e23f2548d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 13 Aug 2009 13:01:48 +0800 Subject: egl: Change the way drivers are loaded. Driver is chosen and preloaded when eglGetDisplay is called. Later when eglInitialize is called, the same driver is matched to initialize the display. Also, add new, but unused, hooks to EGLDriver to allow a driver to probe a display or unload itself. Signed-off-by: Chia-I Wu --- src/egl/main/egldriver.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/egl/main/egldriver.h') diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index d97a24db1d..430c0949d4 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -27,8 +27,14 @@ struct _egl_driver EGLBoolean Initialized; /**< set by driver after initialized */ void *LibHandle; /**< dlopen handle */ + const char *Path; /**< path to this driver */ + const char *Args; /**< args to load this driver */ const char *Name; /**< name of this driver */ + /**< probe a display to see if it is supported */ + EGLBoolean (*Probe)(_EGLDriver *drv, _EGLDisplay *dpy); + /**< called before dlclose to release this driver */ + void (*Unload)(_EGLDriver *drv); int APImajor, APIminor; /**< as returned by eglInitialize() */ char Version[1000]; /**< initialized from APImajor/minor, Name */ @@ -50,20 +56,21 @@ extern _EGLDriver *_eglMain(_EGLDisplay *dpy, const char *args); extern const char * _eglChooseDRMDriver(int card); + extern const char * -_eglChooseDriver(_EGLDisplay *dpy); +_eglPreloadDriver(_EGLDisplay *dpy); extern _EGLDriver * -_eglOpenDriver(_EGLDisplay *dpy, const char *driverName, const char *args); +_eglOpenDriver(_EGLDisplay *dpy); extern EGLBoolean _eglCloseDriver(_EGLDriver *drv, _EGLDisplay *dpy); -extern void -_eglSaveDriver(_EGLDriver *drv); +void +_eglUnloadDrivers(void); extern _EGLDriver * -- cgit v1.2.3