summaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldriver.h
blob: 5149acd9640e300736fec1be1380bd60b1b47374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef EGLDRIVER_INCLUDED
#define EGLDRIVER_INCLUDED


#include "egltypedefs.h"
#include "eglapi.h"


typedef _EGLDriver *(*_EGLMain_t)(const char *args);


/**
 * Base class for device drivers.
 */
struct _egl_driver
{
   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 and return a score.
    *
    * Roughly,
    *  50 means the driver supports the display;
    *  90 means the driver can accelerate the display;
    * 100 means a perfect match.
    */
   EGLint (*Probe)(_EGLDriver *drv, _EGLDisplay *dpy);

   /**
    * Release the driver resource.
    *
    * It is called before dlclose().
    */
   void (*Unload)(_EGLDriver *drv);

   _EGLAPI API;  /**< EGL API dispatch table */
};


PUBLIC _EGLDriver *
_eglMain(const char *args);


extern _EGLDriver *
_eglMatchDriver(_EGLDisplay *dpy);


extern EGLBoolean
_eglPreloadDrivers(void);


extern void
_eglUnloadDrivers(void);


PUBLIC void
_eglInitDriverFallbacks(_EGLDriver *drv);


PUBLIC void
_eglSetProbeCache(EGLint key, const void *val);


PUBLIC const void *
_eglGetProbeCache(EGLint key);


#endif /* EGLDRIVER_INCLUDED */