Skip to content

Commit

Permalink
vulkan-producer: proper cleanup for failure case
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maniraj87 authored and Erik Kurzinger committed May 31, 2022
1 parent 866a801 commit fee26e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions include/wayland-eglsurface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
10 changes: 5 additions & 5 deletions src/wayland-eglsurface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

4 comments on commit fee26e9

@leigh123linux
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit breaks libnvidia-vulkan-producer

./vkcube-wayland: symbol lookup error: /lib64/libnvidia-vulkan-producer.so: undefined symbol: wlEglInitializeSurfaceExport
$ nm -gD /usr/lib64/libnvidia-vulkan-producer.so.515.48.07 |grep -i egl
                 U eglDestroySurface
                 U eglGetPlatformDisplay
                 U eglInitialize
                 U eglTerminate
                 U NvEglApiGetAccess
                 U wlEglGetSurfaceStreamExport
                 U wlEglInitializeSurfaceExport
                 U wlEglPostPresentExport
                 U wlEglPrePresentExport

@erik-kz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah crap, it would seem that the accompanying driver-side change didn't make it into the 515 release branch. Thank you very much for catching this. I should be able to get it fixed by the next minor release.

@markbolhuis
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there.

When can the next minor release be expected?

Thanks

@andrewfader
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now in 515.57

Please sign in to comment.