From d17bf8d4fb5081fe32f158c8d5241966fdc5f072 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Sat, 23 Jul 2011 01:27:59 +0000 Subject: [PATCH] * Add fancy detected monitors debug function git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42465 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../accelerants/radeon_hd/accelerant.cpp | 2 ++ src/add-ons/accelerants/radeon_hd/dac.cpp | 8 +---- src/add-ons/accelerants/radeon_hd/display.cpp | 35 ++++++++++++++++--- src/add-ons/accelerants/radeon_hd/display.h | 1 + src/add-ons/accelerants/radeon_hd/tmds.cpp | 6 ---- 5 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/add-ons/accelerants/radeon_hd/accelerant.cpp b/src/add-ons/accelerants/radeon_hd/accelerant.cpp index 8a26075ec4..bc47945f13 100644 --- a/src/add-ons/accelerants/radeon_hd/accelerant.cpp +++ b/src/add-ons/accelerants/radeon_hd/accelerant.cpp @@ -210,6 +210,8 @@ radeon_init_accelerant(int device) if (status != B_OK) return status; + debug_displays(); + status = create_mode_list(); if (status != B_OK) { uninit_common(); diff --git a/src/add-ons/accelerants/radeon_hd/dac.cpp b/src/add-ons/accelerants/radeon_hd/dac.cpp index 72067d28f8..d45306b4c8 100644 --- a/src/add-ons/accelerants/radeon_hd/dac.cpp +++ b/src/add-ons/accelerants/radeon_hd/dac.cpp @@ -85,13 +85,7 @@ DACSense(uint8 dacIndex) detectControl, 0x000000FF); Write32Mask(OUT, dacOffset + DACA_ENABLE, enable, 0x000000FF); - if (out == 0x7) { - TRACE("%s: DAC%d : Display device attached\n", __func__, dacIndex); - return true; - } else { - TRACE("%s: DAC%d : No display device attached\n", __func__, dacIndex); - return false; - } + return (out == 0x7); } diff --git a/src/add-ons/accelerants/radeon_hd/display.cpp b/src/add-ons/accelerants/radeon_hd/display.cpp index 5b758542d5..fbe3296f7c 100644 --- a/src/add-ons/accelerants/radeon_hd/display.cpp +++ b/src/add-ons/accelerants/radeon_hd/display.cpp @@ -204,12 +204,8 @@ detect_crt_ranges(uint32 crtid) gDisplay[crtid]->vfreq_max = range.max_v; gDisplay[crtid]->hfreq_min = range.min_h; /* in kHz */ gDisplay[crtid]->hfreq_max = range.max_h; - TRACE("CRT %d : v_min %d : v_max %d : h_min %d : h_max %d\n", - crtid, gDisplay[crtid]->vfreq_min, gDisplay[crtid]->vfreq_max, - gDisplay[crtid]->hfreq_min, gDisplay[crtid]->hfreq_max); return B_OK; } - } return B_ERROR; @@ -259,3 +255,34 @@ detect_displays() } +void +debug_displays() +{ + TRACE("Currently detected monitors===============\n"); + for (uint32 id = 0; id < MAX_DISPLAY; id++) { + TRACE("Display #%" B_PRIu32 " active = %s\n", + id, gDisplay[id]->active ? "true" : "false"); + + if (gDisplay[id]->active) { + if (gDisplay[id]->connection_type == CONNECTION_DAC) + TRACE(" + connection: DAC\n"); + else if (gDisplay[id]->connection_type == CONNECTION_TMDS) + TRACE(" + connection: TMDS\n"); + else if (gDisplay[id]->connection_type == CONNECTION_LVDS) + TRACE(" + connection: LVDS\n"); + else + TRACE(" + connection: UNKNOWN\n"); + + TRACE(" + connection index: % " B_PRIu8 "\n", + gDisplay[id]->connection_id); + + TRACE(" + limits: Vert Min/Max: %" B_PRIu32 "/%" B_PRIu32"\n", + gDisplay[id]->vfreq_min, gDisplay[id]->vfreq_max); + TRACE(" + limits: Horz Min/Max: %" B_PRIu32 "/%" B_PRIu32"\n", + gDisplay[id]->hfreq_min, gDisplay[id]->hfreq_max); + } + } + TRACE("==========================================\n"); + +} + diff --git a/src/add-ons/accelerants/radeon_hd/display.h b/src/add-ons/accelerants/radeon_hd/display.h index 7a916732dd..14d6247ca8 100644 --- a/src/add-ons/accelerants/radeon_hd/display.h +++ b/src/add-ons/accelerants/radeon_hd/display.h @@ -12,6 +12,7 @@ status_t init_registers(register_info* reg, uint8 crtid); status_t detect_crt_ranges(uint32 crtid); status_t detect_displays(); +void debug_displays(); #endif /* RADEON_HD_DISPLAY_H */ diff --git a/src/add-ons/accelerants/radeon_hd/tmds.cpp b/src/add-ons/accelerants/radeon_hd/tmds.cpp index 2d7f46b446..09717a8485 100644 --- a/src/add-ons/accelerants/radeon_hd/tmds.cpp +++ b/src/add-ons/accelerants/radeon_hd/tmds.cpp @@ -40,12 +40,6 @@ TMDSSense(uint8 tmdsIndex) // Restore saved value Write32Mask(OUT, TMDSA_LOAD_DETECT, loadDetect, 0x00000001); - if (result) { - TRACE("%s: TMDS%d: Display device attached\n", __func__, tmdsIndex); - } else { - TRACE("%s: TMDS%d: No display device attached\n", __func__, tmdsIndex); - } - return result; }