6a5237476473b25fc0849bf3761b12f1c16e7e51
1 #ifndef EGLDRIVER_INCLUDED
2 #define EGLDRIVER_INCLUDED
5 #include "egltypedefs.h"
6 #include "egldisplay.h"
11 * Define an inline driver typecast function.
13 * Note that this macro defines a function and should not be ended with a
14 * semicolon when used.
16 #define _EGL_DRIVER_TYPECAST(drvtype, egltype, code) \
17 static INLINE struct drvtype *drvtype(const egltype *obj) \
18 { return (struct drvtype *) code; }
22 * Define the driver typecast functions for _EGLDriver, _EGLDisplay,
23 * _EGLContext, _EGLSurface, and _EGLConfig.
25 * Note that this macro defines several functions and should not be ended with
26 * a semicolon when used.
28 #define _EGL_DRIVER_STANDARD_TYPECASTS(drvname) \
29 _EGL_DRIVER_TYPECAST(drvname ## _driver, _EGLDriver, obj) \
30 /* note that this is not a direct cast */ \
31 _EGL_DRIVER_TYPECAST(drvname ## _display, _EGLDisplay, obj->DriverData) \
32 _EGL_DRIVER_TYPECAST(drvname ## _context, _EGLContext, obj) \
33 _EGL_DRIVER_TYPECAST(drvname ## _surface, _EGLSurface, obj) \
34 _EGL_DRIVER_TYPECAST(drvname ## _config, _EGLConfig, obj)
37 typedef _EGLDriver
*(*_EGLMain_t
)(const char *args
);
41 * Base class for device drivers.
45 void *LibHandle
; /**< dlopen handle */
46 const char *Path
; /**< path to this driver */
47 const char *Args
; /**< args to load this driver */
49 const char *Name
; /**< name of this driver */
52 * Probe a display and return a score.
55 * 50 means the driver supports the display;
56 * 90 means the driver can accelerate the display;
57 * 100 means a perfect match.
59 EGLint (*Probe
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
);
62 * Release the driver resource.
64 * It is called before dlclose().
66 void (*Unload
)(_EGLDriver
*drv
);
68 _EGLAPI API
; /**< EGL API dispatch table */
73 _eglMain(const char *args
);
77 _eglMatchDriver(_EGLDisplay
*dpy
);
81 _eglPreloadDrivers(void);
85 _eglUnloadDrivers(void);
89 _eglLoadDefaultDriver(EGLDisplay dpy
, EGLint
*major
, EGLint
*minor
);
92 extern _EGLPlatformType
93 _eglGetNativePlatform(void);
97 _eglInitDriverFallbacks(_EGLDriver
*drv
);
101 _eglSearchPathForEach(EGLBoolean (*callback
)(const char *, size_t, void *),
102 void *callback_data
);
106 _eglSetProbeCache(EGLint key
, const void *val
);
110 _eglGetProbeCache(EGLint key
);
113 #endif /* EGLDRIVER_INCLUDED */