diff options
| author | Alex Deucher <alexdeucher@gmail.com> | 2011-06-13 17:13:31 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2011-06-16 19:27:59 -0400 |
| commit | fbb87773655e7b0292756f9533c3fc21aca0797f (patch) | |
| tree | d54d1d4c5b9aab8819dae41bd249b8a23b7f74f8 | |
| parent | ba7e05e95880ad80f012555fb8e925cb1f9a5d63 (diff) | |
drm/radeon/kms: rework atombios_get_encoder_mode()
This should give us more reliable results if the table
is called before an active device is set.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_encoders.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 03f124d626c2..39fa2258f235 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
| @@ -660,21 +660,16 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
| 660 | if (radeon_encoder_is_dp_bridge(encoder)) | 660 | if (radeon_encoder_is_dp_bridge(encoder)) |
| 661 | return ATOM_ENCODER_MODE_DP; | 661 | return ATOM_ENCODER_MODE_DP; |
| 662 | 662 | ||
| 663 | /* DVO is always DVO */ | ||
| 664 | if (radeon_encoder->encoder_id == ATOM_ENCODER_MODE_DVO) | ||
| 665 | return ATOM_ENCODER_MODE_DVO; | ||
| 666 | |||
| 663 | connector = radeon_get_connector_for_encoder(encoder); | 667 | connector = radeon_get_connector_for_encoder(encoder); |
| 664 | if (!connector) { | 668 | /* if we don't have an active device yet, just use one of |
| 665 | switch (radeon_encoder->encoder_id) { | 669 | * the connectors tied to the encoder. |
| 666 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: | 670 | */ |
| 667 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: | 671 | if (!connector) |
| 668 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: | 672 | connector = radeon_get_connector_for_encoder_init(encoder); |
| 669 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_LVTMA: | ||
| 670 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: | ||
| 671 | return ATOM_ENCODER_MODE_DVI; | ||
| 672 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC1: | ||
| 673 | case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DAC2: | ||
| 674 | default: | ||
| 675 | return ATOM_ENCODER_MODE_CRT; | ||
| 676 | } | ||
| 677 | } | ||
| 678 | radeon_connector = to_radeon_connector(connector); | 673 | radeon_connector = to_radeon_connector(connector); |
| 679 | 674 | ||
| 680 | switch (connector->connector_type) { | 675 | switch (connector->connector_type) { |
