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