summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-03-06 15:38:00 -0500
committerAdam Jackson <ajax@redhat.com>2009-03-06 15:38:00 -0500
commit0ba73e040b94590867f8b1071a26da2526a3c375 (patch)
tree3110305f045b26915623a0358a47adad5d51a291
parent8f7c17a6b77ca368f067c2acb803cc8f9ef19351 (diff)
output: Allow for multiple DisplayPort outputs.
-rw-r--r--src/radeon_output.c71
1 files changed, 36 insertions, 35 deletions
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 6bbe9abc..0be7625d 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2505,6 +2505,14 @@ radeon_output_clones (ScrnInfoPtr pScrn, xf86OutputPtr output)
return index_mask;
}
+static xf86OutputPtr
+RADEONOutputCreate(ScrnInfoPtr pScrn, const char *name, int i)
+{
+ char buf[32];
+ sprintf(buf, name, i);
+ return xf86OutputCreate(pScrn, &radeon_output_funcs, buf);
+}
+
/*
* initialise the static data sos we don't have to re-do at randr change */
Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
@@ -2517,6 +2525,7 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
int num_vga = 0;
int num_dvi = 0;
int num_hdmi = 0;
+ int num_dp = 0;
/* We first get the information about all connectors from BIOS.
* This is how the card is phyiscally wired up.
@@ -2653,15 +2662,18 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
if (info->BiosConnector[i].valid) {
- if ((info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_D) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_I) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_A)) {
+ RADEONConnectorType conntype = info->BiosConnector[i].ConnectorType;
+ if ((conntype == CONNECTOR_DVI_D) ||
+ (conntype == CONNECTOR_DVI_I) ||
+ (conntype == CONNECTOR_DVI_A)) {
num_dvi++;
- } else if (info->BiosConnector[i].ConnectorType == CONNECTOR_VGA) {
+ } else if (conntype == CONNECTOR_VGA) {
num_vga++;
- } else if ((info->BiosConnector[i].ConnectorType == CONNECTOR_HDMI_TYPE_A) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_HDMI_TYPE_B)) {
+ } else if ((conntype == CONNECTOR_HDMI_TYPE_A) ||
+ (conntype == CONNECTOR_HDMI_TYPE_B)) {
num_hdmi++;
+ } else if (conntype == CONNECTOR_DISPLAY_PORT) {
+ num_dp++;
}
}
}
@@ -2669,8 +2681,9 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
for (i = 0 ; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
if (info->BiosConnector[i].valid) {
RADEONOutputPrivatePtr radeon_output;
+ RADEONConnectorType conntype = info->BiosConnector[i].ConnectorType;
- if (info->BiosConnector[i].ConnectorType == CONNECTOR_NONE)
+ if (conntype == CONNECTOR_NONE)
continue;
radeon_output = xnfcalloc(sizeof(RADEONOutputPrivateRec), 1);
@@ -2678,7 +2691,7 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
return FALSE;
}
radeon_output->MonType = MT_UNKNOWN;
- radeon_output->ConnectorType = info->BiosConnector[i].ConnectorType;
+ radeon_output->ConnectorType = conntype;
radeon_output->devices = info->BiosConnector[i].devices;
radeon_output->ddc_i2c = info->BiosConnector[i].ddc_i2c;
radeon_output->igp_lane_info = info->BiosConnector[i].igp_lane_info;
@@ -2687,33 +2700,21 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
radeon_output->linkb = info->BiosConnector[i].linkb;
radeon_output->connector_id = info->BiosConnector[i].connector_object;
- if ((info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_D) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_I) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_A)) {
- if (num_dvi > 1) {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "DVI-1");
- num_dvi--;
- } else {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "DVI-0");
- }
- } else if (info->BiosConnector[i].ConnectorType == CONNECTOR_VGA) {
- if (num_vga > 1) {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA-1");
- num_vga--;
- } else {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA-0");
- }
- } else if ((info->BiosConnector[i].ConnectorType == CONNECTOR_HDMI_TYPE_A) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_HDMI_TYPE_B)) {
- if (num_hdmi > 1) {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "HDMI-1");
- num_hdmi--;
- } else {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "HDMI-0");
- }
- } else
- output = xf86OutputCreate(pScrn, &radeon_output_funcs,
- ConnectorTypeName[radeon_output->ConnectorType]);
+ if ((conntype == CONNECTOR_DVI_D) ||
+ (conntype == CONNECTOR_DVI_I) ||
+ (conntype == CONNECTOR_DVI_A)) {
+ output = RADEONOutputCreate(pScrn, "DVI-%d", --num_dvi);
+ } else if (conntype == CONNECTOR_VGA) {
+ output = RADEONOutputCreate(pScrn, "VGA-%d", --num_vga);
+ } else if ((conntype == CONNECTOR_HDMI_TYPE_A) ||
+ (conntype == CONNECTOR_HDMI_TYPE_B)) {
+ output = RADEONOutputCreate(pScrn, "HDMI-%d", --num_hdmi);
+ } else if (conntype == CONNECTOR_DISPLAY_PORT) {
+ output = RADEONOutputCreate(pScrn, "DisplayPort-%d", --num_dp);
+ } else {
+ output = RADEONOutputCreate(pScrn,
+ ConnectorTypeName[conntype], 0);
+ }
if (!output) {
return FALSE;