]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/display/icl_dsi: Make WARN* drm specific where drm_priv ptr is available
authorPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Tue, 28 Jan 2020 18:15:43 +0000 (23:45 +0530)
committerJani Nikula <jani.nikula@intel.com>
Sun, 2 Feb 2020 12:30:23 +0000 (14:30 +0200)
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: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200128181603.27767-2-pankaj.laxminarayan.bharadiya@intel.com
drivers/gpu/drm/i915/display/icl_dsi.c

index 76e9ebe499f3d92dc240bbff103d68f3c43bbd11..d0f7419fb02b5e7e01a542889d587baab36fdd79 100644 (file)
@@ -354,7 +354,7 @@ static void get_dsi_io_power_domains(struct drm_i915_private *dev_priv,
        enum port port;
 
        for_each_dsi_port(port, intel_dsi->ports) {
-               WARN_ON(intel_dsi->io_wakeref[port]);
+               drm_WARN_ON(&dev_priv->drm, intel_dsi->io_wakeref[port]);
                intel_dsi->io_wakeref[port] =
                        intel_display_power_get(dev_priv,
                                                port == PORT_A ?
@@ -1396,11 +1396,13 @@ static int gen11_dsi_dsc_compute_config(struct intel_encoder *encoder,
                return ret;
 
        /* DSI specific sanity checks on the common code */
-       WARN_ON(vdsc_cfg->vbr_enable);
-       WARN_ON(vdsc_cfg->simple_422);
-       WARN_ON(vdsc_cfg->pic_width % vdsc_cfg->slice_width);
-       WARN_ON(vdsc_cfg->slice_height < 8);
-       WARN_ON(vdsc_cfg->pic_height % vdsc_cfg->slice_height);
+       drm_WARN_ON(&dev_priv->drm, vdsc_cfg->vbr_enable);
+       drm_WARN_ON(&dev_priv->drm, vdsc_cfg->simple_422);
+       drm_WARN_ON(&dev_priv->drm,
+                   vdsc_cfg->pic_width % vdsc_cfg->slice_width);
+       drm_WARN_ON(&dev_priv->drm, vdsc_cfg->slice_height < 8);
+       drm_WARN_ON(&dev_priv->drm,
+                   vdsc_cfg->pic_height % vdsc_cfg->slice_height);
 
        ret = drm_dsc_compute_rc_parameters(vdsc_cfg);
        if (ret)