egl: Improve driver matching.
[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
8
9 /**
10 * Base class for device drivers.
11 */
12 struct _egl_driver
13 {
14 void *LibHandle; /**< dlopen handle */
15 const char *Path; /**< path to this driver */
16 const char *Args; /**< args to load this driver */
17
18 const char *Name; /**< name of this driver */
19
20 /**
21 * Probe a display and return a score.
22 *
23 * Roughly,
24 * 50 means the driver supports the display;
25 * 90 means the driver can accelerate the display;
26 * 100 means a perfect match.
27 */
28 EGLint (*Probe)(_EGLDriver *drv, _EGLDisplay *dpy);
29
30 /**
31 * Release the driver resource.
32 *
33 * It is called before dlclose().
34 */
35 void (*Unload)(_EGLDriver *drv);
36
37 _EGLAPI API; /**< EGL API dispatch table */
38 };
39
40
41 PUBLIC _EGLDriver *
42 _eglMain(const char *args);
43
44
45 extern _EGLDriver *
46 _eglOpenDriver(_EGLDisplay *dpy);
47
48
49 extern EGLBoolean
50 _eglCloseDriver(_EGLDriver *drv, _EGLDisplay *dpy);
51
52
53 extern EGLBoolean
54 _eglPreloadDrivers(void);
55
56
57 extern void
58 _eglUnloadDrivers(void);
59
60
61 PUBLIC void
62 _eglInitDriverFallbacks(_EGLDriver *drv);
63
64
65 PUBLIC EGLint
66 _eglFindAPIs(void);
67
68
69 #endif /* EGLDRIVER_INCLUDED */