[PATCH xserver] present: disable page flip only when a slave crtc is active
Qiang Yu
Qiang.Yu at amd.com
Thu Jan 26 10:13:53 UTC 2017
This prevents the tearing of moving window in a composite WM
desktop when output slave is attached but none of its crtc is
really active.
Signed-off-by: Qiang Yu <Qiang.Yu at amd.com>
---
present/present.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/present/present.c b/present/present.c
index a7ca06e..5f32679 100644
--- a/present/present.c
+++ b/present/present.c
@@ -118,6 +118,18 @@ present_flip_pending_pixmap(ScreenPtr screen)
}
static Bool
+present_check_output_slaves_active(ScreenPtr pScreen)
+{
+ ScreenPtr pSlave;
+
+ xorg_list_for_each_entry(pSlave, &pScreen->slave_list, slave_head) {
+ if (RRHasScanoutPixmap(pSlave))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static Bool
present_check_flip(RRCrtcPtr crtc,
WindowPtr window,
PixmapPtr pixmap,
@@ -145,7 +157,7 @@ present_check_flip(RRCrtcPtr crtc,
return FALSE;
/* Fail to flip if we have slave outputs */
- if (screen->output_slaves)
+ if (screen->output_slaves && present_check_output_slaves_active(screen))
return FALSE;
/* Make sure the window hasn't been redirected with Composite */
--
2.7.4
More information about the xorg-devel
mailing list