[patch] xrandr tool: ignore old state check when remapping crtc

Hong Liu hong.liu at intel.com
Sun Feb 24 22:52:15 PST 2008


Fix bug 14570.

We should ignore old state match when trying to reshuffle the CRTCs
for new outputs. Otherwise we will fail to assign an already used CRTC
to a new output.

Thanks,
Hong


diff --git a/xrandr.c b/xrandr.c
index e2a657f..6d2dcb2 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -1241,7 +1241,7 @@ mark_changing_crtcs (void)
  * Test whether 'crtc' can be used for 'output'
  */
 Bool
-check_crtc_for_output (crtc_t *crtc, output_t *output)
+check_crtc_for_output (crtc_t *crtc, output_t *output, int ignore_state)
 {
     int		c;
     int		l;
@@ -1272,6 +1272,9 @@ check_crtc_for_output (crtc_t *crtc, output_t *output)
 	    return False;
     }
 
+    if (ignore_state)
+	return True;
+
     if (crtc->noutput)
     {
 	/* make sure the state matches */
@@ -1313,7 +1316,7 @@ find_crtc_for_output (output_t *output)
 	crtc = find_crtc_by_xid (output->output_info->crtcs[c]);
 	if (!crtc) fatal ("cannot find crtc 0x%x\n", output->output_info->crtcs[c]);
 
-	if (check_crtc_for_output (crtc, output))
+	if (check_crtc_for_output (crtc, output, 0))
 	    return crtc;
     }
     return NULL;
@@ -1518,7 +1521,7 @@ pick_crtcs_score (output_t *outputs)
 	
 	/* reset crtc allocation for following outputs */
 	disable_outputs (outputs);
-	if (!check_crtc_for_output (crtc, output))
+	if (!check_crtc_for_output (crtc, output, 1))
 	    continue;
 	
 	my_score = 1000;





More information about the xorg mailing list