From fee26e9cbd0890bab890f4534d7e92e78d8d0d37 Mon Sep 17 00:00:00 2001 From: Maniraj D Date: Mon, 21 Feb 2022 03:52:26 -0800 Subject: [PATCH] vulkan-producer: proper cleanup for failure case Earlier just the ProducerData was freed in case of any failure with ProducerInit() call, but the related resources were not de-initialized (ex. WlEglSurface), now make it proper by calling ProducerCleanup() in case of any failure. Also renamed the wlEglInitializeSurfaceExport. With recent ABI related updates to wayland-egl, wlEglInitializeSurfaceExport() API allocates the wlEGLSurface and initializes it with the given arguments. So the name *Create would be more appropriate. --- include/wayland-eglsurface.h | 10 +++++----- src/wayland-eglsurface.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/wayland-eglsurface.h b/include/wayland-eglsurface.h index ae71277..f12dd68 100644 --- a/include/wayland-eglsurface.h +++ b/include/wayland-eglsurface.h @@ -40,11 +40,11 @@ WL_EXPORT EGLStreamKHR wlEglGetSurfaceStreamExport(WlEglSurface *surface); WL_EXPORT -WlEglSurface *wlEglInitializeSurfaceExport(EGLDisplay dpy, - int width, - int height, - struct wl_surface *native_surface, - int fifo_length); +WlEglSurface *wlEglCreateSurfaceExport(EGLDisplay dpy, + int width, + int height, + struct wl_surface *native_surface, + int fifo_length); #ifdef __cplusplus } diff --git a/src/wayland-eglsurface.c b/src/wayland-eglsurface.c index aa30714..75571bd 100644 --- a/src/wayland-eglsurface.c +++ b/src/wayland-eglsurface.c @@ -1538,11 +1538,11 @@ EGLStreamKHR wlEglGetSurfaceStreamExport(WlEglSurface *surface) } WL_EXPORT -WlEglSurface *wlEglInitializeSurfaceExport(EGLDisplay dpy, - int width, - int height, - struct wl_surface *native_surface, - int fifo_length) +WlEglSurface *wlEglCreateSurfaceExport(EGLDisplay dpy, + int width, + int height, + struct wl_surface *native_surface, + int fifo_length) { WlEglDisplay *display = (WlEglDisplay *)wlEglAcquireDisplay(dpy); WlEglSurface *surface = NULL;