summaryrefslogtreecommitdiff
path: root/src/radeon_display.c
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 /src/radeon_display.c
parent4962a5430844114de864418d803f3182b90792ff (diff)
fix up output namings
Diffstat (limited to 'src/radeon_display.c')
-rw-r--r--src/radeon_display.c88
1 files changed, 74 insertions, 14 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;
}