summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHong Liu <hong.liu@intel.com>2008-03-10 21:37:09 -0700
committerKeith Packard <keithp@keithp.com>2008-03-10 21:37:09 -0700
commit4dcc8ae1a6903434def1a2706f7c68ff9e2a17c4 (patch)
treea52c823e4c574c9617a434cccc4c96390572f70b
parent7465357396e2f32325791e27f28cbbe9753db3ab (diff)
Move outputs among crtcs as necessary. Fixes 14570
This patch makes new requests override existing crtc allocations. Outputs with restricted crtc usage can now force existing outputs to switch automatcially.
-rw-r--r--xrandr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xrandr.c b/xrandr.c
index e2a657f..41e15dd 100644
--- a/xrandr.c
+++ b/xrandr.c
@@ -1238,13 +1238,13 @@ 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, Bool ignore_state)
{
int c;
int l;
output_t *other;
for (c = 0; c < output->output_info->ncrtc; c++)
@@ -1269,12 +1269,15 @@ check_crtc_for_output (crtc_t *crtc, output_t *output)
break;
/* not on the list, can't clone */
if (l == output->output_info->nclone)
return False;
}
+ if (ignore_state)
+ return True;
+
if (crtc->noutput)
{
/* make sure the state matches */
if (crtc->mode_info != output->mode_info)
return False;
if (crtc->x != output->x)
@@ -1310,13 +1313,13 @@ find_crtc_for_output (output_t *output)
{
crtc_t *crtc;
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, False))
return crtc;
}
return NULL;
}
static void
@@ -1515,13 +1518,13 @@ pick_crtcs_score (output_t *outputs)
crtc = find_crtc_by_xid (output->output_info->crtcs[c]);
if (!crtc)
fatal ("cannot find crtc 0x%x\n", output->output_info->crtcs[c]);
/* reset crtc allocation for following outputs */
disable_outputs (outputs);
- if (!check_crtc_for_output (crtc, output))
+ if (!check_crtc_for_output (crtc, output, True))
continue;
my_score = 1000;
/* slight preference for existing connections */
if (crtc == output->current_crtc_info)
my_score++;