[Mesa-dev] [PATCH 05/12] egl/x11: drop unused swap/invalidate_available variables

Emil Velikov emil.l.velikov at gmail.com
Thu Aug 3 18:29:31 UTC 2017


From: Emil Velikov <emil.velikov at collabora.com>

Both are always true, so there's no point in keeping them around.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/egl/drivers/dri2/egl_dri2.h     |  2 --
 src/egl/drivers/dri2/platform_x11.c | 14 ++------------
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 23f1ca6a641..1144ce988e1 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -184,7 +184,6 @@ struct dri2_egl_display
    int                       ref_count;
 
    bool                      own_device;
-   bool                      invalidate_available;
    int                       min_swap_interval;
    int                       max_swap_interval;
    int                       default_swap_interval;
@@ -200,7 +199,6 @@ struct dri2_egl_display
 #ifdef HAVE_X11_PLATFORM
    xcb_connection_t         *conn;
    xcb_screen_t             *screen;
-   bool                     swap_available;
 #ifdef HAVE_DRI3
    struct loader_dri3_extensions loader_dri3_ext;
 #endif
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index eb5ba6088ad..bec8a277958 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -859,7 +859,7 @@ dri2_x11_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
    if (draw->Type == EGL_PIXMAP_BIT || draw->Type == EGL_PBUFFER_BIT)
       return 0;
 
-   if (draw->SwapBehavior == EGL_BUFFER_PRESERVED || !dri2_dpy->swap_available)
+   if (draw->SwapBehavior == EGL_BUFFER_PRESERVED)
       return dri2_copy_region(drv, disp, draw, dri2_surf->region) ? 0 : -1;
 
    dri2_flush_drawable_for_swapbuffers(disp, draw);
@@ -956,8 +956,7 @@ dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf);
 
-   if (dri2_dpy->swap_available)
-      xcb_dri2_swap_interval(dri2_dpy->conn, dri2_surf->drawable, interval);
+   xcb_dri2_swap_interval(dri2_dpy->conn, dri2_surf->drawable, interval);
 
    return EGL_TRUE;
 }
@@ -1271,9 +1270,6 @@ dri2_x11_setup_swap_interval(struct dri2_egl_display *dri2_dpy)
    dri2_dpy->min_swap_interval = 0;
    dri2_dpy->max_swap_interval = 0;
 
-   if (!dri2_dpy->swap_available)
-      return;
-
    /* If we do have swapbuffers, then we can support pretty much any swap
     * interval, but we allow driconf to override applications.
     */
@@ -1336,9 +1332,6 @@ dri2_initialize_x11_dri3(_EGLDriver *drv, _EGLDisplay *disp)
 
    dri2_dpy->loader_extensions = dri3_image_loader_extensions;
 
-   dri2_dpy->swap_available = true;
-   dri2_dpy->invalidate_available = true;
-
    if (!dri2_create_screen(disp))
       goto cleanup;
 
@@ -1419,9 +1412,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
 
    dri2_dpy->loader_extensions = dri2_loader_extensions;
 
-   dri2_dpy->swap_available = true;
-   dri2_dpy->invalidate_available = true;
-
    if (!dri2_create_screen(disp))
       goto cleanup;
 
-- 
2.13.3



More information about the mesa-dev mailing list