drm/i915: Collect gtier properly on HSW.
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 1 Aug 2014 16:12:27 +0000 (09:12 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 7 Aug 2014 09:07:20 +0000 (11:07 +0200)
GTIER and DEIER doesn't have same interface on HSW so this "or" operation
makes the information provided useless.

v2: since we have gtier variable already let's split for everybody
and avoid the strange | op.
    Also avoid overriding the value that was set for vlv. In this case I
    believe that we should reorganize the whole function, but I'll respect
    the comment that ask to not touch the order and let this organization
    work to be done later.
v3: moving VLV check to the right place.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
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 ef38c3bc8e4d002582a597c26ad28c236a5adb22..ccb97f1f8660139751a2c3217d9fbbd75933cbae 100644 (file)
@@ -314,6 +314,7 @@ struct drm_i915_error_state {
        u32 eir;
        u32 pgtbl_er;
        u32 ier;
+       u32 gtier;
        u32 ccid;
        u32 derrmr;
        u32 forcewake;
index 0ea6a6b9bb4cce4c13d7109128ca2cde2d761901..0c945e91d5429725756f64859bd808e8e0faaba1 100644 (file)
@@ -359,6 +359,8 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
        err_printf(m, "PCI ID: 0x%04x\n", dev->pdev->device);
        err_printf(m, "EIR: 0x%08x\n", error->eir);
        err_printf(m, "IER: 0x%08x\n", error->ier);
+       if (HAS_PCH_SPLIT(dev) || IS_VALLEYVIEW(dev))
+               err_printf(m, "GTIER: 0x%08x\n", error->gtier);
        err_printf(m, "PGTBL_ER: 0x%08x\n", error->pgtbl_er);
        err_printf(m, "FORCEWAKE: 0x%08x\n", error->forcewake);
        err_printf(m, "DERRMR: 0x%08x\n", error->derrmr);
@@ -1103,7 +1105,8 @@ static void i915_capture_reg_state(struct drm_i915_private *dev_priv,
 
        /* 1: Registers specific to a single generation */
        if (IS_VALLEYVIEW(dev)) {
-               error->ier = I915_READ(GTIER) | I915_READ(VLV_IER);
+               error->gtier = I915_READ(GTIER);
+               error->ier = I915_READ(VLV_IER);
                error->forcewake = I915_READ(FORCEWAKE_VLV);
        }
 
@@ -1136,16 +1139,14 @@ static void i915_capture_reg_state(struct drm_i915_private *dev_priv,
        if (HAS_HW_CONTEXTS(dev))
                error->ccid = I915_READ(CCID);
 
-       if (HAS_PCH_SPLIT(dev))
-               error->ier = I915_READ(DEIER) | I915_READ(GTIER);
-       else {
-               if (IS_GEN2(dev))
-                       error->ier = I915_READ16(IER);
-               else
-                       error->ier = I915_READ(IER);
+       if (HAS_PCH_SPLIT(dev)) {
+               error->ier = I915_READ(DEIER);
+               error->gtier = I915_READ(GTIER);
+       } else if (IS_GEN2(dev)) {
+               error->ier = I915_READ16(IER);
+       } else if (!IS_VALLEYVIEW(dev)) {
+               error->ier = I915_READ(IER);
        }
-
-       /* 4: Everything else */
        error->eir = I915_READ(EIR);
        error->pgtbl_er = I915_READ(PGTBL_ER);