diff options
author | Brian Paul <[email protected]> | 2008-07-10 10:48:28 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-07-10 10:48:28 -0600 |
commit | fb3867aec018ba0c0aa548db541236528400d934 (patch) | |
tree | 81d6d25dec90961233e49f732f808ef1a7f5e199 /src/egl/drivers/xdri/egl_xdri.c | |
parent | 64f92e00c8292113f9a6372959febe903af09db6 (diff) |
egl: implement xdri_eglGetProcAddress() for gallium
Plus comments, clean-ups.
Diffstat (limited to 'src/egl/drivers/xdri/egl_xdri.c')
-rw-r--r-- | src/egl/drivers/xdri/egl_xdri.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/egl/drivers/xdri/egl_xdri.c b/src/egl/drivers/xdri/egl_xdri.c index 5e50d6034ac..9d95c850d07 100644 --- a/src/egl/drivers/xdri/egl_xdri.c +++ b/src/egl/drivers/xdri/egl_xdri.c @@ -574,7 +574,8 @@ init_drm(struct xdri_egl_driver *xdri_drv, _EGLDisplay *disp) for (m = modes; m; m = m->next) { _eglLog(_EGL_DEBUG, - "mode ID 0x%x rgba %d %d %d %d z %d s %d db %d\n", m->visualID, + "mode ID 0x%x rgba %d %d %d %d z %d s %d db %d\n", + m->visualID, m->redBits, m->greenBits, m->blueBits, m->alphaBits, m->depthBits, m->stencilBits, m->doubleBufferMode); } @@ -584,6 +585,15 @@ init_drm(struct xdri_egl_driver *xdri_drv, _EGLDisplay *disp) } +/** + * Load the DRI driver named by "xdri_drv->dri_driver_name". + * Basically, dlopen() the library to set "xdri_drv->dri_driver_handle". + * + * Later, we'll call dlsym(createNewScreenName) to get a pointer to + * the driver's createNewScreen() function which is the bootstrap function. + * + * \return EGL_TRUE for success, EGL_FALSE for failure + */ static EGLBoolean load_dri_driver(struct xdri_egl_driver *xdri_drv) { @@ -678,6 +688,9 @@ xdri_eglTerminate(_EGLDriver *drv, EGLDisplay dpy) } +/* + * Called from eglGetProcAddress() via drv->API.GetProcAddress(). + */ static _EGLProc xdri_eglGetProcAddress(const char *procname) { @@ -688,8 +701,17 @@ xdri_eglGetProcAddress(const char *procname) /*_EGLDisplay *disp = _eglLookupDisplay(dpy);*/ _EGLProc *proc = xdri_drv->driScreen.getProcAddress(procname); return proc; -#elif 0 - return (_EGLProc) st_get_proc_address(procname); +#elif 1 + /* This is a bit of a hack to get at the gallium/Mesa state tracker + * function st_get_proc_address(). This will probably change at + * some point. + */ + _EGLProc (*st_get_proc_addr)(const char *procname); + st_get_proc_addr = dlsym(NULL, "st_get_proc_address"); + if (st_get_proc_addr) { + return st_get_proc_addr(procname); + } + return NULL; #else return NULL; #endif |