This repository has been archived by the owner on Nov 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 341
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check that buffer can be scanned out in wlr_output_test instead of wlr_output_attach_buffer. This allows the backend to have access to the whole pending state when performing the check. This brings the wlr_output API more in line with the KMS API. This removes the need for wlr_output_attach_buffer to return a value, and for wlr_output_impl.attach_buffer.
This should also be used when implementing output-management, right? |
Indeed! |
emersion
added a commit
to emersion/wlroots
that referenced
this pull request
Apr 6, 2020
Most of the pending output state is not forwarded to the backend prior to an output commit. For instance, wlr_output_set_mode just stashes the mode without calling any wlr_output_impl function. wlr_output_impl.commit is responsible for applying the pending mode. However, there are exceptions to this rule. The first one is wlr_output_attach_render. It won't go away before renderer v6 is complete, because it needs to set the current EGL surface. The second one is wlr_output_attach_buffer. wlr_output_impl.attach_buffer is removed in [1]. When wlr_output_rollback is called, all pending state is supposed to be cleared. This works for all the state except the two exceptions mentionned above. To fix this, introduce wlr_output_impl.rollback. Right now, the backend resets the current EGL surface. This prevents GL commands from affecting the output after wlr_output_rollback. This patch is required for FBO-based outputs to work properly. The compositor might be using FBOs for its own purposes [2], having leftover FBO state can have bad consequences. [1]: swaywm#2097 [2]: swaywm#2063 (comment)
emersion
added a commit
to emersion/sway
that referenced
this pull request
Apr 8, 2020
Update for [1]. Everything is now checked at commit-time. [1]: swaywm/wlroots#2097
Sway pull request: swaywm/sway#5188 |
ddevault
approved these changes
Apr 8, 2020
Still miffed that we have to brute force testing configurations to find the subset which works... but thanks! |
ddevault
pushed a commit
to swaywm/sway
that referenced
this pull request
Apr 8, 2020
Update for [1]. Everything is now checked at commit-time. [1]: swaywm/wlroots#2097
emersion
added a commit
to emersion/wlroots
that referenced
this pull request
Apr 8, 2020
Most of the pending output state is not forwarded to the backend prior to an output commit. For instance, wlr_output_set_mode just stashes the mode without calling any wlr_output_impl function. wlr_output_impl.commit is responsible for applying the pending mode. However, there are exceptions to this rule. The first one is wlr_output_attach_render. It won't go away before renderer v6 is complete, because it needs to set the current EGL surface. The second one is wlr_output_attach_buffer. wlr_output_impl.attach_buffer is removed in [1]. When wlr_output_rollback is called, all pending state is supposed to be cleared. This works for all the state except the two exceptions mentionned above. To fix this, introduce wlr_output_impl.rollback. Right now, the backend resets the current EGL surface. This prevents GL commands from affecting the output after wlr_output_rollback. This patch is required for FBO-based outputs to work properly. The compositor might be using FBOs for its own purposes [2], having leftover FBO state can have bad consequences. [1]: swaywm#2097 [2]: swaywm#2063 (comment)
ddevault
pushed a commit
that referenced
this pull request
Apr 8, 2020
Most of the pending output state is not forwarded to the backend prior to an output commit. For instance, wlr_output_set_mode just stashes the mode without calling any wlr_output_impl function. wlr_output_impl.commit is responsible for applying the pending mode. However, there are exceptions to this rule. The first one is wlr_output_attach_render. It won't go away before renderer v6 is complete, because it needs to set the current EGL surface. The second one is wlr_output_attach_buffer. wlr_output_impl.attach_buffer is removed in [1]. When wlr_output_rollback is called, all pending state is supposed to be cleared. This works for all the state except the two exceptions mentionned above. To fix this, introduce wlr_output_impl.rollback. Right now, the backend resets the current EGL surface. This prevents GL commands from affecting the output after wlr_output_rollback. This patch is required for FBO-based outputs to work properly. The compositor might be using FBOs for its own purposes [2], having leftover FBO state can have bad consequences. [1]: #2097 [2]: #2063 (comment)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
wlr_output_test
, which can be used to check whether pending output changes would be accepted by the backend. This allows compositors to try different changes before attempting a commit.Right now this function just performs the check previously done in
attach_buffer
andcommit
. This change allows test-only commits to be run inwlr_output_test
, which is necessary for using libliftoff (thus necessary for DRM support of output layers introduced in #1985).Compositors implementing wlr-output-management can now call this function instead of returning true unconditionally.
Should
wlr_output_test
be implicitly called inwlr_output_commit
? This would add a guarantee for backends that the output changes are valid when theircommit
function is called.Sway PR: swaywm/sway#5188
Breaking changes:
wlr_output_attach_buffer
doesn't return abool
anymore. The checks previously performed in this function are now performed inwlr_output_commit
and the newwlr_output_test
function.wlr_output_impl.attach_buffer
is gone, buffer checks now need to be performed incommit
. A newtest
function has been added.