diff options
author | Emil Velikov <[email protected]> | 2017-05-12 15:25:00 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-05-29 16:59:20 +0100 |
commit | 14e51d526ff68e3e4b054b8e5d7df83f0cc313d6 (patch) | |
tree | 8989264f0a7a3f97e19e5d45b2d6a028265d6a83 /src/egl | |
parent | 1398ece02c9a3bf93ad5a52987fca3a30a22fdf8 (diff) |
egl/x11: check for dri2_dpy->flush before using the flush extension
Analogous to earlier commit.
Note that the dri2_x11_post_sub_buffer and dri2_x11_swap_buffers_region
paths already implicitly require __DRI2_FLUSH. The corresponding
extensions (NV_post_sub_buffer and NOK_swap_region) are enabled only
with DRI2.
v2: Split cosmetic changes into separate patch.
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/platform_x11.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index b7d7e303a71..ea9b5e15ba4 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -817,8 +817,7 @@ dri2_copy_region(_EGLDriver *drv, _EGLDisplay *disp, if (draw->Type == EGL_PIXMAP_BIT || draw->Type == EGL_PBUFFER_BIT) return EGL_TRUE; - if (dri2_dpy->flush) - dri2_dpy->flush->flush(dri2_surf->dri_drawable); + dri2_dpy->flush->flush(dri2_surf->dri_drawable); if (dri2_surf->have_fake_front) render_attachment = XCB_DRI2_ATTACHMENT_BUFFER_FAKE_FRONT_LEFT; @@ -880,8 +879,7 @@ dri2_x11_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw, * happened. The driver should still be using the viewport hack to catch * window resizes. */ - if (dri2_dpy->flush && - dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate) + if (dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate) dri2_dpy->flush->invalidate(dri2_surf->dri_drawable); return swap_count; @@ -893,7 +891,7 @@ dri2_x11_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw) struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); struct dri2_egl_surface *dri2_surf = dri2_egl_surface(draw); - if (dri2_dpy->dri2) { + if (dri2_dpy->flush) { if (dri2_x11_swap_buffers_msc(drv, disp, draw, 0, 0, 0) != -1) { return EGL_TRUE; } |