Commit 654c90c6 authored by Ben Widawsky's avatar Ben Widawsky Committed by Daniel Vetter

drm/i915: Logically reorder error register capture

Create logical sections in an attempt to clean up, and continue to keep
future additions clean.

v2: Reworded the comments. Added section headers (Chris)
Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 1d762aad
...@@ -985,41 +985,54 @@ static void i915_capture_reg_state(struct drm_i915_private *dev_priv, ...@@ -985,41 +985,54 @@ static void i915_capture_reg_state(struct drm_i915_private *dev_priv,
struct drm_device *dev = dev_priv->dev; struct drm_device *dev = dev_priv->dev;
int pipe; int pipe;
error->eir = I915_READ(EIR); /* General organization
error->pgtbl_er = I915_READ(PGTBL_ER); * 1. Registers specific to a single generation
if (HAS_HW_CONTEXTS(dev)) * 2. Registers which belong to multiple generations
error->ccid = I915_READ(CCID); * 3. Feature specific registers.
* 4. Everything else
* Please try to follow the order.
*/
if (HAS_PCH_SPLIT(dev)) /* 1: Registers specific to a single generation */
error->ier = I915_READ(DEIER) | I915_READ(GTIER); if (IS_VALLEYVIEW(dev)) {
else if (IS_VALLEYVIEW(dev))
error->ier = I915_READ(GTIER) | I915_READ(VLV_IER); error->ier = I915_READ(GTIER) | I915_READ(VLV_IER);
else if (IS_GEN2(dev)) error->forcewake = I915_READ(FORCEWAKE_VLV);
error->ier = I915_READ16(IER); }
else
error->ier = I915_READ(IER);
if (INTEL_INFO(dev)->gen >= 6) if (IS_GEN7(dev))
error->derrmr = I915_READ(DERRMR); error->err_int = I915_READ(GEN7_ERR_INT);
if (IS_VALLEYVIEW(dev)) if (IS_GEN6(dev))
error->forcewake = I915_READ(FORCEWAKE_VLV);
else if (INTEL_INFO(dev)->gen >= 7)
error->forcewake = I915_READ(FORCEWAKE_MT);
else if (INTEL_INFO(dev)->gen == 6)
error->forcewake = I915_READ(FORCEWAKE); error->forcewake = I915_READ(FORCEWAKE);
if (!HAS_PCH_SPLIT(dev)) if (IS_GEN2(dev))
for_each_pipe(pipe) error->ier = I915_READ16(IER);
error->pipestat[pipe] = I915_READ(PIPESTAT(pipe));
/* 2: Registers which belong to multiple generations */
if (INTEL_INFO(dev)->gen >= 7)
error->forcewake = I915_READ(FORCEWAKE_MT);
if (INTEL_INFO(dev)->gen >= 6) { if (INTEL_INFO(dev)->gen >= 6) {
error->derrmr = I915_READ(DERRMR);
error->error = I915_READ(ERROR_GEN6); error->error = I915_READ(ERROR_GEN6);
error->done_reg = I915_READ(DONE_REG); error->done_reg = I915_READ(DONE_REG);
} }
if (INTEL_INFO(dev)->gen == 7) /* 3: Feature specific registers */
error->err_int = I915_READ(GEN7_ERR_INT); if (HAS_HW_CONTEXTS(dev))
error->ccid = I915_READ(CCID);
if (HAS_PCH_SPLIT(dev))
error->ier = I915_READ(DEIER) | I915_READ(GTIER);
else {
error->ier = I915_READ(IER);
for_each_pipe(pipe)
error->pipestat[pipe] = I915_READ(PIPESTAT(pipe));
}
/* 4: Everything else */
error->eir = I915_READ(EIR);
error->pgtbl_er = I915_READ(PGTBL_ER);
i915_get_extra_instdone(dev, error->extra_instdone); i915_get_extra_instdone(dev, error->extra_instdone);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment