Add untested CRT detection code.

This commit is contained in:
Eric Anholt 2006-02-28 15:56:06 -08:00 committed by Eric Anholt
parent a085813714
commit 6877f532c5
3 changed files with 30 additions and 0 deletions

View File

@ -693,6 +693,19 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# define FP_M1_DIV_MASK 0x00003f00
# define FP_M2_DIV_MASK 0x0000003f
#define PORT_HOTPLUG_EN 0x61110
# define SDVOB_HOTPLUG_INT_EN (1 << 26)
# define SDVOC_HOTPLUG_INT_EN (1 << 25)
# define TV_HOTPLUG_INT_EN (1 << 18)
# define CRT_HOTPLUG_INT_EN (1 << 9)
# define CRT_HOTPLUG_FORCE_DETECT (1 << 3)
#define PORT_HOTPLUG_STAT 0x61114
# define CRT_HOTPLUG_INT_STATUS (1 << 11)
# define TV_HOTPLUG_INT_STATUS (1 << 10)
# define SDVOC_HOTPLUG_INT_STATUS (1 << 7)
# define SDVOB_HOTPLUG_INT_STATUS (1 << 6)
#define I830_HTOTAL_MASK 0xfff0000
#define I830_HACTIVE_MASK 0x7ff

View File

@ -312,3 +312,19 @@ i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode)
OUTREG(DSPBCNTR, temp | DISPLAY_PLANE_ENABLE);
}*/
}
Bool
i830DetectCRT(ScrnInfoPtr pScrn)
{
I830Ptr pI830 = I830PTR(pScrn);
CARD32 temp;
temp = INREG(PORT_HOTPLUG_EN);
OUTREG(PORT_HOTPLUG_EN, temp | CRT_HOTPLUG_FORCE_DETECT);
/* Wait for the bit to clear to signal detection finished. */
while (INREG(PORT_HOTPLUG_EN) & CRT_HOTPLUG_FORCE_DETECT)
;
return ((INREG(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_INT_STATUS));
}

View File

@ -1 +1,2 @@
void i830SetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode);
Bool i830DetectCRT(ScreenPtr pScrn);