as it helps with bug triaging. Suggested-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Signed-off-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gpu_error.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 0f00e58..c0ae57c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -339,6 +339,7 @@ struct drm_i915_error_state { struct timeval time; char error_msg[128]; + char module_params_msg[1024]; u32 reset_count; u32 suspend_count; diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 89a2f3d..c5e55b3 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -342,6 +342,7 @@ int i915_error_state_to_str(struct drm_i915_error_state_buf *m, err_printf(m, "Time: %ld s %ld us\n", error->time.tv_sec, error->time.tv_usec); err_printf(m, "Kernel: " UTS_RELEASE "\n"); + err_printf(m, "Module params: %s\n", error->module_params_msg); max_hangcheck_score = 0; for (i = 0; i < ARRAY_SIZE(error->ring); i++) { if (error->ring[i].hangcheck_score > max_hangcheck_score) @@ -1258,6 +1259,34 @@ static void i915_error_capture_msg(struct drm_device *dev, wedged ? "reset" : "continue"); } +static void i915_error_capture_module_params(struct drm_i915_error_state *error) +{ + const struct module *m = THIS_MODULE; + int i, len; + char *buf; + + if (!m) + return; + + buf = kmalloc(4096, GFP_ATOMIC); + if (buf == NULL) + return; + + for (i = 0, len = 0; i < m->num_kp; i++) { + if (!m->kp[i].ops || !m->kp[i].ops->get || + m->kp[i].ops->get(buf, &m->kp[i]) <= 0) + continue; + + len += scnprintf(error->module_params_msg + len, + sizeof(error->module_params_msg) - len, + "%s=%s ", + m->kp[i].name, + buf); + } + + kfree(buf); +} + static void i915_capture_gen_state(struct drm_i915_private *dev_priv, struct drm_i915_error_state *error) { @@ -1303,7 +1332,10 @@ void i915_capture_error_state(struct drm_device *dev, bool wedged, error->display = intel_display_capture_error_state(dev); i915_error_capture_msg(dev, error, wedged, error_msg); + i915_error_capture_module_params(error); + DRM_INFO("%s\n", error->error_msg); + DRM_INFO("%s\n", error->module_params_msg); spin_lock_irqsave(&dev_priv->gpu_error.lock, flags); if (dev_priv->gpu_error.first_error == NULL) { -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx