Commit a2f0519f authored by Roman Gilg's avatar Roman Gilg
Browse files

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 for equality of
Signed-off-by: Roman Gilg's avatarRoman Gilg <>
parent bf794bd7
Pipeline #181629 passed with stages
in 4 minutes and 21 seconds
......@@ -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 require even equality). */
if (valid && !RegionEqual(valid, &window->winSize))
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))
......@@ -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)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment