egl/drm: check for dri2_dpy->flush before using the flush extension
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 12 May 2017 14:11:27 +0000 (15:11 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 29 May 2017 15:59:16 +0000 (16:59 +0100)
The current __DRI_DRI2 imples __DRI2_FLUSH. At the same time, one can
use __DRI_IMAGE_DRIVER alongside the latter, so the current check is
confusing at best.

Check for what we use.

v2: Split out from whitespace changes

Reviewed-by: Chad Versace <chadversary@chromium.org> (v1)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/platform_drm.c

index 50627a7492d245076ec8fda36be7c4977b4a470c..e8f007f0cd30c8c116ed742a01b0a27af0b1df35 100644 (file)
@@ -426,7 +426,7 @@ dri2_drm_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
    struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw);
    unsigned i;
 
-   if (dri2_dpy->swrast) {
+   if (!dri2_dpy->flush) {
       dri2_dpy->core->swapBuffers(dri2_surf->dri_drawable);
    } else {
       if (dri2_surf->base.Type == EGL_WINDOW_BIT) {