egl: Change the way drivers are loaded.
[mesa.git] / src / egl / main / egldriver.h
1 #ifndef EGLDRIVER_INCLUDED
2 #define EGLDRIVER_INCLUDED
3
4
5 #include "egltypedefs.h"
6 #include "eglapi.h"
7 #include "egldefines.h"
8
9
10 /**
11 * Optional EGL extensions info.
12 */
13 struct _egl_extensions
14 {
15 EGLBoolean MESA_screen_surface;
16 EGLBoolean MESA_copy_context;
17
18 char String[_EGL_MAX_EXTENSIONS_LEN];
19 };
20
21
22 /**
23 * Base class for device drivers.
24 */
25 struct _egl_driver
26 {
27 EGLBoolean Initialized; /**< set by driver after initialized */
28
29 void *LibHandle; /**< dlopen handle */
30 const char *Path; /**< path to this driver */
31 const char *Args; /**< args to load this driver */
32
33 const char *Name; /**< name of this driver */
34 /**< probe a display to see if it is supported */
35 EGLBoolean (*Probe)(_EGLDriver *drv, _EGLDisplay *dpy);
36 /**< called before dlclose to release this driver */
37 void (*Unload)(_EGLDriver *drv);
38
39 int APImajor, APIminor; /**< as returned by eglInitialize() */
40 char Version[1000]; /**< initialized from APImajor/minor, Name */
41
42 /** Bitmask of supported APIs (EGL_xx_BIT) set by the driver during init */
43 EGLint ClientAPIsMask;
44
45 _EGLAPI API; /**< EGL API dispatch table */
46
47 _EGLExtensions Extensions;
48
49 int LargestPbuffer;
50 };
51
52
53 extern _EGLDriver *_eglMain(_EGLDisplay *dpy, const char *args);
54
55
56 extern const char *
57 _eglChooseDRMDriver(int card);
58
59
60 extern const char *
61 _eglPreloadDriver(_EGLDisplay *dpy);
62
63
64 extern _EGLDriver *
65 _eglOpenDriver(_EGLDisplay *dpy);
66
67
68 extern EGLBoolean
69 _eglCloseDriver(_EGLDriver *drv, _EGLDisplay *dpy);
70
71
72 void
73 _eglUnloadDrivers(void);
74
75
76 extern _EGLDriver *
77 _eglLookupDriver(EGLDisplay d);
78
79
80 extern void
81 _eglInitDriverFallbacks(_EGLDriver *drv);
82
83
84 extern EGLint
85 _eglFindAPIs(void);
86
87
88 #endif /* EGLDRIVER_INCLUDED */