diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2011-05-20 04:34:19 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-05-20 06:02:24 -0400 |
commit | 2dafb74d63d3f79d0357ff19bf7691c22b034926 (patch) | |
tree | aa7d15a2d63728324bb71e10e59b0b32df50f2e2 /drivers/gpu | |
parent | 3a5f4a21c5708479a9334c8a8268f300aea2c628 (diff) |
drm/radeon/kms: fix eDP panel power function
need to wait for the panel to power up.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_encoders.c | 24 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 2 |
2 files changed, 20 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 49fcd60b849d..cdac73975f6e 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
@@ -1095,7 +1095,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t | |||
1095 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 1095 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | void | 1098 | bool |
1099 | atombios_set_edp_panel_power(struct drm_connector *connector, int action) | 1099 | atombios_set_edp_panel_power(struct drm_connector *connector, int action) |
1100 | { | 1100 | { |
1101 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | 1101 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); |
@@ -1106,23 +1106,37 @@ atombios_set_edp_panel_power(struct drm_connector *connector, int action) | |||
1106 | uint8_t frev, crev; | 1106 | uint8_t frev, crev; |
1107 | 1107 | ||
1108 | if (connector->connector_type != DRM_MODE_CONNECTOR_eDP) | 1108 | if (connector->connector_type != DRM_MODE_CONNECTOR_eDP) |
1109 | return; | 1109 | goto done; |
1110 | 1110 | ||
1111 | if (!ASIC_IS_DCE4(rdev)) | 1111 | if (!ASIC_IS_DCE4(rdev)) |
1112 | return; | 1112 | goto done; |
1113 | 1113 | ||
1114 | if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) && | 1114 | if ((action != ATOM_TRANSMITTER_ACTION_POWER_ON) && |
1115 | (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) | 1115 | (action != ATOM_TRANSMITTER_ACTION_POWER_OFF)) |
1116 | return; | 1116 | goto done; |
1117 | 1117 | ||
1118 | if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) | 1118 | if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) |
1119 | return; | 1119 | goto done; |
1120 | 1120 | ||
1121 | memset(&args, 0, sizeof(args)); | 1121 | memset(&args, 0, sizeof(args)); |
1122 | 1122 | ||
1123 | args.v1.ucAction = action; | 1123 | args.v1.ucAction = action; |
1124 | 1124 | ||
1125 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 1125 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
1126 | |||
1127 | /* wait for the panel to power up */ | ||
1128 | if (action == ATOM_TRANSMITTER_ACTION_POWER_ON) { | ||
1129 | int i; | ||
1130 | |||
1131 | for (i = 0; i < 300; i++) { | ||
1132 | if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) | ||
1133 | return true; | ||
1134 | mdelay(1); | ||
1135 | } | ||
1136 | return false; | ||
1137 | } | ||
1138 | done: | ||
1139 | return true; | ||
1126 | } | 1140 | } |
1127 | 1141 | ||
1128 | union external_encoder_control { | 1142 | union external_encoder_control { |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 9c57538231d5..e4d32373c630 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
@@ -545,7 +545,7 @@ struct drm_encoder *radeon_encoder_legacy_tmds_ext_add(struct drm_device *dev, i | |||
545 | extern void atombios_dvo_setup(struct drm_encoder *encoder, int action); | 545 | extern void atombios_dvo_setup(struct drm_encoder *encoder, int action); |
546 | extern void atombios_digital_setup(struct drm_encoder *encoder, int action); | 546 | extern void atombios_digital_setup(struct drm_encoder *encoder, int action); |
547 | extern int atombios_get_encoder_mode(struct drm_encoder *encoder); | 547 | extern int atombios_get_encoder_mode(struct drm_encoder *encoder); |
548 | extern void atombios_set_edp_panel_power(struct drm_connector *connector, int action); | 548 | extern bool atombios_set_edp_panel_power(struct drm_connector *connector, int action); |
549 | extern void radeon_encoder_set_active_device(struct drm_encoder *encoder); | 549 | extern void radeon_encoder_set_active_device(struct drm_encoder *encoder); |
550 | 550 | ||
551 | extern void radeon_crtc_load_lut(struct drm_crtc *crtc); | 551 | extern void radeon_crtc_load_lut(struct drm_crtc *crtc); |