Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wl_resource management fixes #73

Merged
merged 5 commits into from Sep 9, 2019

Conversation

@zdobersek
Copy link
Contributor

commented Sep 7, 2019

This tries to do a better job of tracking wl_resource lifetime and managing the resource release process in cases where the wl_resource was already destroyed.

zdobersek added 5 commits Sep 7, 2019
view-backend-exportable-private: improve frame callback wl_resource m…
…anagement

Use a destroy listener on frame callback resources in order to be able to
properly clean up in case the underlying client disappears.

Internal management of these resources in ViewBackend now uses wl_list.
view-backend-exportable-fdo: improve buffer wl_resource management
Use a destroy handle on the buffer wl_resource in order to properly track the
resource's lifetime. In case the resource was destroyed while corresponding
wl_resource was exported to the client, the subsequent release should avoid
dispatching buffer release notification on the already-destroyed resource.

To achieve this, buffer resources are tracked inside the ClientBundleBuffer
implementation in a wl_list, with entries added to that list upon export
and removed from it upon release or destruction.
view-backend-exportable-fdo-egl: improve buffer wl_resource managemen…
…t in the deprecated implementation

Use a destroy handler on the buffer wl_resource in order to properly track
resource's lifetime. In case the resource was destroyed while corresponding
wl_resource was exported to the client, the subsequent release should avoid
dispatching buffer release notification on the already-destroyed resource.

ClientBundleEGLDeprecated tracks the exported resources (on which EGLImage
objects are based) in a wl_list. Upon resource destruction, the tracked
resource is removed.

When the buffer resource is returned, it is released if it is still tracked
and was not yet destroyed. The corresponding EGLImage is destroyed
unconditionally.
view-backend-exportable-fdo-egl: clean up management of buffer resour…
…ces in the wpe_fdo_egl_exported_image implementation

The ClientBundleEGL implementat that operates with wpe_fdo_egl_exported_image
objects already relies on destroy listeners to properly track wl_resource
lifetime, so these changes only polish things.

The basics remain the same: if the wl_resource is destroyed, the
wpe_fdo_egl_exported_image object is destroyed immediately if it's not currently
exported, otherwise it's destroyed when the client returns it.
@carlosgcampos

This comment has been minimized.

Copy link
Contributor

commented Sep 9, 2019

LGTM

@zdobersek zdobersek merged commit fb897d2 into master Sep 9, 2019

2 checks passed

Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
aperezdc added a commit that referenced this pull request Sep 9, 2019
wl_resource management fixes (#73)
* view-backend-exportable-private: some cleanups and renaming around frame callbacks.

* view-backend-exportable-private: improve frame callback wl_resource management

Use a destroy listener on frame callback resources in order to be able to
properly clean up in case the underlying client disappears.

Internal management of these resources in ViewBackend now uses wl_list.

* view-backend-exportable-fdo: improve buffer wl_resource management

Use a destroy handle on the buffer wl_resource in order to properly track the
resource's lifetime. In case the resource was destroyed while corresponding
wl_resource was exported to the client, the subsequent release should avoid
dispatching buffer release notification on the already-destroyed resource.

To achieve this, buffer resources are tracked inside the ClientBundleBuffer
implementation in a wl_list, with entries added to that list upon export
and removed from it upon release or destruction.

* view-backend-exportable-fdo-egl: improve buffer wl_resource management in the deprecated implementation

Use a destroy handler on the buffer wl_resource in order to properly track
resource's lifetime. In case the resource was destroyed while corresponding
wl_resource was exported to the client, the subsequent release should avoid
dispatching buffer release notification on the already-destroyed resource.

ClientBundleEGLDeprecated tracks the exported resources (on which EGLImage
objects are based) in a wl_list. Upon resource destruction, the tracked
resource is removed.

When the buffer resource is returned, it is released if it is still tracked
and was not yet destroyed. The corresponding EGLImage is destroyed
unconditionally.

* view-backend-exportable-fdo-egl: clean up management of buffer resources in the wpe_fdo_egl_exported_image implementation

The ClientBundleEGL implementat that operates with wpe_fdo_egl_exported_image
objects already relies on destroy listeners to properly track wl_resource
lifetime, so these changes only polish things.

The basics remain the same: if the wl_resource is destroyed, the
wpe_fdo_egl_exported_image object is destroyed immediately if it's not currently
exported, otherwise it's destroyed when the client returns it.

(cherry picked from commit fb897d2)
@aperezdc

This comment has been minimized.

Copy link
Member

commented Sep 9, 2019

Cherry picked as commit 5b8c3b8 in the wpebackend-fdo-1.4 branch.

@aperezdc

This comment has been minimized.

Copy link
Member

commented Sep 9, 2019

Trying to cherry-pick this to the wpebackend-1.2 branch results in quite a few conflicts.

@zdobersek Would you be so kind as to make a PR targeting the branch, if possible? Thanks!

zdobersek added a commit that referenced this pull request Sep 9, 2019
wl_resource management fixes (#73)
* view-backend-exportable-private: some cleanups and renaming around frame callbacks.

* view-backend-exportable-private: improve frame callback wl_resource management

Use a destroy listener on frame callback resources in order to be able to
properly clean up in case the underlying client disappears.

Internal management of these resources in ViewBackend now uses wl_list.

* view-backend-exportable-fdo: improve buffer wl_resource management

Use a destroy handle on the buffer wl_resource in order to properly track the
resource's lifetime. In case the resource was destroyed while corresponding
wl_resource was exported to the client, the subsequent release should avoid
dispatching buffer release notification on the already-destroyed resource.

To achieve this, buffer resources are tracked inside the ClientBundleBuffer
implementation in a wl_list, with entries added to that list upon export
and removed from it upon release or destruction.

* view-backend-exportable-fdo-egl: improve buffer wl_resource management in the deprecated implementation

Use a destroy handler on the buffer wl_resource in order to properly track
resource's lifetime. In case the resource was destroyed while corresponding
wl_resource was exported to the client, the subsequent release should avoid
dispatching buffer release notification on the already-destroyed resource.

ClientBundleEGLDeprecated tracks the exported resources (on which EGLImage
objects are based) in a wl_list. Upon resource destruction, the tracked
resource is removed.

When the buffer resource is returned, it is released if it is still tracked
and was not yet destroyed. The corresponding EGLImage is destroyed
unconditionally.

* view-backend-exportable-fdo-egl: clean up management of buffer resources in the wpe_fdo_egl_exported_image implementation

The ClientBundleEGL implementat that operates with wpe_fdo_egl_exported_image
objects already relies on destroy listeners to properly track wl_resource
lifetime, so these changes only polish things.

The basics remain the same: if the wl_resource is destroyed, the
wpe_fdo_egl_exported_image object is destroyed immediately if it's not currently
exported, otherwise it's destroyed when the client returns it.

@zdobersek zdobersek deleted the zdobersek/wl-resource-management-fixes branch Sep 9, 2019

aperezdc added a commit that referenced this pull request Sep 9, 2019
wl_resource management fixes (#73)
* view-backend-exportable-private: some cleanups and renaming around frame callbacks.

* view-backend-exportable-private: improve frame callback wl_resource management

Use a destroy listener on frame callback resources in order to be able to
properly clean up in case the underlying client disappears.

Internal management of these resources in ViewBackend now uses wl_list.

* view-backend-exportable-fdo: improve buffer wl_resource management

Use a destroy handle on the buffer wl_resource in order to properly track the
resource's lifetime. In case the resource was destroyed while corresponding
wl_resource was exported to the client, the subsequent release should avoid
dispatching buffer release notification on the already-destroyed resource.

To achieve this, buffer resources are tracked inside the ClientBundleBuffer
implementation in a wl_list, with entries added to that list upon export
and removed from it upon release or destruction.

* view-backend-exportable-fdo-egl: improve buffer wl_resource management in the deprecated implementation

Use a destroy handler on the buffer wl_resource in order to properly track
resource's lifetime. In case the resource was destroyed while corresponding
wl_resource was exported to the client, the subsequent release should avoid
dispatching buffer release notification on the already-destroyed resource.

ClientBundleEGLDeprecated tracks the exported resources (on which EGLImage
objects are based) in a wl_list. Upon resource destruction, the tracked
resource is removed.

When the buffer resource is returned, it is released if it is still tracked
and was not yet destroyed. The corresponding EGLImage is destroyed
unconditionally.

* view-backend-exportable-fdo-egl: clean up management of buffer resources in the wpe_fdo_egl_exported_image implementation

The ClientBundleEGL implementat that operates with wpe_fdo_egl_exported_image
objects already relies on destroy listeners to properly track wl_resource
lifetime, so these changes only polish things.

The basics remain the same: if the wl_resource is destroyed, the
wpe_fdo_egl_exported_image object is destroyed immediately if it's not currently
exported, otherwise it's destroyed when the client returns it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.