Commit Graph

772 Commits

Author SHA1 Message Date
Keith Packard 86558cc622 Prefer earliest CRTC when mapping to outputs.
For some reason, the code was preferring the last possible output when
mapping outputs to crtcs. Use the earlier CRTC instead to make the i830
driver consistent with BIOS usage.
2006-12-16 21:09:31 -08:00
Keith Packard 8e6ab99b31 Not restoring active outputs. Wait for input sync before enabling outputs.
Oops--looks like a typo to me; the code was callint set_target_output
instead of set_active_outputs.

BIOS loops waiting for the SDVO input to sync before enabling outputs, this
makes sense to me.
2006-12-16 21:06:36 -08:00
Keith Packard bffd611b0a Follow BIOS order in writing DPLL/DPLL_MD registers.
965 BIOS writes DPLL and then DPLL_MD.
945 BIOS writes DPLL twice.
2006-12-16 21:03:15 -08:00
Keith Packard 9b1a1b170b reorder restore writes for 965 VGA 2006-12-16 16:53:49 -08:00
Keith Packard 60411bc4d0 Follow BIOS PLL write protocol (disable,enable,enable).
This gets VGA output and text restore working, but SDVO is still not working.
2006-12-14 18:36:44 -08:00
Keith Packard 082519f34b Turn pll/pipe/plane on in crtc_set_mode
Instead of delaying pll/pipe/plane enables to the dpms function, turn them
on right away in the crtc_set_mode function. To avoid rewriting these
registers in the subsequent dpms function, check each register written there
to see if the enable bit is already on and don't rewrite.
2006-12-14 16:51:48 -08:00
Keith Packard 55e7a32096 Respect Virtual in xorg.conf
Instead of growing virtual to fit our desired sizes, if it is set in the
config file, use the value as the virtual size and make the default
configuration fit within that size (if possible).
2006-12-14 16:50:26 -08:00
Keith Packard d4142abc68 Set frame buffer size ranges in xf86_config.
Initialization and default configuration code needs to know the range of
legitimate sizes for the frame buffer.
2006-12-14 13:49:08 -08:00
Keith Packard 2b5a5542ad Change TV modes from Preferred to Driver.
This avoids having the artificial TV mode size drive overall screen size.
2006-12-14 13:43:50 -08:00
Keith Packard 3fe802453a Move xf86CrtcConfig to ScrnInfo private.
Pull xf86CrtcConfig out of the driver private structure and allocate a
ScrnInfo private index for it. Also, make the arrays of outputs and crtcs
dynamic instead of fixed.
2006-12-13 13:15:14 -08:00
Keith Packard 0f6addc8a6 Merge branch 'modesetting-origin' into modesetting 2006-12-13 12:10:31 -08:00
Keith Packard 001e272437 Auto-detect working TV output by checking TV regs functionality.
We can't figure out which chips are supposed to have TV out, so instead we
prod the TV_DAC register to see if it will hold the value written to it, if
not, we assume the chip doesn't have TV out.
2006-12-13 12:08:58 -08:00
Eric Anholt 3fa5b39983 Add magic double-write of the dpll register to fix mac mini cold boot. 2006-12-13 12:04:33 -08:00
Eric Anholt e27372e85a Add some caution with PCI write posting and DPLL delays to i830_crtc_dpms.
While it doesn't specifically help/hurt my test case, we've seen enough
mysterious behavior that caution is probably warranted.
2006-12-13 12:04:33 -08:00
Keith Packard df0a5a25aa Rename outputs to TMDS-1/TMDS-2, LVDS, TV and VGA.
These names are reasonably short and describe the connector rather than the
target media, but we don't appear to have any way to determine what is on
the other end of the wire. More importantly, they're all unique now.
2006-12-13 11:38:18 -08:00
Keith Packard 4cdcaac26b Write dpll_md register while updating dpll as that appears to be required.
SDVO multiplier on 965 is in the dpll_md register; for some reason, that
needs to be written along with the dpll value or the multiplier doesn't get
set correctly.
2006-12-12 23:26:00 -08:00
Keith Packard 9dd1520421 Merge branch 'modesetting-origin' into modesetting 2006-12-12 22:52:59 -08:00
Keith Packard d57a258153 Elide duplicate modes in pScrn->monitor.
xf86DDCMonitorSet dumps all of the DDC-discovered modes
into the monitor mode list without checking to see if they
are already present. This provides an ever-changing list of
modes for outputs which have no DDC and which simply duplicate the monitor
mode list.
2006-12-12 22:48:21 -08:00
Eric Anholt 63bf48481d Correct typo in mac mini hack, and return modes when the hack is unnecessary. 2006-12-12 22:42:41 -08:00
Eric Anholt 41444183b5 Replace custom, partially broken DPMS implementation with a generic one. 2006-12-12 18:08:57 -08:00
Eric Anholt 7ed1b05922 Fix mac mini SDVO output: write the SDVO[BC] enabled register state twice. 2006-12-12 16:03:52 -08:00
Eric Anholt 9776f6c68b Flush the plane changes in i830_crtc_dpms()
Otherwise, the changes may not have taken effect.
2006-12-12 16:02:47 -08:00
Eric Anholt 54823ac39c Move the SDVO sync detection to after we've turned the port on. 2006-12-12 14:55:10 -08:00
Eric Anholt ec45d72743 Extend the error state reporting to cover ESR and decode PGTBL_ERR for 945. 2006-12-12 14:55:10 -08:00
Eric Anholt 838af10b85 Move PrintErrorState and CheckInheritedErrors code to i830_debug.c. 2006-12-12 14:55:10 -08:00
Eric Anholt 668ae6ce3c Set the SDVO port to on before sending the SDVO output on command. 2006-12-12 14:55:10 -08:00
Eric Anholt 91a538bead More debugging output for SDVO. 2006-12-12 14:55:10 -08:00
Eric Anholt ce54538b90 Add a hack for DDC on my Mac Mini. 2006-12-12 14:55:10 -08:00
Eric Anholt c8c1fb64cc Move the overlay mode switch status updates to when we enable/disable crtcs.
This should help if we mode switch with randr during video playback, and also
simplifies the code by moving the protection all to one place.
2006-12-11 16:02:29 -08:00
Eric Anholt 3f3791ba2e Remove remnants of old savedCurrentMode hack. Man, that was gross. 2006-12-11 15:20:15 -08:00
Eric Anholt c21baa5a30 Remove dead remnants of old clone mode support. 2006-12-11 15:15:01 -08:00
Joshua J. Berry b3865f3466 Include i830.h to get M_T_* compat defines for older X Servers.
Not duplicating the defines ensures that we won't let the compat bits slip
into the X Server when we move this code over there.
2006-12-11 14:46:56 -08:00
Eric Anholt 24d9521c7a Add error messages for previous silent DRI initialization failures. 2006-12-11 14:46:55 -08:00
Keith Packard fde52de870 Merge branch 'modesetting-origin' into modesetting 2006-12-06 23:40:13 -08:00
Keith Packard 7dbe6c378d Move vga restore to end of RestoreHWState.
I was having consistent system lockups when the vga restore
was first. Moving it to the end has reduced them to an infrequent
occurrence (but, alas, it has happened once since). This does not
make me happy.
2006-12-06 23:39:14 -08:00
Keith Packard 28c7002b1c Use DOUBLE_WIDE mode on all hardware.
DOUBLE_WIDE mode is needed when the pixel clock is > 90% of the core
clock rate. The code guesses what the core clock rate is based on
the bus (AGP -> 133MHz, PCI-E -> 200MHz).
2006-12-06 23:35:15 -08:00
Eric Anholt 85de8a0580 Include render.h to get SubPixelUnknown define. 2006-12-06 20:26:53 -08:00
Keith Packard 182d2f503a Merge branch 'modesetting-origin' into modesetting 2006-12-06 17:18:58 -08:00
Eric Anholt 6777d8044d Harmless warning fix. 2006-12-06 17:10:06 -08:00
Eric Anholt c6ce8a3c33 Reduce dumpregs to X startup, after a mode set, and LeaveVT.
While here, remove some other register dumping that is better done by
i830DumpRegs().
2006-12-06 17:08:30 -08:00
Eric Anholt b23dec37b2 Save/restore registers around calls in PreInit with register side-effects. 2006-12-06 17:08:30 -08:00
Eric Anholt d3c21c09e3 Remove stale i830_tv_pre_set_mode. Replaced by generic dpms hook call.
Also replaced by not spamming unrelated ADPA register.  At least, it had sure
better not be related.
2006-12-06 17:08:30 -08:00
Eric Anholt 9c3e733aaa Save/restore more TV registers. 2006-12-06 17:08:30 -08:00
Keith Packard d5ec9d2160 Cannot modify DPLL register in output mode_set function.
DPLL register contains clock setup, so it cannot be written
from the output mode_set function or 'bad things' happen.
2006-12-06 14:44:40 -08:00
Keith Packard 5d345c13a9 Clean up SDVO multiplier debug output 2006-12-06 13:19:58 -08:00
Keith Packard 6ee63364f5 Merge branch 'modesetting' into nonrandr-setup
Also, fix buffer overflow in i830_debug.c
2006-12-06 12:53:22 -08:00
Eric Anholt b75ecdb483 Merge branch 'generic-mode-set' into modesetting 2006-12-06 11:59:33 -08:00
Eric Anholt b3bb10e33e Fix LVDS: Don't change bits in LVDS other than port enable/pipe select.
This behavior matches what we did before when LVDS worked.
2006-12-06 11:53:40 -08:00
Eric Anholt 47d07b1073 More LVDS fixed mode fixing: use the EDID DTD's blank length. 2006-12-06 10:56:38 -08:00
Eric Anholt 727bf1cbf7 Add missing newlines to new debug output. 2006-12-06 10:12:49 -08:00