diff options
author | Jeremy Erickson <jerickso@cs.unc.edu> | 2014-04-18 17:06:00 -0400 |
---|---|---|
committer | Jeremy Erickson <jerickso@cs.unc.edu> | 2014-04-18 17:06:00 -0400 |
commit | a215aa7b9ab3759c047201199fba64d3042d7f13 (patch) | |
tree | bca37493d9b2233450e6d3ffced1261d0e4f71fe /drivers/gpu/drm/radeon/radeon_encoders.c | |
parent | d31199a77ef606f1d06894385f1852181ba6136b (diff) |
Update 2.6.36 to 2.6.36.4wip-dissipation2-jerickso
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_encoders.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_encoders.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 2c293e8304d6..b82015e148e6 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
@@ -595,6 +595,7 @@ atombios_digital_setup(struct drm_encoder *encoder, int action) | |||
595 | int | 595 | int |
596 | atombios_get_encoder_mode(struct drm_encoder *encoder) | 596 | atombios_get_encoder_mode(struct drm_encoder *encoder) |
597 | { | 597 | { |
598 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
598 | struct drm_device *dev = encoder->dev; | 599 | struct drm_device *dev = encoder->dev; |
599 | struct radeon_device *rdev = dev->dev_private; | 600 | struct radeon_device *rdev = dev->dev_private; |
600 | struct drm_connector *connector; | 601 | struct drm_connector *connector; |
@@ -602,9 +603,20 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
602 | struct radeon_connector_atom_dig *dig_connector; | 603 | struct radeon_connector_atom_dig *dig_connector; |
603 | 604 | ||
604 | connector = radeon_get_connector_for_encoder(encoder); | 605 | connector = radeon_get_connector_for_encoder(encoder); |
605 | if (!connector) | 606 | if (!connector) { |
606 | return 0; | 607 | switch (radeon_encoder->encoder_id) { |
607 | 608 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: | |
609 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: | ||
610 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: | ||
611 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA: | ||
612 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: | ||
613 | return ATOM_ENCODER_MODE_DVI; | ||
614 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: | ||
615 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: | ||
616 | default: | ||
617 | return ATOM_ENCODER_MODE_CRT; | ||
618 | } | ||
619 | } | ||
608 | radeon_connector = to_radeon_connector(connector); | 620 | radeon_connector = to_radeon_connector(connector); |
609 | 621 | ||
610 | switch (connector->connector_type) { | 622 | switch (connector->connector_type) { |
@@ -1547,6 +1559,23 @@ static void radeon_atom_encoder_disable(struct drm_encoder *encoder) | |||
1547 | struct radeon_device *rdev = dev->dev_private; | 1559 | struct radeon_device *rdev = dev->dev_private; |
1548 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 1560 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
1549 | struct radeon_encoder_atom_dig *dig; | 1561 | struct radeon_encoder_atom_dig *dig; |
1562 | |||
1563 | /* check for pre-DCE3 cards with shared encoders; | ||
1564 | * can't really use the links individually, so don't disable | ||
1565 | * the encoder if it's in use by another connector | ||
1566 | */ | ||
1567 | if (!ASIC_IS_DCE3(rdev)) { | ||
1568 | struct drm_encoder *other_encoder; | ||
1569 | struct radeon_encoder *other_radeon_encoder; | ||
1570 | |||
1571 | list_for_each_entry(other_encoder, &dev->mode_config.encoder_list, head) { | ||
1572 | other_radeon_encoder = to_radeon_encoder(other_encoder); | ||
1573 | if ((radeon_encoder->encoder_id == other_radeon_encoder->encoder_id) && | ||
1574 | drm_helper_encoder_in_use(other_encoder)) | ||
1575 | goto disable_done; | ||
1576 | } | ||
1577 | } | ||
1578 | |||
1550 | radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); | 1579 | radeon_atom_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); |
1551 | 1580 | ||
1552 | switch (radeon_encoder->encoder_id) { | 1581 | switch (radeon_encoder->encoder_id) { |
@@ -1586,6 +1615,7 @@ static void radeon_atom_encoder_disable(struct drm_encoder *encoder) | |||
1586 | break; | 1615 | break; |
1587 | } | 1616 | } |
1588 | 1617 | ||
1618 | disable_done: | ||
1589 | if (radeon_encoder_is_digital(encoder)) { | 1619 | if (radeon_encoder_is_digital(encoder)) { |
1590 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) | 1620 | if (atombios_get_encoder_mode(encoder) == ATOM_ENCODER_MODE_HDMI) |
1591 | r600_hdmi_disable(encoder); | 1621 | r600_hdmi_disable(encoder); |