diff options
author | Christian König <[email protected]> | 2011-01-20 22:10:37 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2011-01-20 22:10:37 +0100 |
commit | d2ff6b8715e817c1ef14d4bf12be58c19d894143 (patch) | |
tree | 281badfe8638da50221270af29e16da1e40d9a6a /src/egl/drivers | |
parent | e755c7bec3bc722ee451bdaed8da741f337d33b3 (diff) | |
parent | d136d1d2e1174d2420ce5e32507904243ab240cd (diff) |
Merge remote branch 'origin/master' into pipe-video
Conflicts:
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/r600/r600_shader.c
Diffstat (limited to 'src/egl/drivers')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 44 | ||||
-rw-r--r-- | src/egl/drivers/glx/egl_glx.c | 16 |
2 files changed, 36 insertions, 24 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 8967969c924..6fc1e49e773 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -260,8 +260,8 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id, base.BindToTextureRGBA = bind_to_texture_rgba; } - base.RenderableType = disp->ClientAPIsMask; - base.Conformant = disp->ClientAPIsMask; + base.RenderableType = disp->ClientAPIs; + base.Conformant = disp->ClientAPIs; if (!_eglValidateConfig(&base, EGL_FALSE)) { _eglLog(_EGL_DEBUG, "DRI2: failed to validate config %d", id); @@ -752,13 +752,13 @@ dri2_create_screen(_EGLDisplay *disp) else api_mask = 1 << __DRI_API_OPENGL; - disp->ClientAPIsMask = 0; + disp->ClientAPIs = 0; if (api_mask & (1 <<__DRI_API_OPENGL)) - disp->ClientAPIsMask |= EGL_OPENGL_BIT; + disp->ClientAPIs |= EGL_OPENGL_BIT; if (api_mask & (1 <<__DRI_API_GLES)) - disp->ClientAPIsMask |= EGL_OPENGL_ES_BIT; + disp->ClientAPIs |= EGL_OPENGL_ES_BIT; if (api_mask & (1 << __DRI_API_GLES2)) - disp->ClientAPIsMask |= EGL_OPENGL_ES2_BIT; + disp->ClientAPIs |= EGL_OPENGL_ES2_BIT; if (dri2_dpy->dri2->base.version >= 2) { disp->Extensions.KHR_surfaceless_gles1 = EGL_TRUE; @@ -775,8 +775,7 @@ dri2_create_screen(_EGLDisplay *disp) } static EGLBoolean -dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp, - EGLint *major, EGLint *minor) +dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp) { struct dri2_egl_display *dri2_dpy; @@ -855,8 +854,8 @@ dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp, disp->Extensions.NOK_texture_from_pixmap = EGL_TRUE; /* we're supporting EGL 1.4 */ - *major = 1; - *minor = 4; + disp->VersionMajor = 1; + disp->VersionMinor = 4; return EGL_TRUE; @@ -1415,8 +1414,7 @@ dri2_get_driver_for_fd(int fd) } static EGLBoolean -dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp, - EGLint *major, EGLint *minor) +dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp) { struct dri2_egl_display *dri2_dpy; int i; @@ -1451,8 +1449,8 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp, disp->Extensions.KHR_gl_texture_2D_image = EGL_TRUE; /* we're supporting EGL 1.4 */ - *major = 1; - *minor = 4; + disp->VersionMajor = 1; + disp->VersionMinor = 4; return EGL_TRUE; @@ -1470,16 +1468,23 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp, * Called via eglInitialize(), GLX_drv->API.Initialize(). */ static EGLBoolean -dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp, - EGLint *major, EGLint *minor) +dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp) { + /* not until swrast_dri is supported */ + if (disp->Options.UseFallback) + return EGL_FALSE; + switch (disp->Platform) { case _EGL_PLATFORM_X11: - return dri2_initialize_x11(drv, disp, major, minor); + if (disp->Options.TestOnly) + return EGL_TRUE; + return dri2_initialize_x11(drv, disp); #ifdef HAVE_LIBUDEV case _EGL_PLATFORM_DRM: - return dri2_initialize_drm(drv, disp, major, minor); + if (disp->Options.TestOnly) + return EGL_TRUE; + return dri2_initialize_drm(drv, disp); #endif default: @@ -2382,10 +2387,11 @@ _EGL_MAIN(const char *args) if (!dri2_drv) return NULL; + memset(dri2_drv, 0, sizeof *dri2_drv); + if (!dri2_load(&dri2_drv->base)) return NULL; - memset(dri2_drv, 0, sizeof *dri2_drv); _eglInitDriverFallbacks(&dri2_drv->base); dri2_drv->base.API.Initialize = dri2_initialize; dri2_drv->base.API.Terminate = dri2_terminate; diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c index 5fce06d66df..c3c11c7b6eb 100644 --- a/src/egl/drivers/glx/egl_glx.c +++ b/src/egl/drivers/glx/egl_glx.c @@ -581,8 +581,7 @@ check_quirks(struct GLX_egl_driver *GLX_drv, * Called via eglInitialize(), GLX_drv->API.Initialize(). */ static EGLBoolean -GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp, - EGLint *major, EGLint *minor) +GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp) { struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv); struct GLX_egl_display *GLX_dpy; @@ -590,6 +589,13 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp, if (disp->Platform != _EGL_PLATFORM_X11) return EGL_FALSE; + /* this is a fallback driver */ + if (!disp->Options.UseFallback) + return EGL_FALSE; + + if (disp->Options.TestOnly) + return EGL_TRUE; + GLX_dpy = CALLOC_STRUCT(GLX_egl_display); if (!GLX_dpy) return _eglError(EGL_BAD_ALLOC, "eglInitialize"); @@ -614,7 +620,7 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp, } disp->DriverData = (void *) GLX_dpy; - disp->ClientAPIsMask = EGL_OPENGL_BIT; + disp->ClientAPIs = EGL_OPENGL_BIT; check_extensions(GLX_drv, GLX_dpy, DefaultScreen(GLX_dpy->dpy)); check_quirks(GLX_drv, GLX_dpy, DefaultScreen(GLX_dpy->dpy)); @@ -629,8 +635,8 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp, } /* we're supporting EGL 1.4 */ - *major = 1; - *minor = 4; + disp->VersionMajor = 1; + disp->VersionMinor = 4; return EGL_TRUE; } |