summaryrefslogtreecommitdiff
path: root/src/i830_display.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-11-01 12:23:50 -0800
committerEric Anholt <eric@anholt.net>2006-11-01 12:23:50 -0800
commitfb94c1210966f7875e5f034f10ea31c06c502c3a (patch)
treed7915f0f38b71d76cba50801aa7ed14b4ca3d442 /src/i830_display.c
parentf30d7f912f36b110c3af7dc795e35456593781ab (diff)
Move mode lists from per-pipe to per-output.
This should let RandR do the right thing in exposing the modes to userland. As a side effect of getting this working, the SDVO pixel clock range code was fixed and the mode valid tests for various outputs got extended. Also, LVDS grew a get_modes for the fixed panel mode. Note that we now no longer do automatic enabling of outputs at xrandr -s 0, hotkey, or VT switch. That will be left to generic RandR code later. Also, generic modes and user-defined modes are once again not validated into the lists, so this is a regression there.
Diffstat (limited to 'src/i830_display.c')
-rw-r--r--src/i830_display.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/i830_display.c b/src/i830_display.c
index 3151fd10..b3019f80 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -260,8 +260,8 @@ i830PipeSetBase(ScrnInfoPtr pScrn, int pipe, int x, int y)
}
/**
- * In the current world order, there is a list of per-pipe modes, which may or
- * may not include the mode that was asked to be set by XFree86's mode
+ * In the current world order, there are lists of modes per output, which may
+ * or may not include the mode that was asked to be set by XFree86's mode
* selection. Find the closest one, in the following preference order:
*
* - Equality
@@ -272,21 +272,32 @@ static DisplayModePtr
i830PipeFindClosestMode(ScrnInfoPtr pScrn, int pipe, DisplayModePtr pMode)
{
I830Ptr pI830 = I830PTR(pScrn);
- DisplayModePtr pBest = NULL, pScan;
+ DisplayModePtr pBest = NULL, pScan = NULL;
+ int i;
+
+ /* Assume that there's only one output connected to the given CRTC. */
+ for (i = 0; i < pI830->num_outputs; i++) {
+ if (pI830->output[i].pipe == pipe &&
+ !pI830->output[i].disabled &&
+ pI830->output[i].probed_modes != NULL)
+ {
+ pScan = pI830->output[i].probed_modes;
+ }
+ }
/* If the pipe doesn't have any detected modes, just let the system try to
* spam the desired mode in.
*/
- if (pI830->pipeMon[pipe] == NULL) {
+ if (pScan == NULL) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"No pipe mode list for pipe %d,"
"continuing with desired mode\n", pipe);
return pMode;
}
- assert(pScan->VRefresh != 0.0);
- for (pScan = pI830->pipeMon[pipe]->Modes; pScan != NULL;
- pScan = pScan->next) {
+ for (; pScan != NULL; pScan = pScan->next) {
+ assert(pScan->VRefresh != 0.0);
+
/* If there's an exact match, we're done. */
if (I830ModesEqual(pScan, pMode)) {
pBest = pMode;