summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorRoman Gilg <subdiff@gmail.com>2020-07-24 12:21:37 +0200
committerRoman Gilg <subdiff@gmail.com>2020-07-24 16:32:17 +0200
commit591916ea9e7a77f68f436b4a541402d9deadfe64 (patch)
tree878aa27726bdd5cdcecef451e548f044ae7b92b1 /present
parentbf794bd7bfa3bdcf7de95ce237eb50ecc6ec11d2 (diff)
present: Check valid region in window mode flips
For Pixmap flips to have well defined outcomes the window must be contained by the valid region if such region was specified. The valid region is inserted as an argument to the check in window mode. Setting this argument is missing in screen mode as well but we ignore it for now and only add it to window mode. It seems there are none or only very few clients actually making use of valid regions at the moment. For simplicity we therefore just check if a valid region was set by the client and in this case do never flip, independently of the window being contained by the region or not. Signed-off-by: Roman Gilg <subdiff@gmail.com>
Diffstat (limited to 'present')
-rw-r--r--present/present_wnmd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/present/present_wnmd.c b/present/present_wnmd.c
index 23a8863fc..b0d79b80f 100644
--- a/present/present_wnmd.c
+++ b/present/present_wnmd.c
@@ -294,7 +294,9 @@ present_wnmd_check_flip(RRCrtcPtr crtc,
if (x_off || y_off)
return FALSE;
- // TODO: Check for valid region?
+ /* Valid area must contain window (for simplicity for now just never flip when one is set). */
+ if (valid)
+ return FALSE;
/* Flip pixmap must have same dimensions as window */
if (window->drawable.width != pixmap->drawable.width ||
@@ -341,11 +343,11 @@ present_wnmd_check_flip_window (WindowPtr window)
if (flip_pending) {
if (!present_wnmd_check_flip(flip_pending->crtc, flip_pending->window, flip_pending->pixmap,
- flip_pending->sync_flip, NULL, 0, 0, NULL))
+ flip_pending->sync_flip, flip_pending->valid, 0, 0, NULL))
window_priv->flip_pending->abort_flip = TRUE;
} else if (flip_active) {
if (!present_wnmd_check_flip(flip_active->crtc, flip_active->window, flip_active->pixmap,
- flip_active->sync_flip, NULL, 0, 0, NULL))
+ flip_active->sync_flip, flip_active->valid, 0, 0, NULL))
present_wnmd_flips_stop(window);
}
@@ -353,7 +355,7 @@ present_wnmd_check_flip_window (WindowPtr window)
xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) {
if (vblank->queued && vblank->flip &&
!present_wnmd_check_flip(vblank->crtc, window, vblank->pixmap,
- vblank->sync_flip, NULL, 0, 0, &reason)) {
+ vblank->sync_flip, vblank->valid, 0, 0, &reason)) {
vblank->flip = FALSE;
vblank->reason = reason;
if (vblank->sync_flip)