summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-12-17 17:31:08 +1100
committerDave Airlie <airlied@linux.ie>2006-12-17 17:31:08 +1100
commitbf0b364cbd8682f297e2d110ece1f72e7151340d (patch)
tree40c927c5f26fe5296cdc3e4b17f03a5d412b36ab
parent4962a5430844114de864418d803f3182b90792ff (diff)
fix up output namings
-rw-r--r--src/radeon_display.c88
-rw-r--r--src/radeon_driver.c9
-rw-r--r--src/radeon_probe.h2
3 files changed, 82 insertions, 17 deletions
diff --git a/src/radeon_display.c b/src/radeon_display.c
index 7f17e457..dcf65f2c 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -113,6 +113,15 @@ const char *ConnectorTypeNameATOM[10] = {
"Unsupported"
};
+const char *OutputType[10] = {
+ "None",
+ "VGA",
+ "DVI",
+ "LVDS",
+ "S-video",
+ "Composite",
+};
+
static const RADEONTMDSPll default_tmds_pll[CHIP_FAMILY_LAST][4] =
{
@@ -2529,33 +2538,84 @@ Bool RADEONAllocateControllers(ScrnInfoPtr pScrn)
return TRUE;
}
-Bool RADEONAllocateConnectors(ScrnInfoPtr pScrn)
+Bool RADEONAllocatePortInfo(ScrnInfoPtr pScrn)
{
RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
int num_connectors;
int i;
if (pRADEONEnt->PortInfo[0])
- return TRUE;
-
+ return TRUE;
+
/* for now always allocate max connectors */
for (i = 0 ; i < RADEON_MAX_CONNECTOR; i++) {
- pRADEONEnt->pOutput[i] = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA");
- if (!pRADEONEnt->pOutput[i])
- return FALSE;
+ pRADEONEnt->PortInfo[i] = xnfcalloc(sizeof(RADEONOutputPrivateRec), 1);
+ if (!pRADEONEnt->PortInfo[i])
+ return FALSE;
+ }
+}
- pRADEONEnt->PortInfo[i] = xnfcalloc(sizeof(RADEONOutputPrivateRec), 1);
- if (!pRADEONEnt->PortInfo[i])
- return FALSE;
+void RADEONSetOutputType(ScrnInfoPtr pScrn, RADEONOutputPrivatePtr pRPort)
+{
+ RADEONInfoPtr info = RADEONPTR (pScrn);
+ RADEONOutputType output;
+ if (info->IsAtomBios) {
+ switch(pRPort->ConnectorType) {
+ case 0: output = OUTPUT_NONE; break;
+ case 1: output = OUTPUT_VGA; break;
+ case 2:
+ case 3:
+ case 4: output = OUTPUT_DVI; break;
+ case 5: output = OUTPUT_STV; break;
+ case 6: output = OUTPUT_CTV; break;
+ case 7:
+ case 8: output = OUTPUT_LVDS; break;
+ case 9:
+ default:
+ output = OUTPUT_NONE; break;
+ }
+ }
+ else {
+ switch(pRPort->ConnectorType) {
+ case 0: output = OUTPUT_NONE; break;
+ case 1: output = OUTPUT_LVDS; break;
+ case 2: output = OUTPUT_VGA; break;
+ case 3:
+ case 4: output = OUTPUT_DVI; break;
+ case 5: output = OUTPUT_STV; break;
+ case 6: output = OUTPUT_CTV; break;
+ default: output = OUTPUT_NONE; break;
+ }
+ }
+ pRPort->type = output;
+}
- pRADEONEnt->PortInfo[i]->type = OUTPUT_VGA;
- pRADEONEnt->pOutput[i]->driver_private = pRADEONEnt->PortInfo[i];
- pRADEONEnt->PortInfo[i]->num = i;
+Bool RADEONAllocateConnectors(ScrnInfoPtr pScrn)
+{
+ RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+ int num_connectors;
+ int i;
- pRADEONEnt->pOutput[i]->possible_crtcs = (1<<0) | (1<<1);
- }
+ if (pRADEONEnt->pOutput[0])
+ return TRUE;
+
+ /* for now always allocate max connectors */
+ for (i = 0 ; i < RADEON_MAX_CONNECTOR; i++) {
+
+ RADEONSetOutputType(pScrn, pRADEONEnt->PortInfo[i]);
+ pRADEONEnt->pOutput[i] = xf86OutputCreate(pScrn, &radeon_output_funcs, OutputType[pRADEONEnt->PortInfo[i]->type]);
+ if (!pRADEONEnt->pOutput[i])
+ return FALSE;
+
+
+ pRADEONEnt->pOutput[i]->driver_private = pRADEONEnt->PortInfo[i];
+ pRADEONEnt->PortInfo[i]->num = i;
+
+ pRADEONEnt->pOutput[i]->possible_crtcs = (1<<0) | (1<<1);
+ }
+
return TRUE;
}
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 0aa594dc..f06edcc9 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -2840,16 +2840,21 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
int i;
if (!info->IsSecondary) {
- if (!RADEONAllocateConnectors(pScrn))
+
+ if (!RADEONAllocatePortInfo(pScrn))
return FALSE;
if (!RADEONAllocateControllers(pScrn))
return FALSE;
-
}
RADEONGetBIOSInfo(pScrn, pInt10);
+ if (!info->IsSecondary) {
+ if (!RADEONAllocateConnectors(pScrn))
+ return FALSE;
+ }
+
RADEONSetupConnectors(pScrn);
RADEONMapControllers(pScrn);
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index 959d4dd1..977790ca 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -112,7 +112,7 @@ typedef enum
OUTPUT_DVI,
OUTPUT_LVDS,
OUTPUT_STV,
- OUTPUT_CTX,
+ OUTPUT_CTV,
} RADEONOutputType;
typedef struct _RADEONCrtcPrivateRec {