diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c index ed173d3..fc701d2 100644 --- a/drivers/gpu/drm/radeon/atombios_dp.c +++ b/drivers/gpu/drm/radeon/atombios_dp.c @@ -417,19 +417,27 @@ static void radeon_dp_probe_oui(struct radeon_connector *radeon_connector) buf[0], buf[1], buf[2]); } +static void radeon_print_dpcd(struct radeon_connector_atom_dig *dig_connector) +{ + DRM_INFO("dig_connector %p\n", dig_connector); + DRM_INFO("DPCD: %*ph\n", (int)sizeof(dig_connector->dpcd), + dig_connector->dpcd); +} + bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector) { struct radeon_connector_atom_dig *dig_connector = radeon_connector->con_priv; u8 msg[DP_DPCD_SIZE]; int ret; + radeon_dp_set_rx_power_state(&radeon_connector->base, DP_SET_POWER_D0); ret = drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_DPCD_REV, msg, DP_DPCD_SIZE); if (ret > 0) { memcpy(dig_connector->dpcd, msg, DP_DPCD_SIZE); - DRM_DEBUG_KMS("DPCD: %*ph\n", (int)sizeof(dig_connector->dpcd), - dig_connector->dpcd); + DRM_INFO("%s %p\n", __func__, radeon_connector); + radeon_print_dpcd(dig_connector); radeon_dp_probe_oui(radeon_connector); @@ -498,6 +506,9 @@ void radeon_dp_set_link_config(struct drm_connector *connector, radeon_dp_get_dp_link_clock(connector, dig_connector->dpcd, mode->clock); dig_connector->dp_lane_count = radeon_dp_get_dp_lane_number(connector, dig_connector->dpcd, mode->clock); + DRM_INFO("%s, %p, %u, %u\n", __func__, radeon_connector, + dig_connector->dp_clock, dig_connector->dp_lane_count); + radeon_print_dpcd(dig_connector); } } @@ -519,6 +530,9 @@ int radeon_dp_mode_valid_helper(struct drm_connector *connector, dp_clock = radeon_dp_get_dp_link_clock(connector, dig_connector->dpcd, mode->clock); + DRM_INFO("%s, %p, %u, %u\n", __func__, radeon_connector, dp_clock, mode->clock); + radeon_print_dpcd(dig_connector); + if ((dp_clock == 540000) && (!radeon_connector_is_dp12_capable(connector))) return MODE_CLOCK_HIGH; @@ -550,6 +564,9 @@ void radeon_dp_set_rx_power_state(struct drm_connector *connector, dig_connector = radeon_connector->con_priv; + DRM_INFO("%s, %p, %u\n", __func__, radeon_connector, dig_connector->dpcd[0]); + radeon_print_dpcd(dig_connector); + /* power up/down the sink */ if (dig_connector->dpcd[0] >= 0x11) { drm_dp_dpcd_writeb(&radeon_connector->ddc_bus->aux, @@ -872,6 +889,11 @@ void radeon_dp_link_train(struct drm_encoder *encoder, dp_info.dp_clock = dig_connector->dp_clock; dp_info.aux = &radeon_connector->ddc_bus->aux; + DRM_INFO("%s, %p\n", __func__, radeon_connector); + radeon_print_dpcd(dig_connector); + DRM_INFO("dp_info dpcd: %*ph\n", (int)sizeof(dp_info.dpcd), + dp_info.dpcd); + if (radeon_dp_link_train_init(&dp_info)) goto done; if (radeon_dp_link_train_cr(&dp_info)) diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index dd39f43..fbba2e3 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c @@ -1405,11 +1405,16 @@ atombios_set_edp_panel_power(struct drm_connector *connector, int action) int i; for (i = 0; i < 300; i++) { - if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) + if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) { + radeon_dp_set_rx_power_state(connector, DP_SET_POWER_D0); return true; + } mdelay(1); } + radeon_dp_set_rx_power_state(connector, DP_SET_POWER_D0); return false; + } else { + radeon_dp_set_rx_power_state(connector, DP_SET_POWER_D3); } done: return true; diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index d17d251..8accf01 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c @@ -1633,14 +1633,19 @@ radeon_dp_detect(struct drm_connector *connector, bool force) struct drm_encoder *encoder = radeon_best_single_encoder(connector); int r; - if (radeon_dig_connector->is_mst) + if (radeon_dig_connector->is_mst) { + DRM_INFO("mst %p\n", radeon_connector); return connector_status_disconnected; + } r = pm_runtime_get_sync(connector->dev->dev); - if (r < 0) + if (r < 0) { + DRM_INFO("runtime pm %p\n", radeon_connector); return connector_status_disconnected; + } if (!force && radeon_check_hpd_status_unchanged(connector)) { + DRM_INFO("status unchanged %p\n", radeon_connector); ret = connector->status; goto out; } @@ -1667,6 +1672,7 @@ radeon_dp_detect(struct drm_connector *connector, bool force) if (!radeon_dig_connector->edp_on) atombios_set_edp_panel_power(connector, ATOM_TRANSMITTER_ACTION_POWER_ON); + DRM_INFO("check edp dpcd %p\n", radeon_connector); if (radeon_dp_getdpcd(radeon_connector)) ret = connector_status_connected; if (!radeon_dig_connector->edp_on) diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index d2e9e9e..8c8a002 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -750,7 +750,7 @@ static void radeon_print_display_setup(struct drm_device *dev) DRM_INFO("Radeon Display Connectors\n"); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { radeon_connector = to_radeon_connector(connector); - DRM_INFO("Connector %d:\n", i); + DRM_INFO("Connector %d %p 0x%08x:\n", i, radeon_connector, radeon_connector->devices); DRM_INFO(" %s\n", connector->name); if (radeon_connector->hpd.hpd != RADEON_HPD_NONE) DRM_INFO(" %s\n", hpd_names[radeon_connector->hpd.hpd]); @@ -785,6 +785,7 @@ static void radeon_print_display_setup(struct drm_device *dev) list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { radeon_encoder = to_radeon_encoder(encoder); devices = radeon_encoder->devices & radeon_connector->devices; + DRM_INFO(" encoder: %p, 0x%08x\n", radeon_encoder, radeon_encoder->devices); if (devices) { if (devices & ATOM_DEVICE_CRT1_SUPPORT) DRM_INFO(" CRT1: %s\n", encoder_names[radeon_encoder->encoder_id]);