diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c index cd8ed1e..98f38cf 100644 --- a/src/wayland-eglsurface.c +++ b/src/wayland-eglsurface.c @@ -1364,12 +1364,6 @@ static EGLint create_surface_stream_local(WlEglSurface *surface) WlEglDmaBufFormatSet *formatSet = NULL; WlEglDmaBufFeedback *feedback = NULL; - /* First do a roundtrip to get the tranches in case the compositor resent them */ - if (wl_display_roundtrip_queue(display->nativeDpy, display->wlEventQueue) < 0) { - err = EGL_BAD_ACCESS; - goto fail; - } - /* * Vulkan surfaces will not have an eglConfig set. We will need to address them * separately. @@ -2348,8 +2342,13 @@ EGLSurface wlEglCreatePlatformWindowSurfaceHook(EGLDisplay dpy, * hints about which modifiers to use. */ if (display->dmaBufProtocolVersion >= 4) { + struct zwp_linux_dmabuf_v1 *wrapper = wl_proxy_create_wrapper(display->wlDmaBuf); + wl_proxy_set_queue((struct wl_proxy *)wrapper, surface->wlEventQueue); + surface->feedback.wlDmaBufFeedback = - zwp_linux_dmabuf_v1_get_surface_feedback(display->wlDmaBuf, surface->wlSurface); + zwp_linux_dmabuf_v1_get_surface_feedback(wrapper, surface->wlSurface); + + wl_proxy_wrapper_destroy(wrapper); if (!surface->feedback.wlDmaBufFeedback || WlEglRegisterFeedback(&surface->feedback)) { @@ -2357,7 +2356,7 @@ EGLSurface wlEglCreatePlatformWindowSurfaceHook(EGLDisplay dpy, goto fail; } /* Do a roundtrip to get the tranches before calling create_surface_context */ - if (wl_display_roundtrip_queue(display->nativeDpy, display->wlEventQueue) < 0) { + if (wl_display_roundtrip_queue(display->nativeDpy, surface->wlEventQueue) < 0) { err = EGL_BAD_ALLOC; goto fail; }