drm/i915: move I915_STATE_WARN() and _ON() to intel_display.h
authorJani Nikula <jani.nikula@intel.com>
Thu, 8 Aug 2019 13:42:42 +0000 (16:42 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 9 Aug 2019 08:42:08 +0000 (11:42 +0300)
It's for display. Seems like a better fit. Reduce clutter in i915_drv.h.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/8fefcf69b6dcdb7b9c920aeded35c5f8928b9602.1565271681.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_display.h
drivers/gpu/drm/i915/i915_drv.h

index bf0d7225e649a47dba6ababa716843f7ffad642c..e57e6969051d063681b35490ea8d281dfdb85868 100644 (file)
@@ -571,4 +571,22 @@ void assert_pipe(struct drm_i915_private *dev_priv, enum pipe pipe, bool state);
 #define assert_pipe_enabled(d, p) assert_pipe(d, p, true)
 #define assert_pipe_disabled(d, p) assert_pipe(d, p, false)
 
+/* Use I915_STATE_WARN(x) and I915_STATE_WARN_ON() (rather than WARN() and
+ * WARN_ON()) for hw state sanity checks to check for unexpected conditions
+ * which may not necessarily be a user visible problem.  This will either
+ * WARN() or DRM_ERROR() depending on the verbose_checks moduleparam, to
+ * enable distros and users to tailor their preferred amount of i915 abrt
+ * spam.
+ */
+#define I915_STATE_WARN(condition, format...) ({                       \
+       int __ret_warn_on = !!(condition);                              \
+       if (unlikely(__ret_warn_on))                                    \
+               if (!WARN(i915_modparams.verbose_state_checks, format)) \
+                       DRM_ERROR(format);                              \
+       unlikely(__ret_warn_on);                                        \
+})
+
+#define I915_STATE_WARN_ON(x)                                          \
+       I915_STATE_WARN((x), "%s", "WARN_ON(" __stringify(x) ")")
+
 #endif
index 3308ae6202e066cf721188785e92a08ce9d0cf6a..a3e0d97414e31bb61c1d51e7c2b1389aa1662bad 100644 (file)
 #define DRIVER_DATE            "20190730"
 #define DRIVER_TIMESTAMP       1564512624
 
-/* Use I915_STATE_WARN(x) and I915_STATE_WARN_ON() (rather than WARN() and
- * WARN_ON()) for hw state sanity checks to check for unexpected conditions
- * which may not necessarily be a user visible problem.  This will either
- * WARN() or DRM_ERROR() depending on the verbose_checks moduleparam, to
- * enable distros and users to tailor their preferred amount of i915 abrt
- * spam.
- */
-#define I915_STATE_WARN(condition, format...) ({                       \
-       int __ret_warn_on = !!(condition);                              \
-       if (unlikely(__ret_warn_on))                                    \
-               if (!WARN(i915_modparams.verbose_state_checks, format)) \
-                       DRM_ERROR(format);                              \
-       unlikely(__ret_warn_on);                                        \
-})
-
-#define I915_STATE_WARN_ON(x)                                          \
-       I915_STATE_WARN((x), "%s", "WARN_ON(" __stringify(x) ")")
-
 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
 
 int __i915_inject_load_error(struct drm_i915_private *i915, int err,