aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_atombios.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index 6d30868744ee..61141981880d 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -32,11 +32,11 @@
32 32
33/* from radeon_encoder.c */ 33/* from radeon_encoder.c */
34extern uint32_t 34extern uint32_t
35radeon_get_encoder_id(struct drm_device *dev, uint32_t supported_device, 35radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device,
36 uint8_t dac); 36 uint8_t dac);
37extern void radeon_link_encoder_connector(struct drm_device *dev); 37extern void radeon_link_encoder_connector(struct drm_device *dev);
38extern void 38extern void
39radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_id, 39radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum,
40 uint32_t supported_device); 40 uint32_t supported_device);
41 41
42/* from radeon_connector.c */ 42/* from radeon_connector.c */
@@ -46,14 +46,14 @@ radeon_add_atom_connector(struct drm_device *dev,
46 uint32_t supported_device, 46 uint32_t supported_device,
47 int connector_type, 47 int connector_type,
48 struct radeon_i2c_bus_rec *i2c_bus, 48 struct radeon_i2c_bus_rec *i2c_bus,
49 bool linkb, uint32_t igp_lane_info, 49 uint32_t igp_lane_info,
50 uint16_t connector_object_id, 50 uint16_t connector_object_id,
51 struct radeon_hpd *hpd, 51 struct radeon_hpd *hpd,
52 struct radeon_router *router); 52 struct radeon_router *router);
53 53
54/* from radeon_legacy_encoder.c */ 54/* from radeon_legacy_encoder.c */
55extern void 55extern void
56radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_id, 56radeon_add_legacy_encoder(struct drm_device *dev, uint32_t encoder_enum,
57 uint32_t supported_device); 57 uint32_t supported_device);
58 58
59union atom_supported_devices { 59union atom_supported_devices {
@@ -226,6 +226,8 @@ static struct radeon_hpd radeon_atom_get_hpd_info_from_gpio(struct radeon_device
226 struct radeon_hpd hpd; 226 struct radeon_hpd hpd;
227 u32 reg; 227 u32 reg;
228 228
229 memset(&hpd, 0, sizeof(struct radeon_hpd));
230
229 if (ASIC_IS_DCE4(rdev)) 231 if (ASIC_IS_DCE4(rdev))
230 reg = EVERGREEN_DC_GPIO_HPD_A; 232 reg = EVERGREEN_DC_GPIO_HPD_A;
231 else 233 else
@@ -477,7 +479,6 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
477 int i, j, k, path_size, device_support; 479 int i, j, k, path_size, device_support;
478 int connector_type; 480 int connector_type;
479 u16 igp_lane_info, conn_id, connector_object_id; 481 u16 igp_lane_info, conn_id, connector_object_id;
480 bool linkb;
481 struct radeon_i2c_bus_rec ddc_bus; 482 struct radeon_i2c_bus_rec ddc_bus;
482 struct radeon_router router; 483 struct radeon_router router;
483 struct radeon_gpio_rec gpio; 484 struct radeon_gpio_rec gpio;
@@ -510,7 +511,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
510 addr += path_size; 511 addr += path_size;
511 path = (ATOM_DISPLAY_OBJECT_PATH *) addr; 512 path = (ATOM_DISPLAY_OBJECT_PATH *) addr;
512 path_size += le16_to_cpu(path->usSize); 513 path_size += le16_to_cpu(path->usSize);
513 linkb = false; 514
514 if (device_support & le16_to_cpu(path->usDeviceTag)) { 515 if (device_support & le16_to_cpu(path->usDeviceTag)) {
515 uint8_t con_obj_id, con_obj_num, con_obj_type; 516 uint8_t con_obj_id, con_obj_num, con_obj_type;
516 517
@@ -601,13 +602,10 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
601 OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT; 602 OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT;
602 603
603 if (grph_obj_type == GRAPH_OBJECT_TYPE_ENCODER) { 604 if (grph_obj_type == GRAPH_OBJECT_TYPE_ENCODER) {
604 if (grph_obj_num == 2) 605 u16 encoder_obj = le16_to_cpu(path->usGraphicObjIds[j]);
605 linkb = true;
606 else
607 linkb = false;
608 606
609 radeon_add_atom_encoder(dev, 607 radeon_add_atom_encoder(dev,
610 grph_obj_id, 608 encoder_obj,
611 le16_to_cpu 609 le16_to_cpu
612 (path-> 610 (path->
613 usDeviceTag)); 611 usDeviceTag));
@@ -744,7 +742,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev)
744 le16_to_cpu(path-> 742 le16_to_cpu(path->
745 usDeviceTag), 743 usDeviceTag),
746 connector_type, &ddc_bus, 744 connector_type, &ddc_bus,
747 linkb, igp_lane_info, 745 igp_lane_info,
748 connector_object_id, 746 connector_object_id,
749 &hpd, 747 &hpd,
750 &router); 748 &router);
@@ -933,13 +931,13 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
933 931
934 if (ASIC_IS_AVIVO(rdev) || radeon_r4xx_atom) 932 if (ASIC_IS_AVIVO(rdev) || radeon_r4xx_atom)
935 radeon_add_atom_encoder(dev, 933 radeon_add_atom_encoder(dev,
936 radeon_get_encoder_id(dev, 934 radeon_get_encoder_enum(dev,
937 (1 << i), 935 (1 << i),
938 dac), 936 dac),
939 (1 << i)); 937 (1 << i));
940 else 938 else
941 radeon_add_legacy_encoder(dev, 939 radeon_add_legacy_encoder(dev,
942 radeon_get_encoder_id(dev, 940 radeon_get_encoder_enum(dev,
943 (1 << i), 941 (1 << i),
944 dac), 942 dac),
945 (1 << i)); 943 (1 << i));
@@ -996,7 +994,7 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct
996 bios_connectors[i]. 994 bios_connectors[i].
997 connector_type, 995 connector_type,
998 &bios_connectors[i].ddc_bus, 996 &bios_connectors[i].ddc_bus,
999 false, 0, 997 0,
1000 connector_object_id, 998 connector_object_id,
1001 &bios_connectors[i].hpd, 999 &bios_connectors[i].hpd,
1002 &router); 1000 &router);
@@ -1183,7 +1181,7 @@ bool radeon_atombios_sideport_present(struct radeon_device *rdev)
1183 return true; 1181 return true;
1184 break; 1182 break;
1185 case 2: 1183 case 2:
1186 if (igp_info->info_2.ucMemoryType & 0x0f) 1184 if (igp_info->info_2.ulBootUpSidePortClock)
1187 return true; 1185 return true;
1188 break; 1186 break;
1189 default: 1187 default:
@@ -1305,6 +1303,7 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
1305 union lvds_info *lvds_info; 1303 union lvds_info *lvds_info;
1306 uint8_t frev, crev; 1304 uint8_t frev, crev;
1307 struct radeon_encoder_atom_dig *lvds = NULL; 1305 struct radeon_encoder_atom_dig *lvds = NULL;
1306 int encoder_enum = (encoder->encoder_enum & ENUM_ID_MASK) >> ENUM_ID_SHIFT;
1308 1307
1309 if (atom_parse_data_header(mode_info->atom_context, index, NULL, 1308 if (atom_parse_data_header(mode_info->atom_context, index, NULL,
1310 &frev, &crev, &data_offset)) { 1309 &frev, &crev, &data_offset)) {
@@ -1368,6 +1367,12 @@ struct radeon_encoder_atom_dig *radeon_atombios_get_lvds_info(struct
1368 } 1367 }
1369 1368
1370 encoder->native_mode = lvds->native_mode; 1369 encoder->native_mode = lvds->native_mode;
1370
1371 if (encoder_enum == 2)
1372 lvds->linkb = true;
1373 else
1374 lvds->linkb = false;
1375
1371 } 1376 }
1372 return lvds; 1377 return lvds;
1373} 1378}