drm/i915/hotplug: convert to drm_device based logging.
authorWambui Karuga <wambui.karugax@gmail.com>
Tue, 10 Mar 2020 08:52:46 +0000 (10:52 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 11 Mar 2020 10:20:43 +0000 (12:20 +0200)
Converts various instances of the printk based drm logging macros to the
struct drm_device based logging macros in i915/display/intel_hotplug.c.
In some cases, this involves extracting the drm_i915_private pointer from
the drm_device struct to be used in the logging macros.

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/3dfda89ab4a234f299ada77abd14163cef3f8bd4.1583766715.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_hotplug.c

index 562227d54cccb6bf446532bff4f2092cf0a5c39c..a091442efba4d46668d38499a42f47400bc121c3 100644 (file)
@@ -170,10 +170,13 @@ static bool intel_hpd_irq_storm_detect(struct drm_i915_private *dev_priv,
        hpd->stats[pin].count += increment;
        if (hpd->stats[pin].count > threshold) {
                hpd->stats[pin].state = HPD_MARK_DISABLED;
-               DRM_DEBUG_KMS("HPD interrupt storm detected on PIN %d\n", pin);
+               drm_dbg_kms(&dev_priv->drm,
+                           "HPD interrupt storm detected on PIN %d\n", pin);
                storm = true;
        } else {
-               DRM_DEBUG_KMS("Received HPD interrupt on PIN %d - cnt: %d\n", pin,
+               drm_dbg_kms(&dev_priv->drm,
+                           "Received HPD interrupt on PIN %d - cnt: %d\n",
+                             pin,
                              hpd->stats[pin].count);
        }
 
@@ -202,7 +205,8 @@ intel_hpd_irq_storm_switch_to_polling(struct drm_i915_private *dev_priv)
                    dev_priv->hotplug.stats[pin].state != HPD_MARK_DISABLED)
                        continue;
 
-               DRM_INFO("HPD interrupt storm detected on connector %s: "
+               drm_info(&dev_priv->drm,
+                        "HPD interrupt storm detected on connector %s: "
                         "switching from hotplug detection to polling\n",
                         connector->base.name);
 
@@ -244,8 +248,9 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work)
                        continue;
 
                if (connector->base.polled != connector->polled)
-                       DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n",
-                                        connector->base.name);
+                       drm_dbg(&dev_priv->drm,
+                               "Reenabling HPD on connector %s\n",
+                               connector->base.name);
                connector->base.polled = connector->polled;
        }
        drm_connector_list_iter_end(&conn_iter);
@@ -280,11 +285,12 @@ intel_encoder_hotplug(struct intel_encoder *encoder,
        if (old_status == connector->base.status)
                return INTEL_HOTPLUG_UNCHANGED;
 
-       DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
-                     connector->base.base.id,
-                     connector->base.name,
-                     drm_get_connector_status_name(old_status),
-                     drm_get_connector_status_name(connector->base.status));
+       drm_dbg_kms(&to_i915(dev)->drm,
+                   "[CONNECTOR:%d:%s] status updated from %s to %s\n",
+                   connector->base.base.id,
+                   connector->base.name,
+                   drm_get_connector_status_name(old_status),
+                   drm_get_connector_status_name(connector->base.status));
 
        return INTEL_HOTPLUG_CHANGED;
 }
@@ -358,7 +364,7 @@ static void i915_hotplug_work_func(struct work_struct *work)
        u32 hpd_retry_bits;
 
        mutex_lock(&dev->mode_config.mutex);
-       DRM_DEBUG_KMS("running encoder hotplug functions\n");
+       drm_dbg_kms(&dev_priv->drm, "running encoder hotplug functions\n");
 
        spin_lock_irq(&dev_priv->irq_lock);
 
@@ -386,8 +392,9 @@ static void i915_hotplug_work_func(struct work_struct *work)
                        struct intel_encoder *encoder =
                                intel_attached_encoder(connector);
 
-                       DRM_DEBUG_KMS("Connector %s (pin %i) received hotplug event.\n",
-                                     connector->base.name, pin);
+                       drm_dbg_kms(&dev_priv->drm,
+                                   "Connector %s (pin %i) received hotplug event.\n",
+                                   connector->base.name, pin);
 
                        switch (encoder->hotplug(encoder, connector,
                                                 hpd_event_bits & hpd_bit)) {
@@ -472,9 +479,10 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
 
                long_hpd = long_mask & BIT(pin);
 
-               DRM_DEBUG_DRIVER("digital hpd on [ENCODER:%d:%s] - %s\n",
-                                encoder->base.base.id, encoder->base.name,
-                                long_hpd ? "long" : "short");
+               drm_dbg(&dev_priv->drm,
+                       "digital hpd on [ENCODER:%d:%s] - %s\n",
+                       encoder->base.base.id, encoder->base.name,
+                       long_hpd ? "long" : "short");
                queue_dig = true;
 
                if (long_hpd) {