aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-11-17 02:49:40 -0500
committerDave Airlie <airlied@redhat.com>2010-11-17 23:56:19 -0500
commitc7a71fc761551dc8be8543f14a90d08cda4e77f9 (patch)
tree2df711f43dc1375ccf67698c2bfad10ae4be8349 /drivers/gpu/drm
parentba251bde9ab8bdce8fbd3f60dbb71b36cc4c9adf (diff)
drm/radeon/kms/atom: set sane defaults in atombios_get_encoder_mode()
If there was no connector mapped to the encoder, atombios_get_encoder_mode() returned 0 which is the id for DP. Return something sane instead based on the encoder id. This avoids hitting the DP paths on non-DP encoders. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/radeon/radeon_encoders.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index d55cb58283a9..c6981dfd9156 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)
595int 595int
596atombios_get_encoder_mode(struct drm_encoder *encoder) 596atombios_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) {