summaryrefslogtreecommitdiff
path: root/src/i830_crt.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_crt.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_crt.c')
-rw-r--r--src/i830_crt.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/i830_crt.c b/src/i830_crt.c
index bd0099ac..407ebe3d 100644
--- a/src/i830_crt.c
+++ b/src/i830_crt.c
@@ -31,7 +31,7 @@
#include "xf86.h"
#include "i830.h"
-
+#include "i830_xf86Modes.h"
static void
i830_crt_dpms(ScrnInfoPtr pScrn, I830OutputPtr output, int mode)
{
@@ -80,6 +80,12 @@ static int
i830_crt_mode_valid(ScrnInfoPtr pScrn, I830OutputPtr output,
DisplayModePtr pMode)
{
+ if (pMode->Flags & V_DBLSCAN)
+ return MODE_NO_DBLESCAN;
+
+ if (pMode->Clock > 400000 || pMode->Clock < 25000)
+ return MODE_CLOCK_RANGE;
+
return MODE_OK;
}
@@ -273,6 +279,37 @@ i830_crt_detect(ScrnInfoPtr pScrn, I830OutputPtr output)
return OUTPUT_STATUS_UNKNOWN;
}
+static DisplayModePtr
+i830_crt_get_modes(ScrnInfoPtr pScrn, I830OutputPtr output)
+{
+ DisplayModePtr modes;
+ MonRec fixed_mon;
+
+ modes = i830_ddc_get_modes(pScrn, output);
+ if (modes != NULL)
+ return modes;
+
+ if (output->detect(pScrn, output) == OUTPUT_STATUS_DISCONNECTED)
+ return NULL;
+
+ /* We've got a potentially-connected monitor that we can't DDC. Return a
+ * fixed set of VESA plus user modes for a presumed multisync monitor with
+ * some reasonable limits.
+ */
+ fixed_mon.nHsync = 1;
+ fixed_mon.hsync[0].lo = 31.0;
+ fixed_mon.hsync[0].hi = 100.0;
+ fixed_mon.nVrefresh = 1;
+ fixed_mon.vrefresh[0].lo = 50.0;
+ fixed_mon.vrefresh[0].hi = 70.0;
+
+ modes = i830xf86DuplicateModes(pScrn, pScrn->monitor->Modes);
+ i830xf86ValidateModesSync(pScrn, modes, &fixed_mon);
+ i830xf86PruneInvalidModes(pScrn, &modes, TRUE);
+
+ return modes;
+}
+
void
i830_crt_init(ScrnInfoPtr pScrn)
{
@@ -286,7 +323,7 @@ i830_crt_init(ScrnInfoPtr pScrn)
pI830->output[pI830->num_outputs].pre_set_mode = i830_crt_pre_set_mode;
pI830->output[pI830->num_outputs].post_set_mode = i830_crt_post_set_mode;
pI830->output[pI830->num_outputs].detect = i830_crt_detect;
- pI830->output[pI830->num_outputs].get_modes = i830_ddc_get_modes;
+ pI830->output[pI830->num_outputs].get_modes = i830_crt_get_modes;
/* Set up the DDC bus. */
I830I2CInit(pScrn, &pI830->output[pI830->num_outputs].pDDCBus,