Commit b4329a01 authored by Pankaj Bharadiya's avatar Pankaj Bharadiya Committed by Jani Nikula

drm/i915/display/sdvo: Make WARN* drm specific where drm_priv ptr is available

drm specific WARN* calls include device information in the
backtrace, so we know what device the warnings originate from.

Covert all the calls of WARN* with device specific drm_WARN*
variants in functions where drm_i915_private struct pointer is readily
available.

The conversion was done automatically with below coccinelle semantic
patch.

@rule1@
identifier func, T;
@@
func(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-WARN(
+drm_WARN(&T->drm,
...)
|
-WARN_ON(
+drm_WARN_ON(&T->drm,
...)
|
-WARN_ONCE(
+drm_WARN_ONCE(&T->drm,
...)
|
-WARN_ON_ONCE(
+drm_WARN_ON_ONCE(&T->drm,
...)
)
...+>
}

@rule2@
identifier func, T;
@@
func(struct drm_i915_private *T,...) {
<+...
(
-WARN(
+drm_WARN(&T->drm,
...)
|
-WARN_ON(
+drm_WARN_ON(&T->drm,
...)
|
-WARN_ONCE(
+drm_WARN_ONCE(&T->drm,
...)
|
-WARN_ON_ONCE(
+drm_WARN_ON_ONCE(&T->drm,
...)
)
...+>
}
Signed-off-by: default avatarPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200128181603.27767-18-pankaj.laxminarayan.bharadiya@intel.com
parent 16c56083
...@@ -1506,7 +1506,8 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder, ...@@ -1506,7 +1506,8 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
switch (crtc_state->pixel_multiplier) { switch (crtc_state->pixel_multiplier) {
default: default:
WARN(1, "unknown pixel multiplier specified\n"); drm_WARN(&dev_priv->drm, 1,
"unknown pixel multiplier specified\n");
/* fall through */ /* fall through */
case 1: rate = SDVO_CLOCK_RATE_MULT_1X; break; case 1: rate = SDVO_CLOCK_RATE_MULT_1X; break;
case 2: rate = SDVO_CLOCK_RATE_MULT_2X; break; case 2: rate = SDVO_CLOCK_RATE_MULT_2X; break;
...@@ -1674,7 +1675,8 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, ...@@ -1674,7 +1675,8 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
} }
} }
WARN(encoder_pixel_multiplier != pipe_config->pixel_multiplier, drm_WARN(dev,
encoder_pixel_multiplier != pipe_config->pixel_multiplier,
"SDVO pixel multiplier mismatch, port: %i, encoder: %i\n", "SDVO pixel multiplier mismatch, port: %i, encoder: %i\n",
pipe_config->pixel_multiplier, encoder_pixel_multiplier); pipe_config->pixel_multiplier, encoder_pixel_multiplier);
...@@ -3236,9 +3238,9 @@ static void assert_sdvo_port_valid(const struct drm_i915_private *dev_priv, ...@@ -3236,9 +3238,9 @@ static void assert_sdvo_port_valid(const struct drm_i915_private *dev_priv,
enum port port) enum port port)
{ {
if (HAS_PCH_SPLIT(dev_priv)) if (HAS_PCH_SPLIT(dev_priv))
WARN_ON(port != PORT_B); drm_WARN_ON(&dev_priv->drm, port != PORT_B);
else else
WARN_ON(port != PORT_B && port != PORT_C); drm_WARN_ON(&dev_priv->drm, port != PORT_B && port != PORT_C);
} }
bool intel_sdvo_init(struct drm_i915_private *dev_priv, bool intel_sdvo_init(struct drm_i915_private *dev_priv,
......
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