[Mesa-dev] [PATCH] egl/wayland: resolve quirky try_damage_buffer() implementation

Derek Foreman derekf at osg.samsung.com
Sat Jan 14 02:40:15 UTC 2017


On 13/01/17 11:27 AM, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> The implementation was added with commit d085a5dff5b and effectively
> provided a hidden dependency.
>
> Namely: the codepath used was determined solely during build time. Thus
> if we built again new wayland and then run against older (yet still
> within the requirements, as per the configure) one will get undefined
> symbols.

indeed. :(

> As of earlier commit 36b9976e1f9 "egl/wayland: Avoid race conditions
> when on non-main thread" the required version was bumped to one which
> provides the API, thus we can drop the quirky solution.
>
> Cc: Derek Foreman <derekf at osg.samsung.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>

I'd forgotten this was still in place - thanks for coming back to it.

Reviewed-by: Derek Foreman <derekf at osg.samsung.com>

> ---
> One way to avoid the issue w/o bumping the requirement (for -stable) is
> to add fall-back define alongside weak implementation of the functions.
> The latter should "return false" and will get automatically overridden
> if new enough wayland is used.
 >
> Not sure how much one should care - just thinking out loud.

If one should care, that sounds like a good way to go about it...

Let me know if you want me to care, and I'll write it up.

Thanks,
Derek

> ---
>  src/egl/drivers/dri2/platform_wayland.c | 10 ----------
>  1 file changed, 10 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
> index 4009cc9691..3057604d3c 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -669,14 +669,6 @@ try_damage_buffer(struct dri2_egl_surface *dri2_surf,
>                    const EGLint *rects,
>                    EGLint n_rects)
>  {
> -/* The WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION macro and
> - * wl_proxy_get_version() were both introduced in wayland 1.10.
> - * Instead of bumping our wayland dependency we just make this
> - * function conditional on the required 1.10 features, falling
> - * back to old (correct but suboptimal) behaviour for older
> - * wayland.
> - */
> -#ifdef WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION
>     int i;
>
>     if (wl_proxy_get_version((struct wl_proxy *) dri2_surf->wl_win->surface)
> @@ -692,8 +684,6 @@ try_damage_buffer(struct dri2_egl_surface *dri2_surf,
>                                 rect[2], rect[3]);
>     }
>     return EGL_TRUE;
> -#endif
> -   return EGL_FALSE;
>  }
>  /**
>   * Called via eglSwapBuffers(), drv->API.SwapBuffers().
>



More information about the mesa-dev mailing list