[PATCH] randr: fix xinerama output for output slaves

Dave Airlie airlied at gmail.com
Wed Jul 25 19:56:51 PDT 2012


From: Dave Airlie <airlied at redhat.com>

This fixes the xinerama geometry when output slaves are enabled.

Tested with xdpyinfo -ext XINERAMA before after slave added.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 randr/rrxinerama.c |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 87d6a73..76d728c 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -157,6 +157,7 @@ static int
 RRXineramaScreenCount(ScreenPtr pScreen)
 {
     int i, n;
+    ScreenPtr slave;
 
     n = 0;
     if (rrGetScrPriv(pScreen)) {
@@ -165,6 +166,15 @@ RRXineramaScreenCount(ScreenPtr pScreen)
             if (RRXineramaCrtcActive(pScrPriv->crtcs[i]))
                 n++;
     }
+
+    xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
+        rrScrPrivPtr pSlavePriv;
+        pSlavePriv = rrGetScrPriv(slave);
+        for (i = 0; i < pSlavePriv->numCrtcs; i++)
+            if (RRXineramaCrtcActive(pSlavePriv->crtcs[i]))
+                n++;
+    }
+
     return n;
 }
 
@@ -308,6 +318,7 @@ ProcRRXineramaQueryScreens(ClientPtr client)
     xXineramaQueryScreensReply rep;
     ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
     int n = 0;
+    int i;
 
     REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
 
@@ -330,8 +341,8 @@ ProcRRXineramaQueryScreens(ClientPtr client)
     WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep);
 
     if (n) {
+        ScreenPtr slave;
         rrScrPriv(pScreen);
-        int i;
         int has_primary = 0;
 
         if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
@@ -347,6 +358,13 @@ ProcRRXineramaQueryScreens(ClientPtr client)
             }
             RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]);
         }
+
+        xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) {
+            rrScrPrivPtr pSlavePriv;
+            pSlavePriv = rrGetScrPriv(slave);
+            for (i = 0; i < pSlavePriv->numCrtcs; i++)
+                RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]);
+        }
     }
 
     return Success;
-- 
1.7.10.2



More information about the xorg-devel mailing list