diff options
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index d2e614479e6f..64774ac94449 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -827,6 +827,27 @@ static int radeon_dvi_get_modes(struct drm_connector *connector) | |||
827 | return ret; | 827 | return ret; |
828 | } | 828 | } |
829 | 829 | ||
830 | static bool radeon_check_hpd_status_unchanged(struct drm_connector *connector) | ||
831 | { | ||
832 | struct drm_device *dev = connector->dev; | ||
833 | struct radeon_device *rdev = dev->dev_private; | ||
834 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | ||
835 | enum drm_connector_status status; | ||
836 | |||
837 | /* We only trust HPD on R600 and newer ASICS. */ | ||
838 | if (rdev->family >= CHIP_R600 | ||
839 | && radeon_connector->hpd.hpd != RADEON_HPD_NONE) { | ||
840 | if (radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) | ||
841 | status = connector_status_connected; | ||
842 | else | ||
843 | status = connector_status_disconnected; | ||
844 | if (connector->status == status) | ||
845 | return true; | ||
846 | } | ||
847 | |||
848 | return false; | ||
849 | } | ||
850 | |||
830 | /* | 851 | /* |
831 | * DVI is complicated | 852 | * DVI is complicated |
832 | * Do a DDC probe, if DDC probe passes, get the full EDID so | 853 | * Do a DDC probe, if DDC probe passes, get the full EDID so |
@@ -851,6 +872,9 @@ radeon_dvi_detect(struct drm_connector *connector, bool force) | |||
851 | enum drm_connector_status ret = connector_status_disconnected; | 872 | enum drm_connector_status ret = connector_status_disconnected; |
852 | bool dret = false; | 873 | bool dret = false; |
853 | 874 | ||
875 | if (!force && radeon_check_hpd_status_unchanged(connector)) | ||
876 | return connector->status; | ||
877 | |||
854 | if (radeon_connector->ddc_bus) | 878 | if (radeon_connector->ddc_bus) |
855 | dret = radeon_ddc_probe(radeon_connector); | 879 | dret = radeon_ddc_probe(radeon_connector); |
856 | if (dret) { | 880 | if (dret) { |
@@ -1254,6 +1278,9 @@ radeon_dp_detect(struct drm_connector *connector, bool force) | |||
1254 | struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; | 1278 | struct radeon_connector_atom_dig *radeon_dig_connector = radeon_connector->con_priv; |
1255 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); | 1279 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); |
1256 | 1280 | ||
1281 | if (!force && radeon_check_hpd_status_unchanged(connector)) | ||
1282 | return connector->status; | ||
1283 | |||
1257 | if (radeon_connector->edid) { | 1284 | if (radeon_connector->edid) { |
1258 | kfree(radeon_connector->edid); | 1285 | kfree(radeon_connector->edid); |
1259 | radeon_connector->edid = NULL; | 1286 | radeon_connector->edid = NULL; |