Commit bdbf43d7 authored by Jani Nikula's avatar Jani Nikula

drm/i915: use drm_debug_enabled() to check for debug categories

Allow better abstraction of the drm_debug global variable in the
future. No functional changes.
Reviewed-by: default avatarEric Engestrom <eric@engestrom.ch>
Acked-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: default avatarSean Paul <sean@poorly.run>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e94fe4977c5b8cac68556318be81f8e422e973fd.1572258936.git.jani.nikula@intel.com
parent db9cd76d
...@@ -12213,7 +12213,7 @@ static void ...@@ -12213,7 +12213,7 @@ static void
intel_dump_infoframe(struct drm_i915_private *dev_priv, intel_dump_infoframe(struct drm_i915_private *dev_priv,
const union hdmi_infoframe *frame) const union hdmi_infoframe *frame)
{ {
if ((drm_debug & DRM_UT_KMS) == 0) if (!drm_debug_enabled(DRM_UT_KMS))
return; return;
hdmi_infoframe_log(KERN_DEBUG, dev_priv->drm.dev, frame); hdmi_infoframe_log(KERN_DEBUG, dev_priv->drm.dev, frame);
...@@ -12745,7 +12745,7 @@ pipe_config_infoframe_mismatch(struct drm_i915_private *dev_priv, ...@@ -12745,7 +12745,7 @@ pipe_config_infoframe_mismatch(struct drm_i915_private *dev_priv,
const union hdmi_infoframe *b) const union hdmi_infoframe *b)
{ {
if (fastset) { if (fastset) {
if ((drm_debug & DRM_UT_KMS) == 0) if (!drm_debug_enabled(DRM_UT_KMS))
return; return;
DRM_DEBUG_KMS("fastset mismatch in %s infoframe\n", name); DRM_DEBUG_KMS("fastset mismatch in %s infoframe\n", name);
......
...@@ -1808,7 +1808,7 @@ static void intel_dp_print_rates(struct intel_dp *intel_dp) ...@@ -1808,7 +1808,7 @@ static void intel_dp_print_rates(struct intel_dp *intel_dp)
{ {
char str[128]; /* FIXME: too big for stack? */ char str[128]; /* FIXME: too big for stack? */
if ((drm_debug & DRM_UT_KMS) == 0) if (!drm_debug_enabled(DRM_UT_KMS))
return; return;
snprintf_int_array(str, sizeof(str), snprintf_int_array(str, sizeof(str),
......
...@@ -1382,7 +1382,7 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv) ...@@ -1382,7 +1382,7 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv)
static void i915_welcome_messages(struct drm_i915_private *dev_priv) static void i915_welcome_messages(struct drm_i915_private *dev_priv)
{ {
if (drm_debug & DRM_UT_DRIVER) { if (drm_debug_enabled(DRM_UT_DRIVER)) {
struct drm_printer p = drm_debug_printer("i915 device info:"); struct drm_printer p = drm_debug_printer("i915 device info:");
drm_printf(&p, "pciid=0x%04x rev=0x%02x platform=%s (subplatform=0x%x) gen=%i\n", drm_printf(&p, "pciid=0x%04x rev=0x%02x platform=%s (subplatform=0x%x) gen=%i\n",
......
...@@ -34,7 +34,7 @@ struct drm_i915_private; ...@@ -34,7 +34,7 @@ struct drm_i915_private;
#ifdef CONFIG_DRM_I915_DEBUG_GEM #ifdef CONFIG_DRM_I915_DEBUG_GEM
#define GEM_SHOW_DEBUG() (drm_debug & DRM_UT_DRIVER) #define GEM_SHOW_DEBUG() drm_debug_enabled(DRM_UT_DRIVER)
#define GEM_BUG_ON(condition) do { if (unlikely((condition))) { \ #define GEM_BUG_ON(condition) do { if (unlikely((condition))) { \
GEM_TRACE_ERR("%s:%d GEM_BUG_ON(%s)\n", \ GEM_TRACE_ERR("%s:%d GEM_BUG_ON(%s)\n", \
......
...@@ -23,7 +23,7 @@ __i915_printk(struct drm_i915_private *dev_priv, const char *level, ...@@ -23,7 +23,7 @@ __i915_printk(struct drm_i915_private *dev_priv, const char *level,
struct va_format vaf; struct va_format vaf;
va_list args; va_list args;
if (is_debug && !(drm_debug & DRM_UT_DRIVER)) if (is_debug && !drm_debug_enabled(DRM_UT_DRIVER))
return; return;
va_start(args, fmt); va_start(args, fmt);
......
...@@ -5307,7 +5307,7 @@ skl_print_wm_changes(struct intel_atomic_state *state) ...@@ -5307,7 +5307,7 @@ skl_print_wm_changes(struct intel_atomic_state *state)
struct intel_crtc *crtc; struct intel_crtc *crtc;
int i; int i;
if ((drm_debug & DRM_UT_KMS) == 0) if (!drm_debug_enabled(DRM_UT_KMS))
return; return;
for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state, for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment