mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-31 06:40:08 +01:00
xwayland/present: Skip queued flip when a new one becomes ready
If multiple flips become ready for the same MSC, we would previously execute them all sequentially, one per MSC for sync flips. This could result in an unbounded flip queue and corresponding memory consumption. With implicit sync, leave the mailbox handling to the compositor for async flips though. v2: * Use present_vblank_rec::sync_flip. Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1664 Fixes:e1f16fb1ac("xwayland: don't scrap pending present requests") (cherry picked from commit0d9a54aa97) Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1494>
This commit is contained in:
parent
07470d2ca2
commit
9f28e2a85d
1 changed files with 19 additions and 0 deletions
|
|
@ -1053,6 +1053,25 @@ retry:
|
|||
}
|
||||
|
||||
if (flip_pending && vblank->flip && !notify_only) {
|
||||
present_vblank_ptr flip_queued_last;
|
||||
|
||||
flip_queued_last = xorg_list_last_entry(&xwl_present_window->flip_queue,
|
||||
present_vblank_rec, event_queue);
|
||||
|
||||
/* Do mailbox handling for queued flips, to prevent the flip queue from
|
||||
* growing unbounded.
|
||||
*/
|
||||
if (flip_queued_last != flip_pending &&
|
||||
(flip_queued_last->sync_flip
|
||||
#ifdef DRI3
|
||||
|| vblank->acquire_syncobj
|
||||
#endif
|
||||
)) {
|
||||
xorg_list_del(&flip_queued_last->event_queue);
|
||||
present_vblank_scrap(flip_queued_last);
|
||||
xwl_present_re_execute(flip_queued_last);
|
||||
}
|
||||
|
||||
DebugPresent(("\tr %" PRIu64 " %p (pending %p)\n",
|
||||
vblank->event_id, vblank, flip_pending));
|
||||
xorg_list_append(&vblank->event_queue, &xwl_present_window->flip_queue);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue