summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2006-09-18 06:16:58 +1000
committerDave Airlie <airlied@linux.ie>2006-09-18 06:19:57 +1000
commit6da5a0bfdedb2062ec835f45514c22917abdcf4c (patch)
treebb896a30b99fc13df8e8755f3e21644761605f4d /src
parentcd1bc1d1febf0a79d835c7dc8b353123278dec51 (diff)
radeon: move to using Alex's controller structure
Diffstat (limited to 'src')
-rw-r--r--src/radeon_display.c58
-rw-r--r--src/radeon_driver.c23
-rw-r--r--src/radeon_probe.h13
3 files changed, 52 insertions, 42 deletions
diff --git a/src/radeon_display.c b/src/radeon_display.c
index fa9d2f5..21c23f5 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -877,7 +877,7 @@ BOOL RADEONQueryConnectedMonitors(ScrnInfoPtr pScrn)
max_mt = 5;
if(info->IsSecondary) {
- info->DisplayType = (RADEONMonitorType)pRADEONEnt->MonType2;
+ info->DisplayType = (RADEONMonitorType)pRADEONEnt->Controller[1].pPort->MonType;
if(info->DisplayType == MT_NONE) return FALSE;
return TRUE;
}
@@ -896,6 +896,10 @@ BOOL RADEONQueryConnectedMonitors(ScrnInfoPtr pScrn)
pRADEONEnt->PortInfo[i].TMDSType = TMDS_UNKNOWN;
pRADEONEnt->PortInfo[i].ConnectorType = CONNECTOR_NONE;
}
+ pRADEONEnt->Controller[0].IsUsed = FALSE;
+ pRADEONEnt->Controller[1].IsUsed = FALSE;
+ pRADEONEnt->Controller[0].IsActive = FALSE;
+ pRADEONEnt->Controller[1].IsActive = FALSE;
if (!RADEONGetConnectorInfoFromBIOS(pScrn)) {
/* Below is the most common setting, but may not be true */
@@ -1084,12 +1088,18 @@ BOOL RADEONQueryConnectedMonitors(ScrnInfoPtr pScrn)
}
}
- pRADEONEnt->MonType1 = pRADEONEnt->PortInfo[0].MonType;
- pRADEONEnt->MonInfo1 = pRADEONEnt->PortInfo[0].MonInfo;
- pRADEONEnt->MonType2 = MT_NONE;
- pRADEONEnt->MonInfo2 = NULL;
+ pRADEONEnt->PortInfo[1].MonType = MT_NONE;
+ pRADEONEnt->PortInfo[1].MonInfo = NULL;
+ pRADEONEnt->PortInfo[1].DDCType = DDC_NONE_DETECTED;
+ pRADEONEnt->PortInfo[1].DACType = DAC_UNKNOWN;
+ pRADEONEnt->PortInfo[1].TMDSType = TMDS_UNKNOWN;
+ pRADEONEnt->PortInfo[1].ConnectorType = CONNECTOR_NONE;
+
+ pRADEONEnt->Controller[0].pPort = &pRADEONEnt->PortInfo[0];
+ pRADEONEnt->Controller[1].pPort = &pRADEONEnt->PortInfo[1];
+
info->MergeType = MT_NONE;
- info->DisplayType = pRADEONEnt->MonType1;
+ info->DisplayType = pRADEONEnt->Controller[0].pPort->MonType;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"Primary:\n Monitor -- %s\n Connector -- %s\n DAC Type -- %s\n TMDS Type -- %s\n DDC Type -- %s\n",
@@ -1109,7 +1119,9 @@ BOOL RADEONQueryConnectedMonitors(ScrnInfoPtr pScrn)
/* Primary Head (DVI or Laptop Int. panel)*/
/* A ddc capable display connected on DVI port */
if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN) {
- if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, pRADEONEnt->PortInfo[0].DDCType, &pRADEONEnt->PortInfo[0])));
+ if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn,
+ pRADEONEnt->PortInfo[0].DDCType,
+ &pRADEONEnt->PortInfo[0])));
else if (info->IsMobility &&
(INREG(RADEON_BIOS_4_SCRATCH) & 4)) {
/* non-DDC laptop panel connected on primary */
@@ -1150,33 +1162,31 @@ BOOL RADEONQueryConnectedMonitors(ScrnInfoPtr pScrn)
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "\n");
- pRADEONEnt->MonType1 = pRADEONEnt->PortInfo[0].MonType;
- pRADEONEnt->MonInfo1 = pRADEONEnt->PortInfo[0].MonInfo;
- pRADEONEnt->MonType2 = pRADEONEnt->PortInfo[1].MonType;
- pRADEONEnt->MonInfo2 = pRADEONEnt->PortInfo[1].MonInfo;
+ pRADEONEnt->Controller[0].pPort = &pRADEONEnt->PortInfo[0];
+ pRADEONEnt->Controller[1].pPort = &pRADEONEnt->PortInfo[1];
if (pRADEONEnt->PortInfo[0].MonType == MT_NONE) {
if (pRADEONEnt->PortInfo[1].MonType == MT_NONE) {
- pRADEONEnt->MonType1 = MT_CRT;
- pRADEONEnt->MonInfo1 = NULL;
+ pRADEONEnt->Controller[0].pPort->MonType = MT_CRT;
} else {
- RADEONConnector tmp;
- pRADEONEnt->MonType1 = pRADEONEnt->PortInfo[1].MonType;
- pRADEONEnt->MonInfo1 = pRADEONEnt->PortInfo[1].MonInfo;
- tmp = pRADEONEnt->PortInfo[0];
- pRADEONEnt->PortInfo[0] = pRADEONEnt->PortInfo[1];
- pRADEONEnt->PortInfo[1] = tmp;
+ pRADEONEnt->Controller[0].pPort = &(pRADEONEnt->PortInfo[1]);
+ pRADEONEnt->Controller[1].pPort = &(pRADEONEnt->PortInfo[0]);
}
- pRADEONEnt->MonType2 = MT_NONE;
- pRADEONEnt->MonInfo2 = NULL;
}
- info->DisplayType = pRADEONEnt->MonType1;
+ if (info->IsSecondary) {
+ pScrn->monitor->DDC = pRADEONEnt->Controller[1].pPort->MonInfo;
+ info->DisplayType = pRADEONEnt->Controller[1].pPort->MonType;
+ } else {
+ pScrn->monitor->DDC = pRADEONEnt->Controller[0].pPort->MonInfo;
+ info->DisplayType = pRADEONEnt->Controller[0].pPort->MonType;
+ }
+
pRADEONEnt->ReversedDAC = FALSE;
info->OverlayOnCRTC2 = FALSE;
info->MergeType = MT_NONE;
- if (pRADEONEnt->MonType2 != MT_NONE) {
+ if (pRADEONEnt->Controller[1].pPort->MonType != MT_NONE) {
if(!pRADEONEnt->HasSecondary) {
- info->MergeType = pRADEONEnt->MonType2;
+ info->MergeType = pRADEONEnt->Controller[1].pPort->MonType;
}
if (pRADEONEnt->PortInfo[1].DACType == DAC_TVDAC) {
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 6f8e6f1..532a857 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -2751,7 +2751,7 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
xf86ReturnOptValBool(info->Options, OPTION_DDC_MODE, FALSE);
/* don't use RMX if we have a dual-tmds panels */
- if (pRADEONEnt->MonType2 == MT_DFP)
+ if (pRADEONEnt->Controller[1].pPort->MonType == MT_DFP)
info->ddc_mode = TRUE;
/* don't use RMX if we are Dell Server */
if (info->IsDellServer)
@@ -2762,11 +2762,6 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
"Validating modes on %s head ---------\n",
info->IsSecondary ? "Secondary" : "Primary");
- if (info->IsSecondary)
- pScrn->monitor->DDC = pRADEONEnt->MonInfo2;
- else
- pScrn->monitor->DDC = pRADEONEnt->MonInfo1;
-
if (!pScrn->monitor->DDC && info->ddc_mode) {
info->ddc_mode = FALSE;
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -6510,7 +6505,7 @@ static Bool RADEONInitCrtc2Registers(ScrnInfoPtr pScrn, RADEONSavePtr save,
IS_R300_VARIANT) {
save->disp_output_cntl &= ~(RADEON_DISP_DAC_SOURCE_MASK |
RADEON_DISP_DAC2_SOURCE_MASK);
- if (pRADEONEnt->MonType1 != MT_CRT) {
+ if (pRADEONEnt->Controller[0].pPort->MonType != MT_CRT) {
save->disp_output_cntl |= (RADEON_DISP_DAC_SOURCE_CRTC2 |
RADEON_DISP_DAC2_SOURCE_CRTC2);
} else {
@@ -6523,7 +6518,7 @@ static Bool RADEONInitCrtc2Registers(ScrnInfoPtr pScrn, RADEONSavePtr save,
} else {
save->disp_hw_debug = info->SavedReg.disp_hw_debug;
/* Turn on 2nd CRT */
- if (pRADEONEnt->MonType1 != MT_CRT) {
+ if (pRADEONEnt->Controller[0].pPort->MonType != MT_CRT) {
/* This is for some sample boards with the VGA port
connected to the TVDAC, but BIOS doesn't reflect this.
Here we configure both DACs to use CRTC2.
@@ -6872,16 +6867,16 @@ static void RADEONInitFPRegisters(ScrnInfoPtr pScrn, RADEONSavePtr orig,
* with below settings
*/
if (info->DisplayType == MT_LCD) {
- if (pRADEONEnt->MonType2 == MT_CRT)
+ if (pRADEONEnt->Controller[1].pPort->MonType == MT_CRT)
save->bios_5_scratch = 0x0201;
- else if (pRADEONEnt->MonType2 == MT_DFP)
+ else if (pRADEONEnt->Controller[1].pPort->MonType == MT_DFP)
save->bios_5_scratch = 0x0801;
else
save->bios_5_scratch = orig->bios_5_scratch;
} else {
- if (pRADEONEnt->MonType2 == MT_CRT)
+ if (pRADEONEnt->Controller[1].pPort->MonType == MT_CRT)
save->bios_5_scratch = 0x0200;
- else if (pRADEONEnt->MonType2 == MT_DFP)
+ else if (pRADEONEnt->Controller[1].pPort->MonType == MT_DFP)
save->bios_5_scratch = 0x0800;
else
save->bios_5_scratch = 0x0;
@@ -7763,7 +7758,7 @@ RADEONGetMergedFBOptions(ScrnInfoPtr pScrn)
info->MergedFB = FALSE;
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Failed to detect secondary monitor, MergedFB/Clone mode disabled\n");
- } else if (!pRADEONEnt->MonInfo2) {
+ } else if (!pRADEONEnt->Controller[1].pPort->MonInfo) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Failed to detect secondary monitor DDC, default HSync and VRefresh used\n");
default_range = TRUE;
@@ -7929,7 +7924,7 @@ RADEONGetMergedFBOptions(ScrnInfoPtr pScrn)
}
/* xf86SetDDCproperties(info->CRT2pScrn, pRADEONEnt->MonInfo2); */
- info->CRT2pScrn->monitor->DDC = pRADEONEnt->MonInfo2;
+ info->CRT2pScrn->monitor->DDC = pRADEONEnt->Controller[1].pPort->MonInfo;
if (default_range) {
RADEONStrToRanges(info->CRT2pScrn->monitor->hsync, default_hsync, MAX_HSYNC);
RADEONStrToRanges(info->CRT2pScrn->monitor->vrefresh, default_vrefresh, MAX_VREFRESH);
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index a4f20e7..ce4c538 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -115,6 +115,14 @@ typedef struct
typedef struct
{
+ Bool IsUsed;
+ Bool IsActive;
+ DisplayModePtr pCurMode;
+ RADEONConnector* pPort;
+} RADEONController;
+
+typedef struct
+{
Bool HasSecondary;
/*
@@ -127,13 +135,10 @@ typedef struct
ScrnInfoPtr pSecondaryScrn;
ScrnInfoPtr pPrimaryScrn;
- int MonType1;
- int MonType2;
- xf86MonPtr MonInfo1;
- xf86MonPtr MonInfo2;
Bool ReversedDAC; /* TVDAC used as primary dac */
Bool ReversedTMDS; /* DDC_DVI is used for external TMDS */
RADEONConnector PortInfo[2];
+ RADEONController Controller[2];
} RADEONEntRec, *RADEONEntPtr;
/* radeon_probe.c */