-
Notifications
You must be signed in to change notification settings - Fork 340
Groundwork for wp_linux_explicit_synchronization #1685
base: master
Are you sure you want to change the base?
Conversation
- wlr_surface and wlr_region are bundled into the same file - Allows extensions to add state to wl_surface commits Old surface code has not been removed yet.
Why is that? If we need a valid buffer, can't we keep just one? (And why keep the whole surface state instead of just buffers?)
explicit-synchronization release events don't need to be sent when the buffer is really released. They need to be sent with
+1
Also +1 |
Some extensions affect rendering, such as wp_viewport (which I eventually want to add support for) and the colour management protocol that's being worked on. We also store any wlr_commits of synchronized subsurfaces. We can't correctly render saved buffers unless we save this information too. Others bits of information perhaps aren't as important to stash with the commit (e.g. wp_presentation_feedback), but it doesn't really hurt to have them there, and may make them easier to correctly manage for users. The queue needs to exist for the situation that a client has multiple commits with slow to signal fences.
Yeah, the release_fence can be sent earlier, and I was thinking of adding something like void wlr_commit_send_release_fence(struct wlr_commit *commit, int fence_fd); which sends the fence immediately to the A similar design could be done with things like |
Okay, this last bit is important. If I understand correctly:
Note to self: we need to keep the state around for longer because of this. Some other notes:
|
This gets wlroots to build, but the transitive closure of files depending on wlr_surface.c is actually pretty large. As more interfaces are changed to use the new compositor design, their build definitions will be uncommented. This also includes a very basic test client/server, but this will be removed later.
This also rolls wlr_buffer into wlr_renderer as a user of this new API.
Just some notes from when I was updating
|
We do update the hotspot, this is handled in
I'm not sure this is a good idea. Do you have an API proposal?
We'd need to add map/unmap events to wlr_surface. Not sure it's a good idea either, but it could be. |
It'd all be "extensions" to
Something along the lines of // false if not pointer role
bool wlr_commit_get_pointer_hotspot(struct wlr_commit *commit, int32_t *x, int32_t *y); The hotspot is something tied to the "correct" presentation of a surface, so it makes sense for the
No, you'd just listen for a commit, and check whether there is a buffer or not. |
Not a fan of this TBH.
We need to do a bunch of stuff on map/unmap. For instance damaging the whole surface. |
I'm not going to get too much into this now, since it's not something I'm going to do in this PR, but I don't see any advantage to NOT putting in with the surface/commit.
Our cursor-related APIs need some serious thought put into them (#1363), and I consider
There is nothing stopping you from doing that. Just looking at the rootston code specifically: https://github.com/swaywm/wlroots/blob/master/rootston/seat.c#L570-L589 |
Agreed.
I don't worry a lot about subsurfaces. But yeah, it does have design issues.
I think there should be a thin
But then you need to check whether the last commit was NULL and this one wasn't, and the other way around, and make sure to damage on destroy, etc. |
wlroots has migrated to gitlab.freedesktop.org. This pull request has been moved to: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/1685 |
Another entry in my series of massive PRs that I take too long to finish.
Groundwork needed for #894
Closes #1546
Due to the very large amount of API breakage this introduces, I'd like to give people a heads up and get any feedback on the new design.
To see a full explanation for why I'm doing this, see the issues linked above. But to sum it up quickly:
Our current state-keeping method won't work for explicit-synchronization, since a surface being committed now doesn't really mean it's ready to be shown. Instead of just "pending" and "current", we have to keep a queue of commits, so that we always have a valid buffer handy.
The core part of this is
wlr_commit
. This represents a "coherent presentation" of the client's contents, and should contain all of the information to render a client correctly. Every bit of state synchronized by wl_surface.commit should be changed to use this.Todo:
Extra notes: