intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Lis <tomasz.lis@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [RFC] drm/fb: Avoid infinite loop when no response from connector.
Date: Fri, 17 Feb 2017 11:17:46 +0100	[thread overview]
Message-ID: <1487326666-15789-2-git-send-email-tomasz.lis@intel.com> (raw)
In-Reply-To: <1487326666-15789-1-git-send-email-tomasz.lis@intel.com>

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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-17 10:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 10:17 [PATCH] drm/fb: Proper support of boundary conditions in bitmasks Tomasz Lis
2017-02-17 10:17 ` Tomasz Lis [this message]
2017-02-17 12:40   ` [RFC] drm/fb: Avoid infinite loop when no response from connector Arkadiusz Hiler
2017-02-17 12:53     ` Chris Wilson
2017-02-18 15:37   ` [PATCH] drm/i915/fbdev: Stop repeating tile configuration on stagnation Chris Wilson
2017-02-20 15:37     ` Tomasz Lis
2017-02-20 15:46       ` Chris Wilson
2017-02-24 10:38         ` Tomasz Lis
2017-02-17 12:45 ` [PATCH] drm/fb: Proper support of boundary conditions in bitmasks Arkadiusz Hiler
2017-02-18 16:22 ` ✓ Fi.CI.BAT: success for drm/fb: Proper support of boundary conditions in bitmasks. (rev4) Patchwork
2017-02-20  8:00 ` [PATCH] drm/fb: Proper support of boundary conditions in bitmasks Jani Nikula
2017-02-21 15:04   ` Joonas Lahtinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487326666-15789-2-git-send-email-tomasz.lis@intel.com \
    --to=tomasz.lis@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).