hrev44057 adds 2 changesets to branch 'master' old head: e47f861975f7999a0f28807e8664e4c8fcb0e631 new head: f4647825e79d9d619cff3eb26882fce1b5afea59 ---------------------------------------------------------------------------- c363019: radeon_hd: Make crtc lookup fault less catastrophic f464782: radeon_hd: display_info struct style cleanup * No functional change [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- 3 files changed, 31 insertions(+), 30 deletions(-) src/add-ons/accelerants/radeon_hd/accelerant.h | 12 +++--- src/add-ons/accelerants/radeon_hd/display.cpp | 37 ++++++++++--------- src/add-ons/accelerants/radeon_hd/mode.cpp | 12 +++--- ############################################################################ Commit: c363019152f3f0c6dbbf2f6dcd600b676646c067 URL: http://cgit.haiku-os.org/haiku/commit/?id=c363019 Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Wed Apr 18 21:50:39 2012 UTC radeon_hd: Make crtc lookup fault less catastrophic ---------------------------------------------------------------------------- diff --git a/src/add-ons/accelerants/radeon_hd/display.cpp b/src/add-ons/accelerants/radeon_hd/display.cpp index 2fa4712..d1f0ef4 100644 --- a/src/add-ons/accelerants/radeon_hd/display.cpp +++ b/src/add-ons/accelerants/radeon_hd/display.cpp @@ -388,7 +388,7 @@ display_get_encoder_mode(uint32 connectorIndex) return ATOM_ENCODER_MODE_DVO; } - // Find crtc for connector + // Find crtc for connector so we can identify source of edid data int32 crtc = -1; for (int32 id = 0; id < MAX_DISPLAY; id++) { if (gDisplay[id]->connectorIndex == connectorIndex) { @@ -396,20 +396,21 @@ display_get_encoder_mode(uint32 connectorIndex) break; } } + bool edidDigital = false; if (crtc == -1) { - ERROR("%s: BUG: ran on connector without crtc!\n", __func__); - return ATOM_ENCODER_MODE_CRT; + ERROR("%s: BUG: executed on connector without crtc!\n", __func__); + } else { + edid1_info* edid = &gDisplay[crtc]->edid_info; + edidDigital = edid->display.input_type ? true : false; } - edid1_info* edid = &gDisplay[crtc]->edid_info; - // Normal encoder situations switch (gConnector[connectorIndex]->type) { case VIDEO_CONNECTOR_DVII: case VIDEO_CONNECTOR_HDMIB: /* HDMI-B is DL-DVI; analog works fine */ // TODO: if audio detected on edid and DCE4, ATOM_ENCODER_MODE_DVI // if audio detected on edid not DCE4, ATOM_ENCODER_MODE_HDMI - if (edid->display.input_type) // is digital? + if (edidDigital) return ATOM_ENCODER_MODE_DVI; else return ATOM_ENCODER_MODE_CRT; ############################################################################ Revision: hrev44057 Commit: f4647825e79d9d619cff3eb26882fce1b5afea59 URL: http://cgit.haiku-os.org/haiku/commit/?id=f464782 Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Wed Apr 18 21:55:57 2012 UTC radeon_hd: display_info struct style cleanup * No functional change ---------------------------------------------------------------------------- diff --git a/src/add-ons/accelerants/radeon_hd/accelerant.h b/src/add-ons/accelerants/radeon_hd/accelerant.h index 5d47ff8..05aa0b2 100644 --- a/src/add-ons/accelerants/radeon_hd/accelerant.h +++ b/src/add-ons/accelerants/radeon_hd/accelerant.h @@ -159,12 +159,12 @@ typedef struct { bool powered; uint32 connectorIndex; // matches connector id in connector_info register_info* regs; - bool found_ranges; - uint32 vfreq_max; - uint32 vfreq_min; - uint32 hfreq_max; - uint32 hfreq_min; - edid1_info edid_info; + bool foundRanges; + uint32 vfreqMax; + uint32 vfreqMin; + uint32 hfreqMax; + uint32 hfreqMin; + edid1_info edidData; display_mode preferredMode; } display_info; diff --git a/src/add-ons/accelerants/radeon_hd/display.cpp b/src/add-ons/accelerants/radeon_hd/display.cpp index d1f0ef4..e834342 100644 --- a/src/add-ons/accelerants/radeon_hd/display.cpp +++ b/src/add-ons/accelerants/radeon_hd/display.cpp @@ -217,7 +217,7 @@ init_registers(register_info* regs, uint8 crtcID) status_t detect_crt_ranges(uint32 crtid) { - edid1_info* edid = &gDisplay[crtid]->edid_info; + edid1_info* edid = &gDisplay[crtid]->edidData; // Scan each display EDID description for monitor ranges for (uint32 index = 0; index < EDID1_NUM_DETAILED_MONITOR_DESC; index++) { @@ -228,10 +228,10 @@ detect_crt_ranges(uint32 crtid) if (monitor->monitor_desc_type == EDID1_MONITOR_RANGES) { edid1_monitor_range range = monitor->data.monitor_range; - gDisplay[crtid]->vfreq_min = range.min_v; /* in Hz */ - gDisplay[crtid]->vfreq_max = range.max_v; - gDisplay[crtid]->hfreq_min = range.min_h; /* in kHz */ - gDisplay[crtid]->hfreq_max = range.max_h; + gDisplay[crtid]->vfreqMin = range.min_v; /* in Hz */ + gDisplay[crtid]->vfreqMax = range.max_v; + gDisplay[crtid]->hfreqMin = range.min_h; /* in kHz */ + gDisplay[crtid]->hfreqMax = range.max_h; return B_OK; } } @@ -247,7 +247,7 @@ detect_displays() for (uint32 id = 0; id < MAX_DISPLAY; id++) { gDisplay[id]->attached = false; gDisplay[id]->powered = false; - gDisplay[id]->found_ranges = false; + gDisplay[id]->foundRanges = false; } uint32 displayIndex = 0; @@ -280,7 +280,7 @@ detect_displays() __func__, id); // Lets try bit-banging edid from connector gDisplay[displayIndex]->attached = - connector_read_edid(id, &gDisplay[displayIndex]->edid_info); + connector_read_edid(id, &gDisplay[displayIndex]->edidData); if (gConnector[id]->encoder.type == VIDEO_ENCODER_TVDAC || gConnector[id]->encoder.type == VIDEO_ENCODER_DAC) { @@ -308,11 +308,11 @@ detect_displays() if (gDisplay[displayIndex]->preferredMode.virtual_width > 0) { // Found a single preferred mode - gDisplay[displayIndex]->found_ranges = false; + gDisplay[displayIndex]->foundRanges = false; } else { // Use edid data and pull ranges if (detect_crt_ranges(displayIndex) == B_OK) - gDisplay[displayIndex]->found_ranges = true; + gDisplay[displayIndex]->foundRanges = true; } displayIndex++; @@ -330,7 +330,7 @@ detect_displays() gDisplay[0]->connectorIndex = id; init_registers(gDisplay[0]->regs, 0); if (detect_crt_ranges(0) == B_OK) - gDisplay[0]->found_ranges = true; + gDisplay[0]->foundRanges = true; break; } } @@ -362,9 +362,9 @@ debug_displays() ERROR(" + connector type: %s\n", get_connector_name(connectorType)); ERROR(" + encoder type: %s\n", get_encoder_name(encoderType)); ERROR(" + limits: Vert Min/Max: %" B_PRIu32 "/%" B_PRIu32"\n", - gDisplay[id]->vfreq_min, gDisplay[id]->vfreq_max); + gDisplay[id]->vfreqMin, gDisplay[id]->vfreqMax); ERROR(" + limits: Horz Min/Max: %" B_PRIu32 "/%" B_PRIu32"\n", - gDisplay[id]->hfreq_min, gDisplay[id]->hfreq_max); + gDisplay[id]->hfreqMin, gDisplay[id]->hfreqMax); } } TRACE("==========================================\n"); @@ -400,7 +400,7 @@ display_get_encoder_mode(uint32 connectorIndex) if (crtc == -1) { ERROR("%s: BUG: executed on connector without crtc!\n", __func__); } else { - edid1_info* edid = &gDisplay[crtc]->edid_info; + edid1_info* edid = &gDisplay[crtc]->edidData; edidDigital = edid->display.input_type ? true : false; } diff --git a/src/add-ons/accelerants/radeon_hd/mode.cpp b/src/add-ons/accelerants/radeon_hd/mode.cpp index 2eaa2b6..8dad3e5 100644 --- a/src/add-ons/accelerants/radeon_hd/mode.cpp +++ b/src/add-ons/accelerants/radeon_hd/mode.cpp @@ -118,7 +118,7 @@ radeon_get_edid_info(void* info, size_t size, uint32* edid_version) memcpy(info, &gInfo->shared_info->edid_info, sizeof(struct edid1_info)); // VESA - //memcpy(info, &gDisplay[0]->edid_info, sizeof(struct edid1_info)); + //memcpy(info, &gDisplay[0]->edidData, sizeof(struct edid1_info)); // BitBanged display 0 *edid_version = EDID_VERSION_1; @@ -306,12 +306,12 @@ is_mode_supported(display_mode* mode) // if we have edid info, check frequency adginst crt reported valid ranges if (gInfo->shared_info->has_edid - && gDisplay[crtid]->found_ranges) { + && gDisplay[crtid]->foundRanges) { // validate horizontal frequency range uint32 hfreq = mode->timing.pixel_clock / mode->timing.h_total; - if (hfreq > gDisplay[crtid]->hfreq_max + 1 - || hfreq < gDisplay[crtid]->hfreq_min - 1) { + if (hfreq > gDisplay[crtid]->hfreqMax + 1 + || hfreq < gDisplay[crtid]->hfreqMin - 1) { //TRACE("!!! mode below falls outside of hfreq range!\n"); sane = false; } @@ -319,8 +319,8 @@ is_mode_supported(display_mode* mode) // validate vertical frequency range uint32 vfreq = mode->timing.pixel_clock / ((mode->timing.v_total * mode->timing.h_total) / 1000); - if (vfreq > gDisplay[crtid]->vfreq_max + 1 - || vfreq < gDisplay[crtid]->vfreq_min - 1) { + if (vfreq > gDisplay[crtid]->vfreqMax + 1 + || vfreq < gDisplay[crtid]->vfreqMin - 1) { //TRACE("!!! mode below falls outside of vfreq range!\n"); sane = false; }