aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_atombios.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2011-01-06 21:19:21 -0500
committerDave Airlie <airlied@redhat.com>2011-01-06 23:11:28 -0500
commit36868bda88b92ce8a9aa8b3ee2e0d1e0de09cc19 (patch)
tree4617c7eb74dddf88de13638f8a6b169c7238656d /drivers/gpu/drm/radeon/radeon_atombios.c
parentd07f4e83506712f31ad661415ea28d536a70a939 (diff)
drm/radeon/kms: parse DCE5 encoder caps when setting up encoders
Needed to tell which DIG encoders are HBR2 capable for DP 1.2. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c44
1 files changed, 35 insertions, 9 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,
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_enum, 39radeon_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 */
43extern void 43extern 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,