[PATCH xserver v2] randr: Adjust master's last set time with slaves

Hans de Goede hdegoede at redhat.com
Thu Jun 16 12:43:42 UTC 2016


From: Nikhil Mahale <nmahale at nvidia.com>

In prime configurations master's last set time may not be latest
and greatest, adjust it with slaves last set time, pick up greatest
one. Otherwise xserver may end with events which has
lastSetTime < lastConfigTime even if that's not
the case and confuse xrandr client.

Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
Changes in v2 (hdegoede):
-Rebase on top of "xrandrprovider: Do not use separate lists for unbound / source / offload slaves"
-Add my Reviewed-by and S-o-b
---
 randr/randr.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/randr/randr.c b/randr/randr.c
index 95ed7e5..0138dc1 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -580,6 +580,18 @@ RRTellChanged(ScreenPtr pScreen)
         mastersp = pScrPriv;
     }
 
+    xorg_list_for_each_entry(iter, &master->slave_list, slave_head) {
+        pSlaveScrPriv = rrGetScrPriv(iter);
+
+        if (!iter->is_output_slave)
+            continue;
+
+        if (CompareTimeStamps(mastersp->lastSetTime,
+                              pSlaveScrPriv->lastSetTime) == EARLIER) {
+            mastersp->lastSetTime = pSlaveScrPriv->lastSetTime;
+        }
+    }
+
     if (mastersp->changed) {
         UpdateCurrentTimeIf();
         if (mastersp->configChanged) {
-- 
2.7.4



More information about the xorg-devel mailing list