drm/i915: Add some more registers to error state
authorBen Widawsky <benjamin.widawsky@intel.com>
Thu, 30 Jan 2014 08:19:39 +0000 (00:19 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 30 Jan 2014 12:00:24 +0000 (13:00 +0100)
Chris:
Do we also want to capture?
  GAC_ECO_BITS /* gen6,7 */
  GAM_ECOCHK /* gen6,7 */
  GAB_CTL /* gen6 */
  GFX_MODE /* gen6 */

Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gpu_error.c

index 50229988a9d9c04dd3a284508e9301740639d8a6..34ff995e6ea35d834f52e9d6236bf774c071d59a 100644 (file)
@@ -307,6 +307,10 @@ struct drm_i915_error_state {
        u32 error; /* gen6+ */
        u32 err_int; /* gen7 */
        u32 done_reg;
+       u32 gac_eco;
+       u32 gam_ecochk;
+       u32 gab_ctl;
+       u32 gfx_mode;
        u32 extra_instdone[I915_NUM_INSTDONE_REG];
        u32 pipestat[I915_MAX_PIPES];
        u64 fence[I915_MAX_NUM_FENCES];
index 58ef6d80b569f78620430ca72e718b926331e9d4..70a7cd77afb29338f8db6f61ba8be41505b3a6d7 100644 (file)
@@ -1001,8 +1001,11 @@ static void i915_capture_reg_state(struct drm_i915_private *dev_priv,
        if (IS_GEN7(dev))
                error->err_int = I915_READ(GEN7_ERR_INT);
 
-       if (IS_GEN6(dev))
+       if (IS_GEN6(dev)) {
                error->forcewake = I915_READ(FORCEWAKE);
+               error->gab_ctl = I915_READ(GAB_CTL);
+               error->gfx_mode = I915_READ(GFX_MODE);
+       }
 
        if (IS_GEN2(dev))
                error->ier = I915_READ16(IER);
@@ -1018,6 +1021,12 @@ static void i915_capture_reg_state(struct drm_i915_private *dev_priv,
        }
 
        /* 3: Feature specific registers */
+       if (IS_GEN6(dev) || IS_GEN7(dev)) {
+               error->gam_ecochk = I915_READ(GAM_ECOCHK);
+               error->gac_eco = I915_READ(GAC_ECO_BITS);
+       }
+
+       /* 4: Everything else */
        if (HAS_HW_CONTEXTS(dev))
                error->ccid = I915_READ(CCID);