Commit c808c4ae authored by Wambui Karuga's avatar Wambui Karuga Committed by Jani Nikula

drm/i915/sdvo: automatic conversion to drm_device based logging macros.

Converts instances of the printk based drm logging macros to the new
struct drm_device based logging macros in i915/display/intel_sdvo.c
This was done automatically using the following coccinelle script that
matches based on the existence of a 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(
+drm_dbg(&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(
+drm_dbg(&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.
Signed-off-by: default avatarWambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200130083229.12889-9-wambui.karugax@gmail.com
parent 375e4fbd
...@@ -1477,7 +1477,8 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder, ...@@ -1477,7 +1477,8 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
else else
intel_sdvo_get_dtd_from_mode(&output_dtd, mode); intel_sdvo_get_dtd_from_mode(&output_dtd, mode);
if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd))
DRM_INFO("Setting output timings on %s failed\n", drm_info(&dev_priv->drm,
"Setting output timings on %s failed\n",
SDVO_NAME(intel_sdvo)); SDVO_NAME(intel_sdvo));
/* Set the input timing to the screen. Assume always input 0. */ /* Set the input timing to the screen. Assume always input 0. */
...@@ -1501,7 +1502,8 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder, ...@@ -1501,7 +1502,8 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
if (IS_TV(intel_sdvo_connector) || IS_LVDS(intel_sdvo_connector)) if (IS_TV(intel_sdvo_connector) || IS_LVDS(intel_sdvo_connector))
input_dtd.part2.sdvo_flags = intel_sdvo->dtd_sdvo_flags; input_dtd.part2.sdvo_flags = intel_sdvo->dtd_sdvo_flags;
if (!intel_sdvo_set_input_timing(intel_sdvo, &input_dtd)) if (!intel_sdvo_set_input_timing(intel_sdvo, &input_dtd))
DRM_INFO("Setting input timings on %s failed\n", drm_info(&dev_priv->drm,
"Setting input timings on %s failed\n",
SDVO_NAME(intel_sdvo)); SDVO_NAME(intel_sdvo));
switch (crtc_state->pixel_multiplier) { switch (crtc_state->pixel_multiplier) {
...@@ -1623,7 +1625,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder, ...@@ -1623,7 +1625,7 @@ static void intel_sdvo_get_config(struct intel_encoder *encoder,
* Some sdvo encoders are not spec compliant and don't * Some sdvo encoders are not spec compliant and don't
* implement the mandatory get_timings function. * implement the mandatory get_timings function.
*/ */
DRM_DEBUG_DRIVER("failed to retrieve SDVO DTD\n"); drm_dbg(&dev_priv->drm, "failed to retrieve SDVO DTD\n");
pipe_config->quirks |= PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS; pipe_config->quirks |= PIPE_CONFIG_QUIRK_MODE_SYNC_FLAGS;
} else { } else {
if (dtd.part2.dtd_flags & DTD_FLAG_HSYNC_POSITIVE) if (dtd.part2.dtd_flags & DTD_FLAG_HSYNC_POSITIVE)
...@@ -1815,8 +1817,9 @@ static void intel_enable_sdvo(struct intel_encoder *encoder, ...@@ -1815,8 +1817,9 @@ static void intel_enable_sdvo(struct intel_encoder *encoder,
* a given it the status is a success, we succeeded. * a given it the status is a success, we succeeded.
*/ */
if (success && !input1) { if (success && !input1) {
DRM_DEBUG_KMS("First %s output reported failure to " drm_dbg_kms(&dev_priv->drm,
"sync\n", SDVO_NAME(intel_sdvo)); "First %s output reported failure to "
"sync\n", SDVO_NAME(intel_sdvo));
} }
if (0) if (0)
...@@ -2228,8 +2231,8 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) ...@@ -2228,8 +2231,8 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector)
struct drm_i915_private *dev_priv = to_i915(connector->dev); struct drm_i915_private *dev_priv = to_i915(connector->dev);
struct drm_display_mode *newmode; struct drm_display_mode *newmode;
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n",
connector->base.id, connector->name); connector->base.id, connector->name);
/* /*
* Fetch modes from VBT. For SDVO prefer the VBT mode since some * Fetch modes from VBT. For SDVO prefer the VBT mode since some
...@@ -3278,8 +3281,9 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, ...@@ -3278,8 +3281,9 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
u8 byte; u8 byte;
if (!intel_sdvo_read_byte(intel_sdvo, i, &byte)) { if (!intel_sdvo_read_byte(intel_sdvo, i, &byte)) {
DRM_DEBUG_KMS("No SDVO device found on %s\n", drm_dbg_kms(&dev_priv->drm,
SDVO_NAME(intel_sdvo)); "No SDVO device found on %s\n",
SDVO_NAME(intel_sdvo));
goto err; goto err;
} }
} }
...@@ -3302,8 +3306,9 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, ...@@ -3302,8 +3306,9 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
if (intel_sdvo_output_setup(intel_sdvo, if (intel_sdvo_output_setup(intel_sdvo,
intel_sdvo->caps.output_flags) != true) { intel_sdvo->caps.output_flags) != true) {
DRM_DEBUG_KMS("SDVO output failed to setup on %s\n", drm_dbg_kms(&dev_priv->drm,
SDVO_NAME(intel_sdvo)); "SDVO output failed to setup on %s\n",
SDVO_NAME(intel_sdvo));
/* Output_setup can leave behind connectors! */ /* Output_setup can leave behind connectors! */
goto err_output; goto err_output;
} }
...@@ -3340,7 +3345,7 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv, ...@@ -3340,7 +3345,7 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
&intel_sdvo->pixel_clock_max)) &intel_sdvo->pixel_clock_max))
goto err_output; goto err_output;
DRM_DEBUG_KMS("%s device VID/DID: %02X:%02X.%02X, " drm_dbg_kms(&dev_priv->drm, "%s device VID/DID: %02X:%02X.%02X, "
"clock range %dMHz - %dMHz, " "clock range %dMHz - %dMHz, "
"input 1: %c, input 2: %c, " "input 1: %c, input 2: %c, "
"output 1: %c, output 2: %c\n", "output 1: %c, output 2: %c\n",
......
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