wayland: free the frame in frame_release_callback()
authorMichael Olbrich <m.olbrich@pengutronix.de>
Wed, 28 Oct 2015 08:56:46 +0000 (09:56 +0100)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Tue, 19 Jan 2016 11:43:45 +0000 (12:43 +0100)
commite4ed64b7313fb8f5199b312852ecef2b3f238c15
tree01df2bea07c316af7396fc976c29c558be2f7eae
parentb8da44bdea43df3dba1eff292508416c2a4388a5
wayland: free the frame in frame_release_callback()

This basically reverts 62c3888b76afc69f714a020957e8c5dd9d98f561 (wayland:
decouple wl_buffer from frame).

Otherwise the frame may be overwritten while it is still used by the
compositer:

The frame done callback (frame_done_callback()) is called, when the
compositor is done processing the frame and hands it to the hardware.
The buffer release callback (frame_release_callback()) is called when the
buffer memory is no longer used.

This can be quite some time later: E.g. if weston (with the DRM backend)
puts the buffer on a hardware plane, then then buffer release callback is
called when the kernel is done with the buffer. This is usually when the
next frame is shown, so most likely after the frame done callback for the
next frame!

Since 70eff01d36a2870cbf06ffb91c2a941e8cb6b804 "wayland: sync() when
destroy()" the mentioned possible leak should no longer be a problem, so
reverting this change should cause no leaking buffers.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=758848
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
gst-libs/gst/vaapi/gstvaapiwindow_wayland.c