This repository was 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
backend/drm: implement output layers #3095
Draft
emersion
wants to merge
8
commits into
swaywm:master
Choose a base branch
from
emersion:output-layers-drm
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
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
Closed
fa6ec84
to
ba7ea4a
Compare
The ad-hoc copies of I'll refactor the DRM backend a bit to avoid doing such copies. |
2dedde2
to
e408b83
Compare
This new API allows compositors to display buffers without needing to perform rendering operations. This API can be implemented on Wayland using subsurfaces and on DRM using KMS planes. The goal is to make use of this API in a future scene-graph API. References: swaywm#1826
The output layer API is implemented using subsurfaces. I chose to implement this API in the Wayland backend before doing so in the DRM backend, because it's way easier on Wayland. On DRM, one needs to figure out how buffers can be mapped to KMS planes (libliftoff can help) and perform atomic test-only commits (our current DRM backend isn't ready for this).
This new example demonstrates how to use the wlr_output_layer API. It's a compositor that displays all client surfaces using wlr_output_layer. To test, one can for instance run: build/examples/output-layers -s 'weston-simple-dmabuf-egl & weston-simple-egl' Under the Wayland backend (where layers work as long as clients use DMA-BUFs), this should display two surfaces with remote wl_subsurfaces.
"state" is easily confused with wlr_output_state.
Previously, we were copying wlr_output_state on the stack and patching it up to be guaranteed to have a proper drmModeModeInfo stored in it (and not a custom mode). Also, we had a bunch of helpers deriving DRM-specific information from the generic wlr_output_state. Copying the wlr_output_state worked fine so far, but with output layers we'll be getting a wl_list in there. An empty wl_list stores two pointers to itself, copying it on the stack blindly results in infinite loops in wl_list_for_each. To fix this, rework our DRM backend to stop copying wlr_output_state, instead add a new struct wlr_drm_connector_state which holds both the wlr_output_state and additional DRM-specific information.
TODO: - Make it work on multi-output setups - Make it handle VRR and gamma
This will be useful for implementing the output layers API.
Delegate all of the work to libliftoff.
e408b83
to
7d2be3b
Compare
wlroots has migrated to gitlab.freedesktop.org. This pull request has been moved to: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3095 |
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.
Depends on #1985
Depends on #3100