xwayland: Pass vblank pointer itself to xwl_present_flip

All these arguments other than damage come from the vblank itself so
passing the vblank simplifies the caller. Moreover, we pass the event_id
solely so we can get back to the event, which is just the (extended)
vblank, so passing the vblank avoids that round trip.

Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
This commit is contained in:
Jessica Clarke 2022-12-05 18:47:17 +00:00 committed by Olivier Fourdan
parent 85a3614668
commit 42d2d9c1d4

View File

@ -738,18 +738,15 @@ xwl_present_clear_window_flip(WindowPtr window)
}
static Bool
xwl_present_flip(WindowPtr present_window,
RRCrtcPtr crtc,
uint64_t event_id,
PixmapPtr pixmap,
Bool sync_flip,
RegionPtr damage)
xwl_present_flip(present_vblank_ptr vblank, RegionPtr damage)
{
WindowPtr present_window = vblank->window;
PixmapPtr pixmap = vblank->pixmap;
struct xwl_window *xwl_window = xwl_window_from_window(present_window);
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(present_window);
BoxPtr damage_box;
struct wl_buffer *buffer;
struct xwl_present_event *event = xwl_present_event_from_id(event_id);
struct xwl_present_event *event = xwl_present_event_from_vblank(vblank);
if (!xwl_window)
return FALSE;
@ -787,7 +784,7 @@ xwl_present_flip(WindowPtr present_window,
wl_surface_commit(xwl_window->surface);
if (!sync_flip) {
if (!vblank->sync_flip) {
xwl_present_window->sync_callback =
wl_display_sync(xwl_window->xwl_screen->display);
wl_callback_add_listener(xwl_present_window->sync_callback,
@ -851,8 +848,7 @@ xwl_present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
} else
damage = RegionDuplicate(&window->clipList);
if (xwl_present_flip(vblank->window, vblank->crtc, vblank->event_id,
vblank->pixmap, vblank->sync_flip, damage)) {
if (xwl_present_flip(vblank, damage)) {
WindowPtr toplvl_window = xwl_present_toplvl_pixmap_window(vblank->window);
PixmapPtr old_pixmap = screen->GetWindowPixmap(window);