Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • wlroots wlroots
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 344
    • Issues 344
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 141
    • Merge requests 141
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

Update #1:

Due to abusive users subverting our CI facilities to mine cryptocurrency, breaking out of the container sandbox in the process, we have been forced to take actions to limit the usage of the public runners to official projects only.

The policy will be enforced on 2023-03-23 (or before if we detect abuses).

Please see this issue for more context and to see if and how you are impacted.

  • wlrootswlroots
  • wlrootswlroots
  • Merge requests
  • !3151

surface: add synced objects

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Kirill Primak requested to merge github/fork/vyivel/cache-everything into master Aug 31, 2021
  • Overview 23
  • Commits 10
  • Pipelines 5
  • Changes 14

Also see individual commits.

Closes #1546

Supersedes !2977, !1685 (?)

Fixes #3235

State squashing

Squashing refers to an action of combining a state with the state right before it in the queue. The older state becomes a "sum" of two states, and the newer state becomes empty.

Data structure

This MR introduces wlr_surface_synced and wlr_surface_synced_state to keep track of objects synchronized with the surface state flow. At any given moment, a surface has a current state, a pending state, and optionally a number of cached states. Thus, the following data structure is maintained:

image

This setup allows to perform state caching and squashing in O(k) time, where k is the number of surface-synced objects. When a state is cached, a column of cachedn+1 states is added right before the last one (pending).

Creation of a surface-synced object adds a row of syncedk+1 states and is done in O(n), where n is the number of cached states at the moment; most of the time, n is 0. Note that rows have undefined order; wlr_surface::synced and wlr_surface_state::synced must be treated as unordered sets.

Progress

  • wl_subsurface
  • xdg_surface
  • xdg_toplevel
  • xdg_popup
  • zwlr_layer_surface_v1
  • zxdg_toplevel_decoration
  • zwp_pointer_constraints_v1
  • wp_presentation_feedback

There are objects which only have current state which is updated on surface commit; those don't need to be surface-synced.

Notes

  • wlr_surface.current.seq is meaningless and is always 0. It can't be set to the sequence number of the state being committed.

Consider the following situation: current ⇄ A(seq 1) ⇄ B(seq 2) ⇄ pending. If A is unlocked and then B is unlocked, wlr_surface.current.seq is set to 1 and then 2. However, if B is unlocked first, it's squashed into A. A.seq can't be updated to 2, because whatever locked A still has the old sequence number. After unlocking A, wlr_surface.current.seq will be 1. To avoid this inconsistency, sequence numbers aren't updated at all and assumed to be only used for state locking. Note that this could be fixed in a non-breaking way by introducing wlr_surface_state.lock_seq and updating wlr_surface_state.seq on squash, if required.

  • While wlr_surface_synced_interface.precommit is called right before the current state update, wlr_surface_role.precommit is called on wl_surface.commit request. This is a bug and will be fixed in another PR. Fixed by !3191 (merged).

  • *.current.committed now indicates which parts of the current state were modified by the most recent commit. Related: #2098

Breaking changes

This is (supposed to be) a purely internal change and shouldn't require any action from compositor developers.

Edited Feb 08, 2022 by Kirill Primak
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/vyivel/cache-everything