Commit 025c2e19 authored by Wambui Karuga's avatar Wambui Karuga Committed by Jani Nikula

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

Converts most uses of the printk based logging macros to the struct
drm_device based logging macros in i915/display/intel_tv.c 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-6-wambui.karugax@gmail.com
parent 53897b4c
...@@ -1146,7 +1146,7 @@ intel_tv_get_config(struct intel_encoder *encoder, ...@@ -1146,7 +1146,7 @@ intel_tv_get_config(struct intel_encoder *encoder,
intel_tv_mode_to_mode(&mode, &tv_mode); intel_tv_mode_to_mode(&mode, &tv_mode);
DRM_DEBUG_KMS("TV mode:\n"); drm_dbg_kms(&dev_priv->drm, "TV mode:\n");
drm_mode_debug_printmodeline(&mode); drm_mode_debug_printmodeline(&mode);
intel_tv_scale_mode_horiz(&mode, hdisplay, intel_tv_scale_mode_horiz(&mode, hdisplay,
...@@ -1202,7 +1202,7 @@ intel_tv_compute_config(struct intel_encoder *encoder, ...@@ -1202,7 +1202,7 @@ intel_tv_compute_config(struct intel_encoder *encoder,
pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
DRM_DEBUG_KMS("forcing bpc to 8 for TV\n"); drm_dbg_kms(&dev_priv->drm, "forcing bpc to 8 for TV\n");
pipe_config->pipe_bpp = 8*3; pipe_config->pipe_bpp = 8*3;
pipe_config->port_clock = tv_mode->clock; pipe_config->port_clock = tv_mode->clock;
...@@ -1217,7 +1217,8 @@ intel_tv_compute_config(struct intel_encoder *encoder, ...@@ -1217,7 +1217,8 @@ intel_tv_compute_config(struct intel_encoder *encoder,
extra = adjusted_mode->crtc_vdisplay - vdisplay; extra = adjusted_mode->crtc_vdisplay - vdisplay;
if (extra < 0) { if (extra < 0) {
DRM_DEBUG_KMS("No vertical scaling for >1024 pixel wide modes\n"); drm_dbg_kms(&dev_priv->drm,
"No vertical scaling for >1024 pixel wide modes\n");
return -EINVAL; return -EINVAL;
} }
...@@ -1250,7 +1251,7 @@ intel_tv_compute_config(struct intel_encoder *encoder, ...@@ -1250,7 +1251,7 @@ intel_tv_compute_config(struct intel_encoder *encoder,
tv_conn_state->bypass_vfilter = false; tv_conn_state->bypass_vfilter = false;
} }
DRM_DEBUG_KMS("TV mode:\n"); drm_dbg_kms(&dev_priv->drm, "TV mode:\n");
drm_mode_debug_printmodeline(adjusted_mode); drm_mode_debug_printmodeline(adjusted_mode);
/* /*
...@@ -1622,7 +1623,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv, ...@@ -1622,7 +1623,7 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
type = -1; type = -1;
tv_dac = intel_de_read(dev_priv, TV_DAC); tv_dac = intel_de_read(dev_priv, TV_DAC);
DRM_DEBUG_KMS("TV detected: %x, %x\n", tv_ctl, tv_dac); drm_dbg_kms(&dev_priv->drm, "TV detected: %x, %x\n", tv_ctl, tv_dac);
/* /*
* A B C * A B C
* 0 1 1 Composite * 0 1 1 Composite
...@@ -1630,16 +1631,19 @@ intel_tv_detect_type(struct intel_tv *intel_tv, ...@@ -1630,16 +1631,19 @@ intel_tv_detect_type(struct intel_tv *intel_tv,
* 0 0 0 Component * 0 0 0 Component
*/ */
if ((tv_dac & TVDAC_SENSE_MASK) == (TVDAC_B_SENSE | TVDAC_C_SENSE)) { if ((tv_dac & TVDAC_SENSE_MASK) == (TVDAC_B_SENSE | TVDAC_C_SENSE)) {
DRM_DEBUG_KMS("Detected Composite TV connection\n"); drm_dbg_kms(&dev_priv->drm,
"Detected Composite TV connection\n");
type = DRM_MODE_CONNECTOR_Composite; type = DRM_MODE_CONNECTOR_Composite;
} else if ((tv_dac & (TVDAC_A_SENSE|TVDAC_B_SENSE)) == TVDAC_A_SENSE) { } else if ((tv_dac & (TVDAC_A_SENSE|TVDAC_B_SENSE)) == TVDAC_A_SENSE) {
DRM_DEBUG_KMS("Detected S-Video TV connection\n"); drm_dbg_kms(&dev_priv->drm,
"Detected S-Video TV connection\n");
type = DRM_MODE_CONNECTOR_SVIDEO; type = DRM_MODE_CONNECTOR_SVIDEO;
} else if ((tv_dac & TVDAC_SENSE_MASK) == 0) { } else if ((tv_dac & TVDAC_SENSE_MASK) == 0) {
DRM_DEBUG_KMS("Detected Component TV connection\n"); drm_dbg_kms(&dev_priv->drm,
"Detected Component TV connection\n");
type = DRM_MODE_CONNECTOR_Component; type = DRM_MODE_CONNECTOR_Component;
} else { } else {
DRM_DEBUG_KMS("Unrecognised TV connection\n"); drm_dbg_kms(&dev_priv->drm, "Unrecognised TV connection\n");
type = -1; type = -1;
} }
...@@ -1800,7 +1804,7 @@ intel_tv_get_modes(struct drm_connector *connector) ...@@ -1800,7 +1804,7 @@ intel_tv_get_modes(struct drm_connector *connector)
*/ */
intel_tv_mode_to_mode(mode, tv_mode); intel_tv_mode_to_mode(mode, tv_mode);
if (count == 0) { if (count == 0) {
DRM_DEBUG_KMS("TV mode:\n"); drm_dbg_kms(&dev_priv->drm, "TV mode:\n");
drm_mode_debug_printmodeline(mode); drm_mode_debug_printmodeline(mode);
} }
intel_tv_scale_mode_horiz(mode, input->w, 0, 0); intel_tv_scale_mode_horiz(mode, input->w, 0, 0);
...@@ -1880,7 +1884,7 @@ intel_tv_init(struct drm_i915_private *dev_priv) ...@@ -1880,7 +1884,7 @@ intel_tv_init(struct drm_i915_private *dev_priv)
return; return;
if (!intel_bios_is_tv_present(dev_priv)) { if (!intel_bios_is_tv_present(dev_priv)) {
DRM_DEBUG_KMS("Integrated TV is not present.\n"); drm_dbg_kms(&dev_priv->drm, "Integrated TV is not present.\n");
return; return;
} }
......
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