aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2014-12-15 13:56:32 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-16 04:39:13 -0500
commite2c719b75c8c186deb86570d8466df9e9eff919b (patch)
tree8caf669cdc0e7bb30625f2f1055bfa5ea9b82eb1 /drivers/gpu/drm/i915/i915_drv.h
parente6c1abb7392f548f47b03dac6179916cd87f501e (diff)
drm/i915: tame the chattermouth (v2)
Many distro's have mechanism in place to collect and automatically file bugs for failed WARN()s. And since i915 has a lot of hw state sanity checks which result in WARN(), it generates quite a lot of noise which is somewhat disconcerting to the end user. Separate out the internal hw-is-in-the-state-I-expected checks into I915_STATE_WARN()s and allow configuration via i915.verbose_checks module param about whether this will generate a full blown stacktrace or just DRM_ERROR(). The new moduleparam defaults to true, so by default there is no change in behavior. And even when disabled, you will still get an error message logged. v2: paint the macro names blue, clarify that the default behavior remains the same as before Signed-off-by: Rob Clark <robdclark@gmail.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index eb4d64fecf8a..f3185293bed1 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -72,6 +72,35 @@
72#define MISSING_CASE(x) WARN(1, "Missing switch case (%lu) in %s\n", \ 72#define MISSING_CASE(x) WARN(1, "Missing switch case (%lu) in %s\n", \
73 (long) (x), __func__); 73 (long) (x), __func__);
74 74
75/* Use I915_STATE_WARN(x) and I915_STATE_WARN_ON() (rather than WARN() and
76 * WARN_ON()) for hw state sanity checks to check for unexpected conditions
77 * which may not necessarily be a user visible problem. This will either
78 * WARN() or DRM_ERROR() depending on the verbose_checks moduleparam, to
79 * enable distros and users to tailor their preferred amount of i915 abrt
80 * spam.
81 */
82#define I915_STATE_WARN(condition, format...) ({ \
83 int __ret_warn_on = !!(condition); \
84 if (unlikely(__ret_warn_on)) { \
85 if (i915.verbose_state_checks) \
86 __WARN_printf(format); \
87 else \
88 DRM_ERROR(format); \
89 } \
90 unlikely(__ret_warn_on); \
91})
92
93#define I915_STATE_WARN_ON(condition) ({ \
94 int __ret_warn_on = !!(condition); \
95 if (unlikely(__ret_warn_on)) { \
96 if (i915.verbose_state_checks) \
97 __WARN_printf("WARN_ON(" #condition ")\n"); \
98 else \
99 DRM_ERROR("WARN_ON(" #condition ")\n"); \
100 } \
101 unlikely(__ret_warn_on); \
102})
103
75enum pipe { 104enum pipe {
76 INVALID_PIPE = -1, 105 INVALID_PIPE = -1,
77 PIPE_A = 0, 106 PIPE_A = 0,
@@ -2401,6 +2430,7 @@ struct i915_params {
2401 bool disable_vtd_wa; 2430 bool disable_vtd_wa;
2402 int use_mmio_flip; 2431 int use_mmio_flip;
2403 bool mmio_debug; 2432 bool mmio_debug;
2433 bool verbose_state_checks;
2404}; 2434};
2405extern struct i915_params i915 __read_mostly; 2435extern struct i915_params i915 __read_mostly;
2406 2436