From cf22fd5e5b13ccdb02ba0368ea722ede3bbc6de0 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 19 Jan 2010 18:39:59 +0800 Subject: egl: Improve driver matching. Make drv->Probe return a score so that the matching can be done by finding the driver with the highest score. --- src/egl/main/egldriver.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/egl/main/egldriver.h') diff --git a/src/egl/main/egldriver.h b/src/egl/main/egldriver.h index eca96fce61..808b1c3fb7 100644 --- a/src/egl/main/egldriver.h +++ b/src/egl/main/egldriver.h @@ -16,9 +16,22 @@ struct _egl_driver const char *Args; /**< args to load this driver */ const char *Name; /**< name of this driver */ - /**< probe a display to see if it is supported */ - EGLBoolean (*Probe)(_EGLDriver *drv, _EGLDisplay *dpy); - /**< called before dlclose to release 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 */ -- cgit v1.2.3