aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_connectors.c
diff options
context:
space:
mode:
authorTvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>2012-03-16 12:22:11 -0400
committerDave Airlie <airlied@redhat.com>2012-03-20 04:45:42 -0400
commit11fe1266253a96c4d4ac9c07918372a98248c62e (patch)
tree7cda1dbdfb3a25ddd8587d55aea44477c8d024de /drivers/gpu/drm/radeon/radeon_connectors.c
parent4c1b2d2da3451f5c8dd59bd7e05bd9729d2aee05 (diff)
drm/radeon/kms: reduce probe latency on digital connectors
On a system with one HDMI and one VGA connector the latter causes output polling to run every ten seconds. This causes full EDID re-fetch on every poll and approx. 100ms rendering stalls are experienced by full screen page-flipping applications. Optimisation is to trust HPD sense on R600+ ASICs and to skip doing these expensive probes unless HPD sense has changed. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=47007 agd5f: fix patch and message formatting. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_connectors.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_connectors.c27
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
830static 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;