Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

output: re-introduce atomic mode, enabled, scale and transform #1797

Merged
merged 5 commits into from
Dec 30, 2019

Conversation

emersion
Copy link
Member

@emersion emersion commented Aug 16, 2019

This reverts commit 01f9038 and re-applies
commit ee5f98a.

Updates: #1640 (Atomic output updates issue)
See also: #1762 (Atomic output updates original PR)
See also: #1780 (Issue caused by atomic output updates)
See also: swaywm/sway#4419 (Issue caused by atomic output updates)
See also: #1781 (Revert PR)

Sway PR: swaywm/sway#4845


Breaking changes:

  • Compositors now need to call wlr_output_commit after wlr_output_enable, wlr_output_set_mode, wlr_output_set_custom_mode, wlr_output_set_transform or wlr_output_set_scale
  • wlr_output_set_mode no longer implicitly enables the output, compositors need to call wlr_output_enable as well
  • Compositors now need to call wlr_output_rollback after wlr_output_attach_render if they decide not to render

@emersion emersion added the breaking Breaking change in public API label Aug 16, 2019
@ddevault
Copy link
Contributor

Can you point out the changes to this which fix the bug we reverted this for in the first place?

@escalade

This comment has been minimized.

emersion added a commit to emersion/sway that referenced this pull request Dec 27, 2019
This reverts commit 724926e and
re-applies commit 6e0565e.

See also: swaywm/wlroots#1797 (wlroots PR)
See also: swaywm#4355 (Original sway PR)
See also: swaywm#4434 (Revert sway PR)
@emersion emersion changed the title output: re-introduce atomic mode, enabled, scale and transform [WIP] output: re-introduce atomic mode, enabled, scale and transform Dec 27, 2019
This reverts commit 01f9038 and re-applies
commit ee5f98a.

Updates: swaywm#1640 (Atomic output updates issue)
See also: swaywm#1762 (Atomic output updates original PR)
See also: swaywm#1780 (Issue caused by atomic output updates)
See also: swaywm/sway#4419 (Issue caused by atomic output updates)
See also: swaywm#1781 (Revert PR)
emersion added a commit to emersion/sway that referenced this pull request Dec 27, 2019
This reverts commit 724926e and
re-applies commit 6e0565e.

See also: swaywm/wlroots#1797 (wlroots PR)
See also: swaywm#4355 (Original sway PR)
See also: swaywm#4434 (Revert sway PR)
emersion added a commit to emersion/sway that referenced this pull request Dec 28, 2019
This reverts commit 724926e and
re-applies commit 6e0565e.

Outputs now need to be explicitly enabled when performing a modeset.
We need to roll back wlr_output_attach_render when we decide not to
render.

See also: swaywm/wlroots#1797 (wlroots PR)
See also: swaywm#4355 (Original sway PR)
See also: swaywm#4434 (Revert sway PR)
This saves one modeset in case the previous mode is different.
In case the pending value is the same as the current value, clear the
bit from pending.committed.
@emersion emersion changed the title [WIP] output: re-introduce atomic mode, enabled, scale and transform output: re-introduce atomic mode, enabled, scale and transform Dec 28, 2019
@emersion emersion marked this pull request as ready for review December 28, 2019 12:10
@emersion
Copy link
Member Author

emersion commented Dec 28, 2019

This is now ready for review.

The previous failures were due to wlr_output_attach_render being called without wlr_output_commit in Sway. A buffer was registered in the pending state, submitted in the next commit. The leftover buffer was making the commit fail (because all buffers were busy).

To fix this:

  • A new function, wlr_output_rollback, allows to discard the pending state and cancel a wlr_output_attach_render call
  • wlr_output is now more strict and refuses to commit a buffer or modeset a disabled output

I've been testing this pair of PRs on an AMD and Intel GPU, trying things like modesets, hotplugs, DPMS, both manually and automatically triggered by swayidle and kanshi.

While at it, choose the preferred mode instead of the last one.
@ddevault
Copy link
Contributor

Thanks!

@ddevault ddevault merged commit 31f7212 into swaywm:master Dec 30, 2019
ddevault pushed a commit to swaywm/sway that referenced this pull request Dec 30, 2019
This reverts commit 724926e and
re-applies commit 6e0565e.

Outputs now need to be explicitly enabled when performing a modeset.
We need to roll back wlr_output_attach_render when we decide not to
render.

See also: swaywm/wlroots#1797 (wlroots PR)
See also: #4355 (Original sway PR)
See also: #4434 (Revert sway PR)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

3 participants