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

Move primary wlr_swapchain handling out of backends #2505

Merged
merged 8 commits into from
Jun 7, 2021

Conversation

emersion
Copy link
Member

@emersion emersion commented Dec 1, 2020

Move the allocator/renderer-related code out of backends into the common backend/output code for everything related to the primary buffer. This process shouldn't break any compositor.

The DRM backend has not been migrated yet, because it requires more work.

  • Allow backends to be created without get_renderer
  • Allow outputs to be created without {attach,rollback}_render
  • Create allocator and renderer in wlr_backend
  • Create swapchain in wlr_output
  • Add support for the Pixman renderer
  • Migrate backends

References: #1352
Depends on: #2496
Depends on: #2498
Depends on: #2495
Depends on: #2511
Depends on: #2507
Depends on: #2561

@emersion
Copy link
Member Author

emersion commented Apr 6, 2021

  • We need to select a CRTC for the connector prior to wlr_output_test/wlr_output_commit, so that we can return a meaningful list of formats out of wlr_output_impl.get_dmabuf_primary_formats.
  • Ideally we should completely wire up test-only commits to wlr_output_test to implement the modifier-less fallback path. Although I suppose we can also let the atomic commit fail, just like we currently do internally in the DRM backend. The downside is that a commit failure resets the pending state.

This function returns the set of formats the backend can use for the
primary buffer. It can be used to allocate a buffer suitable for
scan-out.
Introduce output_pick_format that can be re-used for the primary
buffer too.
If these aren't provided by the backend, allocate a swapchain for the
output.
Rely on wlr_output's generic swapchain support instead of creating our
own. The headless output now simply keeps a reference to the front buffer
and does nothing else.
Rely on wlr_output's generic swapchain handling.

We still need a renderer for cursor readback, sadly.
Rely on wlr_output's generic swapchain handling.
@emersion emersion marked this pull request as ready for review June 2, 2021 12:09
@emersion
Copy link
Member Author

emersion commented Jun 2, 2021

This has been rebased and updated to work with the Pixman renderer.

This is ready for review.

@emersion emersion merged commit 543f5b3 into swaywm:master Jun 7, 2021
@emersion emersion deleted the output-swapchain branch June 7, 2021 13:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants