diff options
author | Wambui Karuga <wambui.karugax@gmail.com> | 2020-01-31 10:34:12 +0100 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2020-02-04 10:29:27 +0100 |
commit | 00376ccfb2a457fcd7041e2d5740faa8a81ab8cb (patch) | |
tree | 8c1454bff3aca708cac7ff52a5cf804c56d17ad0 /drivers/gpu/drm/i915/i915_irq.c | |
parent | drm/i915/panel: automatic conversion to drm_device based logging macros. (diff) | |
download | linux-00376ccfb2a457fcd7041e2d5740faa8a81ab8cb.tar.xz linux-00376ccfb2a457fcd7041e2d5740faa8a81ab8cb.zip |
drm/i915: conversion to drm_device logging macros when drm_i915_private is present.
Converts various instances of the printk drm logging macros to the
struct drm_device based logging macros in the drm/i915 folder using the
following coccinelle script that transforms based on the existence of
the struct drm_i915_private device pointer:
@@
identifier fn, T;
@@
fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
@@
identifier fn, T;
@@
fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}
Checkpatch warnings were fixed manually.
Instances of the DRM_DEBUG macro were not converted due to lack of a
consensus of an analogous struct drm_device based macro.
References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.html
Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200131093416.28431-2-wambui.karugax@gmail.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 92 |
1 files changed, 53 insertions, 39 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 5c2b419c0603..de75bc53dc40 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -788,8 +788,9 @@ bool i915_get_crtc_scanoutpos(struct drm_device *dev, unsigned int index, mode->private_flags & I915_MODE_FLAG_USE_SCANLINE_COUNTER; if (drm_WARN_ON(&dev_priv->drm, !mode->crtc_clock)) { - DRM_DEBUG_DRIVER("trying to get scanoutpos for disabled " - "pipe %c\n", pipe_name(pipe)); + drm_dbg(&dev_priv->drm, + "trying to get scanoutpos for disabled " + "pipe %c\n", pipe_name(pipe)); return false; } @@ -1176,8 +1177,9 @@ static void intel_get_hpd_pins(struct drm_i915_private *dev_priv, *long_mask |= BIT(pin); } - DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x, dig 0x%08x, pins 0x%08x, long 0x%08x\n", - hotplug_trigger, dig_hotplug_reg, *pin_mask, *long_mask); + drm_dbg(&dev_priv->drm, + "hotplug event received, stat 0x%08x, dig 0x%08x, pins 0x%08x, long 0x%08x\n", + hotplug_trigger, dig_hotplug_reg, *pin_mask, *long_mask); } @@ -1718,8 +1720,8 @@ static void ibx_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir) if (pch_iir & SDE_AUDIO_POWER_MASK) { int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> SDE_AUDIO_POWER_SHIFT); - DRM_DEBUG_DRIVER("PCH audio power change on port %d\n", - port_name(port)); + drm_dbg(&dev_priv->drm, "PCH audio power change on port %d\n", + port_name(port)); } if (pch_iir & SDE_AUX_MASK) @@ -1729,25 +1731,26 @@ static void ibx_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir) gmbus_irq_handler(dev_priv); if (pch_iir & SDE_AUDIO_HDCP_MASK) - DRM_DEBUG_DRIVER("PCH HDCP audio interrupt\n"); + drm_dbg(&dev_priv->drm, "PCH HDCP audio interrupt\n"); if (pch_iir & SDE_AUDIO_TRANS_MASK) - DRM_DEBUG_DRIVER("PCH transcoder audio interrupt\n"); + drm_dbg(&dev_priv->drm, "PCH transcoder audio interrupt\n"); if (pch_iir & SDE_POISON) - DRM_ERROR("PCH poison interrupt\n"); + drm_err(&dev_priv->drm, "PCH poison interrupt\n"); if (pch_iir & SDE_FDI_MASK) for_each_pipe(dev_priv, pipe) - DRM_DEBUG_DRIVER(" pipe %c FDI IIR: 0x%08x\n", - pipe_name(pipe), - I915_READ(FDI_RX_IIR(pipe))); + drm_dbg(&dev_priv->drm, " pipe %c FDI IIR: 0x%08x\n", + pipe_name(pipe), + I915_READ(FDI_RX_IIR(pipe))); if (pch_iir & (SDE_TRANSB_CRC_DONE | SDE_TRANSA_CRC_DONE)) - DRM_DEBUG_DRIVER("PCH transcoder CRC done interrupt\n"); + drm_dbg(&dev_priv->drm, "PCH transcoder CRC done interrupt\n"); if (pch_iir & (SDE_TRANSB_CRC_ERR | SDE_TRANSA_CRC_ERR)) - DRM_DEBUG_DRIVER("PCH transcoder CRC error interrupt\n"); + drm_dbg(&dev_priv->drm, + "PCH transcoder CRC error interrupt\n"); if (pch_iir & SDE_TRANSA_FIFO_UNDER) intel_pch_fifo_underrun_irq_handler(dev_priv, PIPE_A); @@ -1762,7 +1765,7 @@ static void ivb_err_int_handler(struct drm_i915_private *dev_priv) enum pipe pipe; if (err_int & ERR_INT_POISON) - DRM_ERROR("Poison interrupt\n"); + drm_err(&dev_priv->drm, "Poison interrupt\n"); for_each_pipe(dev_priv, pipe) { if (err_int & ERR_INT_FIFO_UNDERRUN(pipe)) @@ -1785,7 +1788,7 @@ static void cpt_serr_int_handler(struct drm_i915_private *dev_priv) enum pipe pipe; if (serr_int & SERR_INT_POISON) - DRM_ERROR("PCH poison interrupt\n"); + drm_err(&dev_priv->drm, "PCH poison interrupt\n"); for_each_pipe(dev_priv, pipe) if (serr_int & SERR_INT_TRANS_FIFO_UNDERRUN(pipe)) @@ -1804,8 +1807,8 @@ static void cpt_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir) if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> SDE_AUDIO_POWER_SHIFT_CPT); - DRM_DEBUG_DRIVER("PCH audio power change on port %c\n", - port_name(port)); + drm_dbg(&dev_priv->drm, "PCH audio power change on port %c\n", + port_name(port)); } if (pch_iir & SDE_AUX_MASK_CPT) @@ -1815,16 +1818,16 @@ static void cpt_irq_handler(struct drm_i915_private *dev_priv, u32 pch_iir) gmbus_irq_handler(dev_priv); if (pch_iir & SDE_AUDIO_CP_REQ_CPT) - DRM_DEBUG_DRIVER("Audio CP request interrupt\n"); + drm_dbg(&dev_priv->drm, "Audio CP request interrupt\n"); if (pch_iir & SDE_AUDIO_CP_CHG_CPT) - DRM_DEBUG_DRIVER("Audio CP change interrupt\n"); + drm_dbg(&dev_priv->drm, "Audio CP change interrupt\n"); if (pch_iir & SDE_FDI_MASK_CPT) for_each_pipe(dev_priv, pipe) - DRM_DEBUG_DRIVER(" pipe %c FDI IIR: 0x%08x\n", - pipe_name(pipe), - I915_READ(FDI_RX_IIR(pipe))); + drm_dbg(&dev_priv->drm, " pipe %c FDI IIR: 0x%08x\n", + pipe_name(pipe), + I915_READ(FDI_RX_IIR(pipe))); if (pch_iir & SDE_ERROR_CPT) cpt_serr_int_handler(dev_priv); @@ -1961,7 +1964,7 @@ static void ilk_display_irq_handler(struct drm_i915_private *dev_priv, intel_opregion_asle_intr(dev_priv); if (de_iir & DE_POISON) - DRM_ERROR("Poison interrupt\n"); + drm_err(&dev_priv->drm, "Poison interrupt\n"); for_each_pipe(dev_priv, pipe) { if (de_iir & DE_PIPE_VBLANK(pipe)) @@ -2162,7 +2165,8 @@ static void gen11_hpd_irq_handler(struct drm_i915_private *dev_priv, u32 iir) if (pin_mask) intel_hpd_irq_handler(dev_priv, pin_mask, long_mask); else - DRM_ERROR("Unexpected DE HPD interrupt 0x%08x\n", iir); + drm_err(&dev_priv->drm, + "Unexpected DE HPD interrupt 0x%08x\n", iir); } static u32 gen8_de_port_aux_mask(struct drm_i915_private *dev_priv) @@ -2235,7 +2239,7 @@ gen8_de_misc_irq_handler(struct drm_i915_private *dev_priv, u32 iir) } if (!found) - DRM_ERROR("Unexpected DE Misc interrupt\n"); + drm_err(&dev_priv->drm, "Unexpected DE Misc interrupt\n"); } static irqreturn_t @@ -2252,7 +2256,8 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl) ret = IRQ_HANDLED; gen8_de_misc_irq_handler(dev_priv, iir); } else { - DRM_ERROR("The master control interrupt lied (DE MISC)!\n"); + drm_err(&dev_priv->drm, + "The master control interrupt lied (DE MISC)!\n"); } } @@ -2263,7 +2268,8 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl) ret = IRQ_HANDLED; gen11_hpd_irq_handler(dev_priv, iir); } else { - DRM_ERROR("The master control interrupt lied, (DE HPD)!\n"); + drm_err(&dev_priv->drm, + "The master control interrupt lied, (DE HPD)!\n"); } } @@ -2303,10 +2309,12 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl) } if (!found) - DRM_ERROR("Unexpected DE Port interrupt\n"); + drm_err(&dev_priv->drm, + "Unexpected DE Port interrupt\n"); } else - DRM_ERROR("The master control interrupt lied (DE PORT)!\n"); + drm_err(&dev_priv->drm, + "The master control interrupt lied (DE PORT)!\n"); } for_each_pipe(dev_priv, pipe) { @@ -2317,7 +2325,8 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl) iir = I915_READ(GEN8_DE_PIPE_IIR(pipe)); if (!iir) { - DRM_ERROR("The master control interrupt lied (DE PIPE)!\n"); + drm_err(&dev_priv->drm, + "The master control interrupt lied (DE PIPE)!\n"); continue; } @@ -2335,9 +2344,10 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl) fault_errors = iir & gen8_de_pipe_fault_mask(dev_priv); if (fault_errors) - DRM_ERROR("Fault errors on pipe %c: 0x%08x\n", - pipe_name(pipe), - fault_errors); + drm_err(&dev_priv->drm, + "Fault errors on pipe %c: 0x%08x\n", + pipe_name(pipe), + fault_errors); } if (HAS_PCH_SPLIT(dev_priv) && !HAS_PCH_NOP(dev_priv) && @@ -2363,7 +2373,8 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl) * Like on previous PCH there seems to be something * fishy going on with forwarding PCH interrupts. */ - DRM_DEBUG_DRIVER("The master control interrupt lied (SDE)!\n"); + drm_dbg(&dev_priv->drm, + "The master control interrupt lied (SDE)!\n"); } } @@ -3169,8 +3180,9 @@ static void __bxt_hpd_detection_setup(struct drm_i915_private *dev_priv, PORTB_HOTPLUG_ENABLE | PORTC_HOTPLUG_ENABLE; - DRM_DEBUG_KMS("Invert bit setting: hp_ctl:%x hp_port:%x\n", - hotplug, enabled_irqs); + drm_dbg_kms(&dev_priv->drm, + "Invert bit setting: hp_ctl:%x hp_port:%x\n", + hotplug, enabled_irqs); hotplug &= ~BXT_DDI_HPD_INVERT_MASK; /* @@ -3553,7 +3565,8 @@ static void i8xx_error_irq_handler(struct drm_i915_private *dev_priv, DRM_DEBUG("Master Error: EIR 0x%04x\n", eir); if (eir_stuck) - DRM_DEBUG_DRIVER("EIR stuck: 0x%04x, masked\n", eir_stuck); + drm_dbg(&dev_priv->drm, "EIR stuck: 0x%04x, masked\n", + eir_stuck); } static void i9xx_error_irq_ack(struct drm_i915_private *dev_priv, @@ -3590,7 +3603,8 @@ static void i9xx_error_irq_handler(struct drm_i915_private *dev_priv, DRM_DEBUG("Master Error, EIR 0x%08x\n", eir); if (eir_stuck) - DRM_DEBUG_DRIVER("EIR stuck: 0x%08x, masked\n", eir_stuck); + drm_dbg(&dev_priv->drm, "EIR stuck: 0x%08x, masked\n", + eir_stuck); } static irqreturn_t i8xx_irq_handler(int irq, void *arg) |