[Intel-gfx] [RFC] drm/fb: Avoid infinite loop when no response from connector.

Tomasz Lis tomasz.lis at intel.com
Fri Feb 17 10:17:46 UTC 2017


This fixes an old patch so it doesn't cause infinite retries:
  drm/fb: add support for tiled monitor configurations.

The max count of iterations, 0xa10070f, was carefully selected based on the fact
that it looks cool.
---
 drivers/gpu/drm/drm_fb_helper.c    | 4 +++-
 drivers/gpu/drm/i915/intel_fbdev.c | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 0dd5da8..8e6c535 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -2011,7 +2011,9 @@ static bool drm_target_preferred(struct drm_fb_helper *fb_helper,
 
 	if ((conn_configured & mask) != mask) {
 		tile_pass++;
-		goto retry;
+		if (tile_pass < 0xa10070f)
+			goto retry;
+		DRM_ERROR("Max connector check retry count exceeded\n");
 	}
 	return true;
 }
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index bc65ecf..2fd0f09 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -498,7 +498,10 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
 
 	if (count > 0 && (conn_configured & mask) != mask) {
 		pass++;
-		goto retry;
+		if (pass < 0xa10070f)
+			goto retry;
+		DRM_ERROR("Max connector check retry count exceeded\n");
+		goto bail;
 	}
 
 	/*
-- 
2.7.4



More information about the Intel-gfx mailing list