[PATCH linux vdagent 02/10] Fix confusion between output index and crtc index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Get the CRTC ID from the output struct rather than using the
output_index as an index into the array of crtcs
---
 src/vdagent/x11-randr.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c
index 88f723f..802af5c 100644
--- a/src/vdagent/x11-randr.c
+++ b/src/vdagent/x11-randr.c
@@ -399,8 +399,15 @@ static void xrandr_disable_output(struct vdagent_x11 *x11, int output)
         return;
     }
 
+    XRROutputInfo *oinfo = x11->randr.outputs[output];
+    if (oinfo->ncrtc == 0) {
+        syslog(LOG_WARNING, "Output index %i doesn't have any associated CRTCs", output);
+        return;
+    }
+
+    // assume output only has a single crtc
     s = XRRSetCrtcConfig(x11->display, x11->randr.res,
-                         x11->randr.res->crtcs[output],
+                         oinfo->crtcs[0],
                          CurrentTime, 0, 0, None, RR_Rotate_0,
                          NULL, 0);
 
-- 
2.17.2

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]