-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output: use backend commits #316
base: master
Are you sure you want to change the base?
Conversation
60c3350
to
0c377a1
Compare
output.c
Outdated
} | ||
|
||
struct wlr_swapchain *swapchain = NULL; | ||
if (!wlr_output_configure_primary_swapchain(state->output, state, &swapchain)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I think we need to do some work on the swapchain allocation to better reap the benefits of device-wide commits.
This currently picks a buffer type on each output in series, each blissfully unaware of the others' consequences to available memory bandwidth and shadow plane requirements as the resulting buffers are not committed. This seems like it would be quite a lot less likely to succeed than our existing setup, where each output commit at least observed the restrictions caused by the prior commits - and that's before considering the all-or-nothing commit we're now doing.
If we want to be able to bring up outputs in spite of modifier restrictions without needing users to set WLR_DRM_NO_MODIFIERS=1, we'd want a flow that looks like:
- Set up swapchain with modifiers for all outputs
- Try a backend-wide test and commit if successful
- If failed, retry with modifierless swapchains for all outputs
- Try a backend-wide test and commit if successful
This does seem like something one might want a helper for...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a good point…
Backend-wide commits are still good to have even without the modifier fallback stuff: they provide atomic output configurations without some half-applied state in case of failures.
I'd prefer to keep the modifier fallback stuff as a follow up of the backend commits, but we will indeed either need to handle this in a helper or in wlr_backend_commit()
…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
I for fun tried to hack up a solution in clay (https://git.sr.ht/~kennylevinsen/clay/tree/dc82a8c/item/src/clay/output.c#L236), exposing a specialized version of wlr_output_configure_primary_swapchain
(wlr_output_try_for_swapchain
) that just grabs a buffer with the configuration you want, successful or not.
Seems to work quite well so far, so there's hope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR now uses the new helper from wlroots!4567.
Scene-graph will do the right thing without this call.
Pass the whole new desired state to the backend, so that the backend can leverage KMS atomic commits.
0c377a1
to
4f1ec0d
Compare
Pass the whole new desired state to the backend, so that the
backend can leverage KMS atomic commits.
Depends on #313
See https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4548