Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • KWin KWin
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 58
    • Issues 58
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 153
    • Merge requests 153
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PlasmaPlasma
  • KWinKWin
  • Issues
  • #24
Closed
Open
Issue created Dec 01, 2020 by Vlad Zahorodnii@vladzDeveloper

Compositing on separate thread(s)

While testing compositing timing (with per screen rendering unlocked), I've noticed a common pattern that looks something like this

contention

Compositing on the 144Hz monitor usually finishes on time, but then, all of sudden, the 60Hz monitor needs to be repainted. Due to the contention, we miss the deadline on the 144Hz monitor. However, most likely, we would've finished compositing on time if not because of the 60Hz monitor.

In order to fix that point of contention, we need to perform compositing on separate threads. The tricky part is that the effects system is written in "single-threaded fashion." In addition to that, KWaylandServer code is not thread-safe. Fixing that will be unfeasible.

A better (and more reasonable) approach to tackle this issue would be to create a Scene (and all effects) per individual composited output. On X11, things would stay the same way, but on Wayland, every output will have its own Scene. The effects pointer will become a thread-local global.

Before a render thread starts compositing, it has to synchronize its state with the main thread. After that it can proceed to recording render commands, etc. Going with this design may involve changes in some effects.

Assignee
Assign to
Time tracking