[Mesa-dev] [PATCH 04/25] egl/wl: Call dri2_swap_interval() statically

Ian Romanick idr at freedesktop.org
Tue Feb 11 18:36:29 PST 2014


On 02/09/2014 01:37 PM, Chad Versace wrote:
> Don't call it through the driver dispatch table. Just call it
> statically.
> 
> This prepares for the EGL platform extensions.

Since this also modifies platform_x11.c, the commit message should
reflect that.

> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
>  src/egl/drivers/dri2/platform_wayland.c | 6 +++++-
>  src/egl/drivers/dri2/platform_x11.c     | 6 +++++-
>  2 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
> index 93f560a..f710efa 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -47,6 +47,10 @@ enum wl_drm_format_flags {
>     HAS_RGB565 = 4,
>  };
>  
> +static EGLBoolean
> +dri2_wl_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
> +                      EGLint interval);
> +
>  static void
>  sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
>  {
> @@ -191,7 +195,7 @@ dri2_wl_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
>                                   window, attrib_list);
>  
>     if (surf != NULL)
> -      drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
> +      dri2_wl_swap_interval(drv, disp, surf, dri2_dpy->default_swap_interval);
>  
>     return surf;
>  }
> diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
> index eb15650..ea871fd 100644
> --- a/src/egl/drivers/dri2/platform_x11.c
> +++ b/src/egl/drivers/dri2/platform_x11.c
> @@ -41,6 +41,10 @@
>  
>  #include "egl_dri2.h"
>  
> +static EGLBoolean
> +dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
> +                       EGLint interval);
> +
>  static void
>  swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
>                       struct dri2_egl_surface * dri2_surf,
> @@ -287,7 +291,7 @@ dri2_x11_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
>        surf->SwapInterval = 1;
>  
>        /* Override that with a driconf-set value. */
> -      drv->API.SwapInterval(drv, disp, surf, dri2_dpy->default_swap_interval);
> +      dri2_x11_swap_interval(drv, disp, surf, dri2_dpy->default_swap_interval);
>     }
>  
>     return surf;
> 



More information about the mesa-dev mailing list