RadeonHD: Bit-bang LVDS for edid

* Older cards have to use the LVDS_Info table,
  newer cards also have an ddc pin for EDID.
* Some buggy sbios don't inject the EDID into
  the vbios as they should
* This corrects hrev45812 as we need to still
  call connector_read_mode_lvds to obtain the
  spread spectrum data for the lvds.
* Call connector_read_mode_lvds, bit-bang the
  connector, choose the best outcome.
This commit is contained in:
Alexander von Gluck IV
2013-07-05 11:53:46 -05:00
parent 055a62645e
commit 53f26450a3
+25 -14
View File
@@ -291,14 +291,36 @@ detect_displays()
}
#endif
if (gConnector[id]->type == VIDEO_CONNECTOR_LVDS) {
display_mode preferredMode;
bool lvdsInfoFound = connector_read_mode_lvds(id,
&preferredMode);
TRACE("%s: connector(%" B_PRIu32 "): bit-banging LVDS for EDID.\n",
__func__, id);
gDisplay[displayIndex]->attached = connector_read_edid(id,
&gDisplay[displayIndex]->edidData);
if (!gDisplay[displayIndex]->attached && lvdsInfoFound) {
// If we didn't find ddc edid data, fallback to lvdsInfo
// We have to call connector_read_mode_lvds first to
// collect SS data for the lvds connector
TRACE("%s: connector(%" B_PRIu32 "): using AtomBIOS LVDS_Info "
"preferred mode\n", __func__, id);
gDisplay[displayIndex]->attached = true;
memcpy(&gDisplay[displayIndex]->preferredMode,
&preferredMode, sizeof(display_mode));
}
}
// If no display found yet, try more standard detection methods
if (gDisplay[displayIndex]->attached == false) {
TRACE("%s: connector(%" B_PRIu32 "): bit-banging ddc for EDID.\n",
__func__, id);
// Lets try bit-banging edid from connector
gDisplay[displayIndex]->attached
= connector_read_edid(id, &gDisplay[displayIndex]->edidData);
// Bit-bang edid from connector
gDisplay[displayIndex]->attached = connector_read_edid(id,
&gDisplay[displayIndex]->edidData);
// Found EDID data?
if (gDisplay[displayIndex]->attached) {
@@ -334,17 +356,6 @@ detect_displays()
}
}
// If we haven't found EDID yet and LVDS, check LVDS_Info table
if (gDisplay[displayIndex]->attached == false
&& gConnector[id]->type == VIDEO_CONNECTOR_LVDS) {
gDisplay[displayIndex]->attached = connector_read_mode_lvds(id,
&gDisplay[displayIndex]->preferredMode);
if (gDisplay[displayIndex]->attached) {
TRACE("%s: connector(%" B_PRIu32 "): using AtomBIOS LVDS_Info "
"preferred mode\n", __func__, id);
}
}
if (gDisplay[displayIndex]->attached != true) {
// Nothing interesting here, move along
continue;