xwayland: don't scrap pending present requests
commite1f16fb1aca529b6609ab3b136a867104683ba2a
authorErik Kurzinger <ekurzinger@nvidia.com>
Wed, 31 Jan 2024 19:36:45 +0000 (31 11:36 -0800)
committerOlivier Fourdan <fourdan@gmail.com>
Tue, 9 Apr 2024 06:11:03 +0000 (9 06:11 +0000)
tree60d250f3b3955954144d950dfc6db15e4c36fcfc
parent87bf2cafcc27e609e4a75d0596682c2619f3f1dc
xwayland: don't scrap pending present requests

When a present request is received, Xwayland will check if there is an
existing request targeting the same window and msc and scrap the older
request if so. Alas, this does not interact well the older fence-based
or newer syncobj-based synchronization features of the Present
extension.

Since execution of a request may be delayed for an unknown length of
time while waiting for a fence to be signaled, the target msc computed
upon receiving a request may not match the actual msc at which the
request is executed. Therefore, we cannot determine in advance whether a
more recently received request will make an older request redundant.

This change removes the code to scrap pending present requests.

We must also ensure requests are executed in the correct order even if
their fences are signaled out of order. To achieve this, whenever
execution of a request needs to wait for a fence, execution of any
later-received requests will be blocked until the earlier request is
ready. The blocked requests will be added to a list tracked in the
xwl_present_window struct. Once the earlier request's fence is signaled,
any blocked requests will be re-executed.

Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
hw/xwayland/xwayland-present.c
hw/xwayland/xwayland-present.h