Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • xserver xserver
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 922
    • Issues 922
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 129
    • Merge requests 129
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • xserverxserver
  • Merge requests
  • !571

Fix buffers being destroyed before the wl_buffer.release is received

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Olivier Fourdan requested to merge ofourdan/xserver:fix-buffer-release-cb into master Dec 07, 2020
  • Overview 31
  • Commits 3
  • Pipelines 13
  • Changes 2

The Wayland buffers in Xwayland are tied to the Pixmaps.

Xwayland tends to destroy the pixmaps as soon as those aren't needed, including the window backend pixmaps and the cursor pixmaps (which is hardcoded to use SHM).

The window buffer mechanism would free the pixmap and its corresponding Wayland buffer as soon as window buffers are disposed (when resizing or 1 closing an X11 window for example).

Yet, the Wayland compositor may still use the buffer until it sends wl_buffer.release event, therefore Xwayland should not destroy the Wayland buffer before a release event is received.

This MR aims at fixing that issue by increasing the reference counter on the pixmap to hold a reference on the pixmap whose buffer will be attached to the surface, and drop that reference when receiving the wl_buffer.release notification.

If the buffer pixmap is to be destroyed before the buffer is released by the compositor, set up a dedicated release callback for that reference to keep the buffer until released by the compositor.

  1. Resizing is fine already in the code from the master branch actually, even though it doesn't use the pixmap's refcount directly, we do not recycle buffers until released, that was the whole point of the window multi-buffer mechanism. ↩

Edited Dec 09, 2020 by Olivier Fourdan
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-buffer-release-cb