drm/i915: Add suspend count to error state
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Tue, 25 Feb 2014 15:11:28 +0000 (17:11 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 5 Mar 2014 20:30:27 +0000 (21:30 +0100)
For example if we get bug reports with similar error states and
suspend count is always 1, that might lead the Sherlocks to
right general direction.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gpu_error.c

index 70a4c9bb7b809b13fd3d7a5b746d9adbdfc97907..a50292c0423fb97b5095fa75f6a03db09eb59d4d 100644 (file)
@@ -479,6 +479,8 @@ static int i915_drm_freeze(struct drm_device *dev)
        intel_fbdev_set_suspend(dev, FBINFO_STATE_SUSPENDED);
        console_unlock();
 
+       dev_priv->suspend_count++;
+
        return 0;
 }
 
index a6429cc93d1a13d510ff2b240d29436ed508901a..e33f6a7639602a1fd742e34444bff1b17f07b498 100644 (file)
@@ -305,6 +305,7 @@ struct drm_i915_error_state {
 
        char error_msg[128];
        u32 reset_count;
+       u32 suspend_count;
 
        /* Generic register state */
        u32 eir;
@@ -1606,6 +1607,8 @@ typedef struct drm_i915_private {
        struct i915_dri1_state dri1;
        /* Old ums support infrastructure, same warning applies. */
        struct i915_ums_state ums;
+
+       u32 suspend_count;
 } drm_i915_private_t;
 
 static inline struct drm_i915_private *to_i915(const struct drm_device *dev)
index 353f0770da8f7f07219c265f478cc719bab599e1..ce2dd608968c92b4a07e350dce77cdd4cd763583 100644 (file)
@@ -348,6 +348,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m,
                }
        }
        err_printf(m, "Reset count: %u\n", error->reset_count);
+       err_printf(m, "Suspend count: %u\n", error->suspend_count);
        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);
@@ -1125,6 +1126,7 @@ static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
                                   struct drm_i915_error_state *error)
 {
        error->reset_count = i915_reset_count(&dev_priv->gpu_error);
+       error->suspend_count = dev_priv->suspend_count;
 }
 
 /**