summaryrefslogtreecommitdiff
path: root/src/i830_lvds.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_lvds.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_lvds.c')
-rw-r--r--src/i830_lvds.c39
1 files changed, 34 insertions, 5 deletions
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 4b899033..7b9fe634 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -189,6 +189,39 @@ i830_lvds_detect(ScrnInfoPtr pScrn, I830OutputPtr output)
return OUTPUT_STATUS_CONNECTED;
}
+/**
+ * Return the list of DDC modes if available, or the BIOS fixed mode otherwise.
+ */
+static DisplayModePtr
+i830_lvds_get_modes(ScrnInfoPtr pScrn, I830OutputPtr output)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+ DisplayModePtr modes, new;
+ char stmp[32];
+
+ modes = i830_ddc_get_modes(pScrn, output);
+ if (modes != NULL)
+ return modes;
+
+ new = xnfcalloc(1, sizeof (DisplayModeRec));
+ sprintf(stmp, "%dx%d", pI830->PanelXRes, pI830->PanelYRes);
+ new->name = xnfalloc(strlen(stmp) + 1);
+ strcpy(new->name, stmp);
+ new->HDisplay = pI830->PanelXRes;
+ new->VDisplay = pI830->PanelYRes;
+ new->HSyncStart = pI830->panel_fixed_hactive + pI830->panel_fixed_hsyncoff;
+ new->HSyncEnd = new->HSyncStart + pI830->panel_fixed_hsyncwidth;
+ new->HTotal = new->HSyncEnd + 1;
+ new->VSyncStart = pI830->panel_fixed_vactive + pI830->panel_fixed_vsyncoff;
+ new->VSyncEnd = new->VSyncStart + pI830->panel_fixed_vsyncwidth;
+ new->VTotal = new->VSyncEnd + 1;
+ new->Clock = pI830->panel_fixed_clock;
+
+ new->type = M_T_PREFERRED;
+
+ return new;
+}
+
void
i830_lvds_init(ScrnInfoPtr pScrn)
{
@@ -235,11 +268,7 @@ i830_lvds_init(ScrnInfoPtr pScrn)
pI830->output[pI830->num_outputs].pre_set_mode = i830_lvds_pre_set_mode;
pI830->output[pI830->num_outputs].post_set_mode = i830_lvds_post_set_mode;
pI830->output[pI830->num_outputs].detect = i830_lvds_detect;
- /* This will usually return NULL on laptop panels, which is no good.
- * We need to construct a mode from the fixed panel info, and return a copy
- * of that when DDC is unavailable.
- */
- pI830->output[pI830->num_outputs].get_modes = i830_ddc_get_modes;
+ pI830->output[pI830->num_outputs].get_modes = i830_lvds_get_modes;
/* Set up the LVDS DDC channel. Most panels won't support it, but it can
* be useful if available.