From fddff0d1b8d1130109ae58b58b911eb684526b51 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 3 Mar 2025 17:48:31 -0600 Subject: [PATCH] egl/dri2: Rework get_wl_surface_proxy() Instead, just make it a helper for getting the wl_surface from the wl_egl_window. We'll want this in the next commit. Reviewed-by: Mike Blumenkrantz Part-of: --- src/egl/drivers/dri2/platform_wayland.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index e0138719738..00063ca42b1 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -448,16 +448,16 @@ destroy_window_callback(void *data) } static struct wl_surface * -get_wl_surface_proxy(struct wl_egl_window *window) +get_wl_surface(struct wl_egl_window *window) { /* Version 3 of wl_egl_window introduced a version field at the same * location where a pointer to wl_surface was stored. Thus, if * window->version is dereferenceable, we've been given an older version of * wl_egl_window, and window->version points to wl_surface */ if (_eglPointerIsDereferenceable((void *)(window->version))) { - return wl_proxy_create_wrapper((void *)(window->version)); + return (void *)(window->version); } - return wl_proxy_create_wrapper(window->surface); + return window->surface; } static void @@ -750,7 +750,8 @@ dri2_wl_create_window_surface(_EGLDisplay *disp, _EGLConfig *conf, wl_proxy_set_queue((struct wl_proxy *)dri2_surf->wl_dpy_wrapper, dri2_surf->wl_queue); - dri2_surf->wl_surface_wrapper = get_wl_surface_proxy(window); + dri2_surf->wl_surface_wrapper = + wl_proxy_create_wrapper(get_wl_surface(window)); if (!dri2_surf->wl_surface_wrapper) { _eglError(EGL_BAD_ALLOC, "dri2_create_surface"); goto cleanup_dpy_wrapper;