diff --git a/src/add-ons/accelerants/radeon_hd/accelerant.cpp b/src/add-ons/accelerants/radeon_hd/accelerant.cpp
index 727a3ca38a..8f429f8f44 100644
a
|
b
|
radeon_init_accelerant(int device)
|
280 | 280 | // print found connectors |
281 | 281 | debug_connectors(); |
282 | 282 | |
283 | | // setup encoders on each connector if needed |
284 | | encoder_init(); |
285 | | |
286 | 283 | // program external pll clock |
287 | 284 | pll_external_init(); |
288 | 285 | |
… |
… |
radeon_init_accelerant(int device)
|
297 | 294 | // print found displays |
298 | 295 | debug_displays(); |
299 | 296 | |
| 297 | // setup encoders on each connector if needed |
| 298 | encoder_init(); |
| 299 | |
300 | 300 | // create initial list of video modes |
301 | 301 | status = create_mode_list(); |
302 | 302 | //if (status != B_OK) { |
diff --git a/src/add-ons/accelerants/radeon_hd/display.cpp b/src/add-ons/accelerants/radeon_hd/display.cpp
index 55557568a3..7dcfc29ce5 100644
a
|
b
|
display_get_encoder_mode(uint32 connectorIndex)
|
449 | 449 | return ATOM_ENCODER_MODE_DVO; |
450 | 450 | } |
451 | 451 | |
452 | | // Find crtc for connector so we can identify source of edid data |
453 | | int32 crtc = -1; |
| 452 | // Find display for connector so we can identify source of edid data |
| 453 | int32 crtcID = -1; |
454 | 454 | for (int32 id = 0; id < MAX_DISPLAY; id++) { |
455 | 455 | if (gDisplay[id]->connectorIndex == connectorIndex) { |
456 | | crtc = id; |
| 456 | crtcID = id; |
457 | 457 | break; |
458 | 458 | } |
459 | 459 | } |
460 | 460 | bool edidDigital = false; |
461 | | if (crtc == -1) { |
462 | | ERROR("%s: BUG: executed on connector without crtc!\n", __func__); |
| 461 | if (crtcID == -1) { |
| 462 | ERROR("%s: BUG: executed on connector without assigned display!\n", |
| 463 | __func__); |
463 | 464 | } else { |
464 | | edid1_info* edid = &gDisplay[crtc]->edidData; |
| 465 | edid1_info* edid = &gDisplay[crtcID]->edidData; |
465 | 466 | edidDigital = edid->display.input_type ? true : false; |
466 | 467 | } |
467 | 468 | |
diff --git a/src/add-ons/accelerants/radeon_hd/encoder.cpp b/src/add-ons/accelerants/radeon_hd/encoder.cpp
index 1cc11c383c..c6c560d4ac 100644
a
|
b
|
encoder_init()
|
41 | 41 | TRACE("%s: called\n", __func__); |
42 | 42 | radeon_shared_info &info = *gInfo->shared_info; |
43 | 43 | |
44 | | for (uint32 id = 0; id < ATOM_MAX_SUPPORTED_DEVICE; id++) { |
45 | | if (gConnector[id]->valid == false) |
| 44 | // For each attached display... |
| 45 | uint32 crtcID; |
| 46 | uint32 initCount = 0; |
| 47 | for (crtcID = 0; crtcID < MAX_DISPLAY; crtcID++) { |
| 48 | if (gDisplay[crtcID]->attached != true) |
46 | 49 | continue; |
| 50 | uint16 connectorID = gDisplay[crtcID]->connectorIndex; |
| 51 | |
| 52 | if (gConnector[connectorID]->valid == false) |
| 53 | continue; |
| 54 | |
| 55 | initCount++; |
47 | 56 | |
48 | | switch (gConnector[id]->encoder.objectID) { |
| 57 | switch (gConnector[connectorID]->encoder.objectID) { |
49 | 58 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: |
50 | 59 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: |
51 | 60 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: |
52 | 61 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA: |
53 | | transmitter_dig_setup(id, 0, 0, 0, |
| 62 | transmitter_dig_setup(connectorID, 0, 0, 0, |
54 | 63 | ATOM_TRANSMITTER_ACTION_INIT); |
55 | 64 | break; |
56 | 65 | default: |
… |
… |
encoder_init()
|
58 | 67 | } |
59 | 68 | |
60 | 69 | if ((info.chipsetFlags & CHIP_APU) != 0) { |
61 | | if (gConnector[id]->encoderExternal.valid == true) { |
62 | | encoder_external_setup(id, |
| 70 | if (gConnector[connectorID]->encoderExternal.valid == true) { |
| 71 | encoder_external_setup(connectorID, |
63 | 72 | EXTERNAL_ENCODER_ACTION_V3_ENCODER_INIT); |
64 | 73 | } |
65 | 74 | } |
66 | 75 | } |
| 76 | if (initCount == 0) { |
| 77 | ERROR("%s: WARNING: Didn't find any attached displays to init!", |
| 78 | __func__); |
| 79 | } |
67 | 80 | } |
68 | 81 | |
69 | 82 | |
70 | 83 | void |
71 | 84 | encoder_assign_crtc(uint8 crtcID) |
72 | 85 | { |
73 | | TRACE("%s\n", __func__); |
| 86 | TRACE("%s: display %" B_PRIu8 "\n", __func__, crtcID); |
74 | 87 | |
75 | 88 | int index = GetIndexIntoMasterTable(COMMAND, SelectCRTC_Source); |
76 | 89 | |
… |
… |
encoder_assign_crtc(uint8 crtcID)
|
223 | 236 | uint32 |
224 | 237 | encoder_pick_dig(uint32 connectorIndex) |
225 | 238 | { |
226 | | TRACE("%s\n", __func__); |
| 239 | TRACE("%s: connector %" B_PRIu32 "\n", __func__, connectorIndex); |
227 | 240 | radeon_shared_info &info = *gInfo->shared_info; |
228 | 241 | uint32 encoderID = gConnector[connectorIndex]->encoder.objectID; |
229 | 242 | |
… |
… |
encoder_pick_dig(uint32 connectorIndex)
|
274 | 287 | void |
275 | 288 | encoder_apply_quirks(uint8 crtcID) |
276 | 289 | { |
277 | | TRACE("%s\n", __func__); |
| 290 | TRACE("%s: display %" B_PRIu8 "\n", __func__, crtcID); |
278 | 291 | radeon_shared_info &info = *gInfo->shared_info; |
279 | 292 | register_info* regs = gDisplay[crtcID]->regs; |
280 | 293 | uint32 connectorIndex = gDisplay[crtcID]->connectorIndex; |
… |
… |
encoder_apply_quirks(uint8 crtcID)
|
293 | 306 | void |
294 | 307 | encoder_mode_set(uint8 crtcID) |
295 | 308 | { |
296 | | TRACE("%s\n", __func__); |
| 309 | TRACE("%s: display %" B_PRIu8 "\n", __func__, crtcID); |
297 | 310 | radeon_shared_info &info = *gInfo->shared_info; |
298 | 311 | uint32 connectorIndex = gDisplay[crtcID]->connectorIndex; |
299 | 312 | uint16 connectorFlags = gConnector[connectorIndex]->flags; |
… |
… |
encoder_mode_set(uint8 crtcID)
|
386 | 399 | status_t |
387 | 400 | encoder_tv_setup(uint32 connectorIndex, uint32 pixelClock, int command) |
388 | 401 | { |
| 402 | TRACE("%s: connector %" B_PRIu32 ", pixelClock: %" B_PRIu32 "\n", __func__, |
| 403 | connectorIndex, pixelClock); |
| 404 | |
389 | 405 | uint16 connectorFlags = gConnector[connectorIndex]->flags; |
390 | 406 | |
391 | 407 | TV_ENCODER_CONTROL_PS_ALLOCATION args; |
… |
… |
encoder_tv_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
411 | 427 | status_t |
412 | 428 | encoder_digital_setup(uint32 connectorIndex, uint32 pixelClock, int command) |
413 | 429 | { |
414 | | TRACE("%s\n", __func__); |
| 430 | TRACE("%s: connector %" B_PRIu32 ", pixelClock: %" B_PRIu32 "\n", __func__, |
| 431 | connectorIndex, pixelClock); |
415 | 432 | |
416 | 433 | int index = 0; |
417 | 434 | uint16 connectorFlags = gConnector[connectorIndex]->flags; |
… |
… |
encoder_get_bpc()
|
573 | 590 | status_t |
574 | 591 | encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command) |
575 | 592 | { |
| 593 | TRACE("%s\n", __func__); |
| 594 | |
576 | 595 | radeon_shared_info &info = *gInfo->shared_info; |
577 | 596 | connector_info* connector = gConnector[connectorIndex]; |
578 | 597 | |
… |
… |
encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
834 | 853 | status_t |
835 | 854 | encoder_external_setup(uint32 connectorIndex, int command) |
836 | 855 | { |
837 | | TRACE("%s\n", __func__); |
| 856 | TRACE("%s: connector %" B_PRIu32 "\n", __func__, connectorIndex); |
838 | 857 | |
839 | 858 | encoder_info* encoder |
840 | 859 | = &gConnector[connectorIndex]->encoder; |
… |
… |
encoder_external_setup(uint32 connectorIndex, int command)
|
1004 | 1023 | status_t |
1005 | 1024 | encoder_analog_setup(uint32 connectorIndex, uint32 pixelClock, int command) |
1006 | 1025 | { |
1007 | | TRACE("%s\n", __func__); |
| 1026 | TRACE("%s: connector %" B_PRIu32 ", pixelClock: %" B_PRIu32 "\n", __func__, |
| 1027 | connectorIndex, pixelClock); |
1008 | 1028 | |
1009 | 1029 | uint32 connectorFlags = gConnector[connectorIndex]->flags; |
1010 | 1030 | |
… |
… |
encoder_analog_setup(uint32 connectorIndex, uint32 pixelClock, int command)
|
1049 | 1069 | bool |
1050 | 1070 | encoder_analog_load_detect(uint32 connectorIndex) |
1051 | 1071 | { |
1052 | | TRACE("%s\n", __func__); |
| 1072 | TRACE("%s: connector %" B_PRIu32 "\n", __func__, connectorIndex); |
1053 | 1073 | |
1054 | 1074 | if (gConnector[connectorIndex]->encoderExternal.valid == true) |
1055 | 1075 | return encoder_dig_load_detect(connectorIndex); |
… |
… |
encoder_analog_load_detect(uint32 connectorIndex)
|
1061 | 1081 | bool |
1062 | 1082 | encoder_dac_load_detect(uint32 connectorIndex) |
1063 | 1083 | { |
1064 | | TRACE("%s\n", __func__); |
| 1084 | TRACE("%s: connector %" B_PRIu32 "\n", __func__, connectorIndex); |
1065 | 1085 | |
1066 | 1086 | uint32 connectorFlags = gConnector[connectorIndex]->flags; |
1067 | 1087 | uint32 encoderID = gConnector[connectorIndex]->encoder.objectID; |
… |
… |
encoder_dac_load_detect(uint32 connectorIndex)
|
1156 | 1176 | bool |
1157 | 1177 | encoder_dig_load_detect(uint32 connectorIndex) |
1158 | 1178 | { |
1159 | | TRACE("%s\n", __func__); |
| 1179 | TRACE("%s: connector %" B_PRIu32 "\n", __func__, connectorIndex); |
1160 | 1180 | radeon_shared_info &info = *gInfo->shared_info; |
1161 | 1181 | |
1162 | 1182 | if (info.dceMajor < 4) { |
… |
… |
status_t
|
1197 | 1217 | transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock, |
1198 | 1218 | uint8 laneNumber, uint8 laneSet, int command) |
1199 | 1219 | { |
1200 | | TRACE("%s\n", __func__); |
| 1220 | TRACE("%s: connector %" B_PRIu32 ", pixelClock: %" B_PRIu32 "\n", __func__, |
| 1221 | connectorIndex, pixelClock); |
1201 | 1222 | |
1202 | 1223 | uint16 encoderID = gConnector[connectorIndex]->encoder.objectID; |
1203 | 1224 | int index; |
… |
… |
transmitter_dig_setup(uint32 connectorIndex, uint32 pixelClock,
|
1671 | 1692 | void |
1672 | 1693 | encoder_crtc_scratch(uint8 crtcID) |
1673 | 1694 | { |
1674 | | TRACE("%s\n", __func__); |
| 1695 | TRACE("%s: display %" B_PRIu8 "\n", __func__, crtcID); |
1675 | 1696 | |
1676 | 1697 | uint32 connectorIndex = gDisplay[crtcID]->connectorIndex; |
1677 | 1698 | uint32 connectorFlags = gConnector[connectorIndex]->flags; |
… |
… |
encoder_crtc_scratch(uint8 crtcID)
|
1720 | 1741 | void |
1721 | 1742 | encoder_dpms_scratch(uint8 crtcID, bool power) |
1722 | 1743 | { |
1723 | | TRACE("%s\n", __func__); |
| 1744 | TRACE("%s: display %" B_PRIu8 "\n", __func__, crtcID); |
1724 | 1745 | |
1725 | 1746 | uint32 connectorIndex = gDisplay[crtcID]->connectorIndex; |
1726 | 1747 | uint32 connectorFlags = gConnector[connectorIndex]->flags; |
… |
… |
encoder_dpms_scratch(uint8 crtcID, bool power)
|
1795 | 1816 | void |
1796 | 1817 | encoder_dpms_set(uint8 crtcID, int mode) |
1797 | 1818 | { |
1798 | | TRACE("%s: power: %s\n", __func__, mode == B_DPMS_ON ? "true" : "false"); |
| 1819 | TRACE("%s: display %" B_PRIu8 ", power: %s\n", __func__, crtcID, |
| 1820 | mode == B_DPMS_ON ? "true" : "false"); |
1799 | 1821 | |
1800 | 1822 | int index = -1; |
1801 | 1823 | radeon_shared_info &info = *gInfo->shared_info; |
… |
… |
encoder_dpms_set(uint8 crtcID, int mode)
|
1890 | 1912 | void |
1891 | 1913 | encoder_dpms_set_dig(uint8 crtcID, int mode) |
1892 | 1914 | { |
1893 | | TRACE("%s: power: %s\n", __func__, mode == B_DPMS_ON ? "true" : "false"); |
| 1915 | TRACE("%s: display %" B_PRIu8 ", power: %s\n", __func__, crtcID, |
| 1916 | mode == B_DPMS_ON ? "true" : "false"); |
1894 | 1917 | |
1895 | 1918 | radeon_shared_info &info = *gInfo->shared_info; |
1896 | 1919 | uint32 connectorIndex = gDisplay[crtcID]->connectorIndex; |