diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 105 |
1 files changed, 79 insertions, 26 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 12a0c760e7ff..321044bef71c 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -745,8 +745,7 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct | |||
745 | else | 745 | else |
746 | radeon_add_legacy_encoder(dev, | 746 | radeon_add_legacy_encoder(dev, |
747 | radeon_get_encoder_id(dev, | 747 | radeon_get_encoder_id(dev, |
748 | (1 << | 748 | (1 << i), |
749 | i), | ||
750 | dac), | 749 | dac), |
751 | (1 << i)); | 750 | (1 << i)); |
752 | } | 751 | } |
@@ -758,32 +757,30 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct | |||
758 | if (bios_connectors[j].valid && (i != j)) { | 757 | if (bios_connectors[j].valid && (i != j)) { |
759 | if (bios_connectors[i].line_mux == | 758 | if (bios_connectors[i].line_mux == |
760 | bios_connectors[j].line_mux) { | 759 | bios_connectors[j].line_mux) { |
761 | if (((bios_connectors[i]. | 760 | /* make sure not to combine LVDS */ |
762 | devices & | 761 | if (bios_connectors[i].devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
763 | (ATOM_DEVICE_DFP_SUPPORT)) | 762 | bios_connectors[i].line_mux = 53; |
764 | && (bios_connectors[j]. | 763 | bios_connectors[i].ddc_bus.valid = false; |
765 | devices & | 764 | continue; |
766 | (ATOM_DEVICE_CRT_SUPPORT))) | 765 | } |
767 | || | 766 | if (bios_connectors[j].devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
768 | ((bios_connectors[j]. | 767 | bios_connectors[j].line_mux = 53; |
769 | devices & | 768 | bios_connectors[j].ddc_bus.valid = false; |
770 | (ATOM_DEVICE_DFP_SUPPORT)) | 769 | continue; |
771 | && (bios_connectors[i]. | 770 | } |
772 | devices & | 771 | /* combine analog and digital for DVI-I */ |
773 | (ATOM_DEVICE_CRT_SUPPORT)))) { | 772 | if (((bios_connectors[i].devices & (ATOM_DEVICE_DFP_SUPPORT)) && |
774 | bios_connectors[i]. | 773 | (bios_connectors[j].devices & (ATOM_DEVICE_CRT_SUPPORT))) || |
775 | devices |= | 774 | ((bios_connectors[j].devices & (ATOM_DEVICE_DFP_SUPPORT)) && |
776 | bios_connectors[j]. | 775 | (bios_connectors[i].devices & (ATOM_DEVICE_CRT_SUPPORT)))) { |
777 | devices; | 776 | bios_connectors[i].devices |= |
778 | bios_connectors[i]. | 777 | bios_connectors[j].devices; |
779 | connector_type = | 778 | bios_connectors[i].connector_type = |
780 | DRM_MODE_CONNECTOR_DVII; | 779 | DRM_MODE_CONNECTOR_DVII; |
781 | if (bios_connectors[j].devices & | 780 | if (bios_connectors[j].devices & (ATOM_DEVICE_DFP_SUPPORT)) |
782 | (ATOM_DEVICE_DFP_SUPPORT)) | ||
783 | bios_connectors[i].hpd = | 781 | bios_connectors[i].hpd = |
784 | bios_connectors[j].hpd; | 782 | bios_connectors[j].hpd; |
785 | bios_connectors[j]. | 783 | bios_connectors[j].valid = false; |
786 | valid = false; | ||
787 | } | 784 | } |
788 | } | 785 | } |
789 | } | 786 | } |
@@ -1234,6 +1231,61 @@ bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index, | |||
1234 | return true; | 1231 | return true; |
1235 | } | 1232 | } |
1236 | 1233 | ||
1234 | enum radeon_tv_std | ||
1235 | radeon_atombios_get_tv_info(struct radeon_device *rdev) | ||
1236 | { | ||
1237 | struct radeon_mode_info *mode_info = &rdev->mode_info; | ||
1238 | int index = GetIndexIntoMasterTable(DATA, AnalogTV_Info); | ||
1239 | uint16_t data_offset; | ||
1240 | uint8_t frev, crev; | ||
1241 | struct _ATOM_ANALOG_TV_INFO *tv_info; | ||
1242 | enum radeon_tv_std tv_std = TV_STD_NTSC; | ||
1243 | |||
1244 | atom_parse_data_header(mode_info->atom_context, index, NULL, &frev, &crev, &data_offset); | ||
1245 | |||
1246 | tv_info = (struct _ATOM_ANALOG_TV_INFO *)(mode_info->atom_context->bios + data_offset); | ||
1247 | |||
1248 | switch (tv_info->ucTV_BootUpDefaultStandard) { | ||
1249 | case ATOM_TV_NTSC: | ||
1250 | tv_std = TV_STD_NTSC; | ||
1251 | DRM_INFO("Default TV standard: NTSC\n"); | ||
1252 | break; | ||
1253 | case ATOM_TV_NTSCJ: | ||
1254 | tv_std = TV_STD_NTSC_J; | ||
1255 | DRM_INFO("Default TV standard: NTSC-J\n"); | ||
1256 | break; | ||
1257 | case ATOM_TV_PAL: | ||
1258 | tv_std = TV_STD_PAL; | ||
1259 | DRM_INFO("Default TV standard: PAL\n"); | ||
1260 | break; | ||
1261 | case ATOM_TV_PALM: | ||
1262 | tv_std = TV_STD_PAL_M; | ||
1263 | DRM_INFO("Default TV standard: PAL-M\n"); | ||
1264 | break; | ||
1265 | case ATOM_TV_PALN: | ||
1266 | tv_std = TV_STD_PAL_N; | ||
1267 | DRM_INFO("Default TV standard: PAL-N\n"); | ||
1268 | break; | ||
1269 | case ATOM_TV_PALCN: | ||
1270 | tv_std = TV_STD_PAL_CN; | ||
1271 | DRM_INFO("Default TV standard: PAL-CN\n"); | ||
1272 | break; | ||
1273 | case ATOM_TV_PAL60: | ||
1274 | tv_std = TV_STD_PAL_60; | ||
1275 | DRM_INFO("Default TV standard: PAL-60\n"); | ||
1276 | break; | ||
1277 | case ATOM_TV_SECAM: | ||
1278 | tv_std = TV_STD_SECAM; | ||
1279 | DRM_INFO("Default TV standard: SECAM\n"); | ||
1280 | break; | ||
1281 | default: | ||
1282 | tv_std = TV_STD_NTSC; | ||
1283 | DRM_INFO("Unknown TV standard; defaulting to NTSC\n"); | ||
1284 | break; | ||
1285 | } | ||
1286 | return tv_std; | ||
1287 | } | ||
1288 | |||
1237 | struct radeon_encoder_tv_dac * | 1289 | struct radeon_encoder_tv_dac * |
1238 | radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) | 1290 | radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) |
1239 | { | 1291 | { |
@@ -1269,6 +1321,7 @@ radeon_atombios_get_tv_dac_info(struct radeon_encoder *encoder) | |||
1269 | dac = dac_info->ucDAC2_NTSC_DAC_Adjustment; | 1321 | dac = dac_info->ucDAC2_NTSC_DAC_Adjustment; |
1270 | tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); | 1322 | tv_dac->ntsc_tvdac_adj = (bg << 16) | (dac << 20); |
1271 | 1323 | ||
1324 | tv_dac->tv_std = radeon_atombios_get_tv_info(rdev); | ||
1272 | } | 1325 | } |
1273 | return tv_dac; | 1326 | return tv_dac; |
1274 | } | 1327 | } |