diff options
author | Qiang Yu <Qiang.Yu@amd.com> | 2017-01-26 18:13:53 +0800 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-03-10 11:05:36 -0500 |
commit | db1326cd6625747e4036e6cdc75bc7a0e1b0426b (patch) | |
tree | af19a089141750df1cef6aad0ec253e27476aa67 /present | |
parent | 1097bc9c184db4c722d5a8d2c5a4c0da9cdc70f5 (diff) |
present: disable page flip only when a slave crtc is active
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.
[1.19: Also fix DMX_LIBS= in configure.ac so it still links - ajax]
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit bb9128fdc86decd6f6e3b0e145011a8c08b1d2b5)
Diffstat (limited to 'present')
-rw-r--r-- | present/present.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/present/present.c b/present/present.c index ef8904537..c9c68dcba 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 */ |