|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
From 5a1cb0989274fd745569a60c28c9a5ca729cabf6 Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
Date: Thu, 1 Nov 2018 18:44:24 +0100
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
Subject: [PATCH xserver 4/7] xwayland: Replace xwl_window::present_window with
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
::present_flipped
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
There's no need to keep track of the window which last performed a
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
Present flip. This fixes crashes due to the assertion in
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_flips_stop failing. Fixes issue #10.
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
The damage generated by a flip only needs to be ignored once, then
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_window::present_flipped can be cleared. This may fix freezing in
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
the (hypothetical) scenario where Present flips are performed on a
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
window, followed by other drawing requests using the window as the
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
destination, but nothing triggering xwl_present_flips_stop. The damage
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
from the latter drawing requests would continue being ignored.
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
(cherry picked from commit 6b016d58d23d16eaae9908a92ed90547d1926317)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
---
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
hw/xwayland/xwayland-present.c | 56 ++++++++--------------------------
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
hw/xwayland/xwayland.c | 17 ++++++++---
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
hw/xwayland/xwayland.h | 4 ++-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
3 files changed, 27 insertions(+), 50 deletions(-)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
diff --git a/hw/xwayland/xwayland-present.c b/hw/xwayland/xwayland-present.c
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
index 4f517d46b..e6dca5ed0 100644
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
--- a/hw/xwayland/xwayland-present.c
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+++ b/hw/xwayland/xwayland-present.c
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -90,24 +90,19 @@ xwl_present_has_events(struct xwl_present_window *xwl_present_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
!xorg_list_is_empty(&xwl_present_window->release_queue);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
}
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-static inline Bool
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-xwl_present_is_flipping(WindowPtr window, struct xwl_window *xwl_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-{
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- return xwl_window && xwl_window->present_window == window;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-}
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_reset_timer(struct xwl_present_window *xwl_present_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
{
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (xwl_present_has_events(xwl_present_window)) {
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- WindowPtr present_window = xwl_present_window->window;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- Bool is_flipping = xwl_present_is_flipping(present_window,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_window_from_window(present_window));
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ CARD32 timeout;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ if (xwl_present_window->frame_callback)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ timeout = TIMER_LEN_FLIP;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ else
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ timeout = TIMER_LEN_COPY;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_window->frame_timer = TimerSet(xwl_present_window->frame_timer,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- 0,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- is_flipping ? TIMER_LEN_FLIP :
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- TIMER_LEN_COPY,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ 0, timeout,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
&xwl_present_timer_callback,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
} else {
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -118,16 +113,12 @@ xwl_present_reset_timer(struct xwl_present_window *xwl_present_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
void
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_cleanup(WindowPtr window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
{
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- struct xwl_window *xwl_window = xwl_window_from_window(window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
struct xwl_present_event *event, *tmp;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (!xwl_present_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
return;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- if (xwl_window && xwl_window->present_window == window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_window->present_window = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (xwl_present_window->frame_callback) {
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
wl_callback_destroy(xwl_present_window->frame_callback);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_window->frame_callback = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -361,10 +352,6 @@ xwl_present_queue_vblank(WindowPtr present_window,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (!xwl_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
return BadMatch;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- if (xwl_window->present_window &&
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_window->present_window != present_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- return BadMatch;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
event = malloc(sizeof *event);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (!event)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
return BadAlloc;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -433,13 +420,6 @@ xwl_present_check_flip2(RRCrtcPtr crtc,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (!xwl_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
return FALSE;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- /*
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- * Do not flip if there is already another child window doing flips.
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- */
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- if (xwl_window->present_window &&
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_window->present_window != present_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- return FALSE;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
/*
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
* We currently only allow flips of windows, that have the same
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
* dimensions as their xwl_window parent window. For the case of
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -476,8 +456,6 @@ xwl_present_flip(WindowPtr present_window,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (!event)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
return FALSE;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_window->present_window = present_window;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
buffer = xwl_glamor_pixmap_get_wl_buffer(pixmap, &buffer_created);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
event->event_id = event_id;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -502,13 +480,6 @@ xwl_present_flip(WindowPtr present_window,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
/* We can flip directly to the main surface (full screen window without clips) */
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
wl_surface_attach(xwl_window->surface, buffer, 0, 0);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- if (!xwl_present_window->frame_timer ||
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_present_window->frame_timer_firing) {
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- /* Realign timer */
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_present_window->frame_timer_firing = FALSE;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_present_reset_timer(xwl_present_window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- }
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (!xwl_present_window->frame_callback) {
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_window->frame_callback = wl_surface_frame(xwl_window->surface);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
wl_callback_add_listener(xwl_present_window->frame_callback,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -516,6 +487,10 @@ xwl_present_flip(WindowPtr present_window,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
}
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ /* Realign timer */
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ xwl_present_window->frame_timer_firing = FALSE;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ xwl_present_reset_timer(xwl_present_window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
wl_surface_damage(xwl_window->surface, 0, 0,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
damage_box->x2 - damage_box->x1,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
damage_box->y2 - damage_box->y1);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -531,22 +506,15 @@ xwl_present_flip(WindowPtr present_window,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
}
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
wl_display_flush(xwl_window->xwl_screen->display);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ xwl_window->present_flipped = TRUE;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
return TRUE;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
}
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
static void
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_flips_stop(WindowPtr window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
{
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- struct xwl_window *xwl_window = xwl_window_from_window(window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
struct xwl_present_window *xwl_present_window = xwl_present_window_priv(window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- if (!xwl_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- return;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- assert(xwl_window->present_window == window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- xwl_window->present_window = NULL;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
/* Change back to the fast refresh rate */
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xwl_present_reset_timer(xwl_present_window);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
}
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
index 96b4db18c..988b8e17d 100644
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
--- a/hw/xwayland/xwayland.c
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+++ b/hw/xwayland/xwayland.c
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -370,6 +370,18 @@ damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
struct xwl_window *xwl_window = data;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+#ifdef GLAMOR_HAS_GBM
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ if (xwl_window->present_flipped) {
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ /* This damage is from a Present flip, which already committed a new
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ * buffer for the surface, so we don't need to do anything in response
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ */
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ RegionEmpty(DamageRegion(pDamage));
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ xorg_list_del(&xwl_window->link_damage);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ xwl_window->present_flipped = FALSE;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ return;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+#endif
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xorg_list_add(&xwl_window->link_damage, &xwl_screen->damage_window_list);
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
}
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -721,11 +733,6 @@ xwl_screen_post_damage(struct xwl_screen *xwl_screen)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
xorg_list_for_each_entry_safe(xwl_window, next_xwl_window,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
&xwl_screen->damage_window_list, link_damage) {
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-#ifdef GLAMOR_HAS_GBM
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- /* Present on the main surface. So don't commit here as well. */
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- if (xwl_window->present_window)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- continue;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
-#endif
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
/* If we're waiting on a frame callback from the server,
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
* don't attach a new buffer. */
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
if (xwl_window->frame_callback)
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
index 3f4a601fe..a79f836ad 100644
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
--- a/hw/xwayland/xwayland.h
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+++ b/hw/xwayland/xwayland.h
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
@@ -182,7 +182,9 @@ struct xwl_window {
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
struct xorg_list link_damage;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
struct wl_callback *frame_callback;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
Bool allow_commits;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
- WindowPtr present_window;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+#ifdef GLAMOR_HAS_GBM
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+ Bool present_flipped;
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
+#endif
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
};
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
#ifdef GLAMOR_HAS_GBM
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
--
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
2.19.2
|
|
![](https://seccdn.libravatar.org/avatar/b8c786494c1b925686153644e86380042018696a3d7cedba1c4835f72171f20e?s=16&d=retro) |
e625aaa |
|