diff options
author | Emil Velikov <[email protected]> | 2016-08-16 14:25:19 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-10-14 12:16:00 +0100 |
commit | b349c11098ed9511510bd2e20e12ab52fe927508 (patch) | |
tree | cee50a927fcefa9d32e03d0ef67d4d146e79ec46 | |
parent | 13bf390657921b7c07d2de320ff0aa43206cce11 (diff) |
egl/dri2: glFlush is not optional, treat it as such
The documentation is clear - one must glFlush the old context on
eglMakeCurrent. Thus keeping it optional is not something we should be
doing. Furthermore if we cannot get the entry point we're likely having
a broken setup/stack.
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index cd0a2e9b625..e41ce004734 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1262,7 +1262,7 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf, } /* flush before context switch */ - if (old_ctx && dri2_drv->glFlush) + if (old_ctx) dri2_drv->glFlush(); ddraw = (dsurf) ? dri2_dpy->vtbl->get_dri_drawable(dsurf) : NULL; @@ -2666,8 +2666,7 @@ dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, if (dri2_ctx && dri2_sync->base.SyncStatus == EGL_UNSIGNALED_KHR && (flags & EGL_SYNC_FLUSH_COMMANDS_BIT_KHR)) { /* flush context if EGL_SYNC_FLUSH_COMMANDS_BIT_KHR is set */ - if (dri2_drv->glFlush) - dri2_drv->glFlush(); + dri2_drv->glFlush(); } /* if timeout is EGL_FOREVER_KHR, it should wait without any timeout.*/ @@ -2832,6 +2831,12 @@ dri2_load(_EGLDriver *drv) dri2_drv->glFlush = (void (*)(void)) dri2_drv->get_proc_address("glFlush"); + /* if glFlush is not available things are horribly broken */ + if (!dri2_drv->glFlush) { + _eglLog(_EGL_WARNING, "DRI2: failed to find glFlush entry point"); + return EGL_FALSE; + } + dri2_drv->handle = handle; return EGL_TRUE; |