diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 44 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_encoders.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 1 |
3 files changed, 41 insertions, 10 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 11573d085e61..a2dfe257079c 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
@@ -37,7 +37,7 @@ radeon_get_encoder_enum(struct drm_device *dev, uint32_t supported_device, | |||
37 | extern void radeon_link_encoder_connector(struct drm_device *dev); | 37 | extern void radeon_link_encoder_connector(struct drm_device *dev); |
38 | extern void | 38 | extern void |
39 | radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum, | 39 | radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum, |
40 | uint32_t supported_device); | 40 | uint32_t supported_device, u16 caps); |
41 | 41 | ||
42 | /* from radeon_connector.c */ | 42 | /* from radeon_connector.c */ |
43 | extern void | 43 | extern void |
@@ -537,6 +537,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
537 | u16 size, data_offset; | 537 | u16 size, data_offset; |
538 | u8 frev, crev; | 538 | u8 frev, crev; |
539 | ATOM_CONNECTOR_OBJECT_TABLE *con_obj; | 539 | ATOM_CONNECTOR_OBJECT_TABLE *con_obj; |
540 | ATOM_ENCODER_OBJECT_TABLE *enc_obj; | ||
540 | ATOM_OBJECT_TABLE *router_obj; | 541 | ATOM_OBJECT_TABLE *router_obj; |
541 | ATOM_DISPLAY_OBJECT_PATH_TABLE *path_obj; | 542 | ATOM_DISPLAY_OBJECT_PATH_TABLE *path_obj; |
542 | ATOM_OBJECT_HEADER *obj_header; | 543 | ATOM_OBJECT_HEADER *obj_header; |
@@ -561,6 +562,9 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
561 | con_obj = (ATOM_CONNECTOR_OBJECT_TABLE *) | 562 | con_obj = (ATOM_CONNECTOR_OBJECT_TABLE *) |
562 | (ctx->bios + data_offset + | 563 | (ctx->bios + data_offset + |
563 | le16_to_cpu(obj_header->usConnectorObjectTableOffset)); | 564 | le16_to_cpu(obj_header->usConnectorObjectTableOffset)); |
565 | enc_obj = (ATOM_ENCODER_OBJECT_TABLE *) | ||
566 | (ctx->bios + data_offset + | ||
567 | le16_to_cpu(obj_header->usEncoderObjectTableOffset)); | ||
564 | router_obj = (ATOM_OBJECT_TABLE *) | 568 | router_obj = (ATOM_OBJECT_TABLE *) |
565 | (ctx->bios + data_offset + | 569 | (ctx->bios + data_offset + |
566 | le16_to_cpu(obj_header->usRouterObjectTableOffset)); | 570 | le16_to_cpu(obj_header->usRouterObjectTableOffset)); |
@@ -666,14 +670,35 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
666 | OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT; | 670 | OBJECT_TYPE_MASK) >> OBJECT_TYPE_SHIFT; |
667 | 671 | ||
668 | if (grph_obj_type == GRAPH_OBJECT_TYPE_ENCODER) { | 672 | if (grph_obj_type == GRAPH_OBJECT_TYPE_ENCODER) { |
669 | u16 encoder_obj = le16_to_cpu(path->usGraphicObjIds[j]); | 673 | for (k = 0; k < enc_obj->ucNumberOfObjects; k++) { |
670 | 674 | u16 encoder_obj = le16_to_cpu(enc_obj->asObjects[k].usObjectID); | |
671 | radeon_add_atom_encoder(dev, | 675 | if (le16_to_cpu(path->usGraphicObjIds[j]) == encoder_obj) { |
672 | encoder_obj, | 676 | ATOM_COMMON_RECORD_HEADER *record = (ATOM_COMMON_RECORD_HEADER *) |
673 | le16_to_cpu | 677 | (ctx->bios + data_offset + |
674 | (path-> | 678 | le16_to_cpu(enc_obj->asObjects[k].usRecordOffset)); |
675 | usDeviceTag)); | 679 | ATOM_ENCODER_CAP_RECORD *cap_record; |
680 | u16 caps = 0; | ||
676 | 681 | ||
682 | while (record->ucRecordType > 0 && | ||
683 | record->ucRecordType <= ATOM_MAX_OBJECT_RECORD_NUMBER) { | ||
684 | switch (record->ucRecordType) { | ||
685 | case ATOM_ENCODER_CAP_RECORD_TYPE: | ||
686 | cap_record =(ATOM_ENCODER_CAP_RECORD *) | ||
687 | record; | ||
688 | caps = le16_to_cpu(cap_record->usEncoderCap); | ||
689 | break; | ||
690 | } | ||
691 | record = (ATOM_COMMON_RECORD_HEADER *) | ||
692 | ((char *)record + record->ucRecordSize); | ||
693 | } | ||
694 | radeon_add_atom_encoder(dev, | ||
695 | encoder_obj, | ||
696 | le16_to_cpu | ||
697 | (path-> | ||
698 | usDeviceTag), | ||
699 | caps); | ||
700 | } | ||
701 | } | ||
677 | } else if (grph_obj_type == GRAPH_OBJECT_TYPE_ROUTER) { | 702 | } else if (grph_obj_type == GRAPH_OBJECT_TYPE_ROUTER) { |
678 | for (k = 0; k < router_obj->ucNumberOfObjects; k++) { | 703 | for (k = 0; k < router_obj->ucNumberOfObjects; k++) { |
679 | u16 router_obj_id = le16_to_cpu(router_obj->asObjects[k].usObjectID); | 704 | u16 router_obj_id = le16_to_cpu(router_obj->asObjects[k].usObjectID); |
@@ -1007,7 +1032,8 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct | |||
1007 | radeon_get_encoder_enum(dev, | 1032 | radeon_get_encoder_enum(dev, |
1008 | (1 << i), | 1033 | (1 << i), |
1009 | dac), | 1034 | dac), |
1010 | (1 << i)); | 1035 | (1 << i), |
1036 | 0); | ||
1011 | else | 1037 | else |
1012 | radeon_add_legacy_encoder(dev, | 1038 | radeon_add_legacy_encoder(dev, |
1013 | radeon_get_encoder_enum(dev, | 1039 | radeon_get_encoder_enum(dev, |
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 3866c648423b..e7a948f60587 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
@@ -2046,7 +2046,10 @@ radeon_atombios_set_dig_info(struct radeon_encoder *radeon_encoder) | |||
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | void | 2048 | void |
2049 | radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_t supported_device) | 2049 | radeon_add_atom_encoder(struct drm_device *dev, |
2050 | uint32_t encoder_enum, | ||
2051 | uint32_t supported_device, | ||
2052 | u16 caps) | ||
2050 | { | 2053 | { |
2051 | struct radeon_device *rdev = dev->dev_private; | 2054 | struct radeon_device *rdev = dev->dev_private; |
2052 | struct drm_encoder *encoder; | 2055 | struct drm_encoder *encoder; |
@@ -2089,6 +2092,7 @@ radeon_add_atom_encoder(struct drm_device *dev, uint32_t encoder_enum, uint32_t | |||
2089 | radeon_encoder->rmx_type = RMX_OFF; | 2092 | radeon_encoder->rmx_type = RMX_OFF; |
2090 | radeon_encoder->underscan_type = UNDERSCAN_OFF; | 2093 | radeon_encoder->underscan_type = UNDERSCAN_OFF; |
2091 | radeon_encoder->is_ext_encoder = false; | 2094 | radeon_encoder->is_ext_encoder = false; |
2095 | radeon_encoder->caps = caps; | ||
2092 | 2096 | ||
2093 | switch (radeon_encoder->encoder_id) { | 2097 | switch (radeon_encoder->encoder_id) { |
2094 | case ENCODER_OBJECT_ID_INTERNAL_LVDS: | 2098 | case ENCODER_OBJECT_ID_INTERNAL_LVDS: |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index fd185f783a31..12bdeab91c86 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -379,6 +379,7 @@ struct radeon_encoder { | |||
379 | int hdmi_audio_workaround; | 379 | int hdmi_audio_workaround; |
380 | int hdmi_buffer_status; | 380 | int hdmi_buffer_status; |
381 | bool is_ext_encoder; | 381 | bool is_ext_encoder; |
382 | u16 caps; | ||
382 | }; | 383 | }; |
383 | 384 | ||
384 | struct radeon_connector_atom_dig { | 385 | struct radeon_connector_atom_dig { |