Commit 7da8e7ba authored by Roman Gilg's avatar Roman Gilg Committed by Matt Turner

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's avatarRoman Gilg <subdiff@gmail.com>
(cherry picked from commit 591916ea)
parent 4a65b661
......@@ -278,7 +278,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 ||
......@@ -325,11 +327,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))
present_wnmd_set_abort_flip(window);
} 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);
}
......@@ -337,7 +339,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)
......
Markdown is supported
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