From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>, stable@vger.kernel.org
Subject: [PATCH] drm/i915: Read the hardware state for the transcoder link upon error
Date: Fri, 21 Jun 2013 15:40:04 +0100 [thread overview]
Message-ID: <1371825604-8728-1-git-send-email-chris@chris-wilson.co.uk> (raw)
Do not trust our bookkeeping when reporting errors, and instead dump the
register contents. In particular, this solves one particular issue when
an error is reported before we finish setting up the outputs and have a
complete mapping (i.e. during initialisation we set garbage state). If
an error occurs at that early stage, it is vital that we get an accurate
report of the hardware state and not conflated with our own inaccurate
opinions.
This fixes a panic for a large number of pre-Haswell machines that
currently trigger an error during KMS takeover.
Reported-by: Dustin King <daking@rescomp.stanford.edu>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60021
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
---
drivers/gpu/drm/i915/intel_display.c | 37 ++++++++++++++++++++++++++++++++++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5988bda..7ce4588 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10273,12 +10273,43 @@ struct intel_display_error_state {
} plane[I915_MAX_PIPES];
};
+static enum transcoder
+read_cpu_transcoder(struct drm_i915_private *dev_priv, int pipe)
+{
+ if (HAS_DDI(dev_priv->dev)) {
+ int edp_pipe;
+
+ switch (I915_READ(TRANS_DDI_FUNC_CTL(TRANSCODER_EDP)) & (TRANS_DDI_FUNC_ENABLE | TRANS_DDI_EDP_INPUT_MASK)) {
+ default:
+ edp_pipe = -1;
+ break;
+
+ case TRANS_DDI_EDP_INPUT_A_ONOFF | TRANS_DDI_FUNC_ENABLE:
+ case TRANS_DDI_EDP_INPUT_A_ON | TRANS_DDI_FUNC_ENABLE:
+ edp_pipe = PIPE_A;
+ break;
+
+ case TRANS_DDI_EDP_INPUT_B_ONOFF | TRANS_DDI_FUNC_ENABLE:
+ edp_pipe = PIPE_B;
+ break;
+
+ case TRANS_DDI_EDP_INPUT_C_ONOFF | TRANS_DDI_FUNC_ENABLE:
+ edp_pipe = PIPE_C;
+ break;
+ }
+
+ if (edp_pipe == pipe)
+ pipe = TRANSCODER_EDP;
+ }
+
+ return pipe;
+}
+
struct intel_display_error_state *
intel_display_capture_error_state(struct drm_device *dev)
{
drm_i915_private_t *dev_priv = dev->dev_private;
struct intel_display_error_state *error;
- enum transcoder cpu_transcoder;
int i;
error = kmalloc(sizeof(*error), GFP_ATOMIC);
@@ -10289,7 +10320,9 @@ intel_display_capture_error_state(struct drm_device *dev)
error->power_well_driver = I915_READ(HSW_PWR_WELL_DRIVER);
for_each_pipe(i) {
- cpu_transcoder = intel_pipe_to_cpu_transcoder(dev_priv, i);
+ enum transcoder cpu_transcoder;
+
+ cpu_transcoder = read_cpu_transcoder(dev_priv, i);
error->pipe[i].cpu_transcoder = cpu_transcoder;
if (INTEL_INFO(dev)->gen <= 6 || IS_VALLEYVIEW(dev)) {
--
1.8.3.1
next reply other threads:[~2013-06-21 14:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-21 14:40 Chris Wilson [this message]
2013-06-24 7:59 ` [Intel-gfx] [PATCH] drm/i915: Read the hardware state for the transcoder link upon error Daniel Vetter
2013-06-25 7:03 ` Chris Wilson
2013-06-25 7:15 ` [PATCH] drm/i915: Dump all transcoder registers on error Chris Wilson
2013-06-25 12:43 ` Daniel Vetter
2013-08-08 12:37 ` Daniel Vetter
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=1371825604-8728-1-git-send-email-chris@chris-wilson.co.uk \
--to=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
/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).