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

drm/i915/atomic: conversion to drm_device based logging macros.

Conversion of the printk based drm logging macros to the struct
drm_device based logging macros in i915/display/intel_atomic.c
This change was achieved 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_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&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_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&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/20200206080014.13759-4-wambui.karugax@gmail.com
parent 62e6c08c
...@@ -66,8 +66,9 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector, ...@@ -66,8 +66,9 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector,
else if (property == dev_priv->broadcast_rgb_property) else if (property == dev_priv->broadcast_rgb_property)
*val = intel_conn_state->broadcast_rgb; *val = intel_conn_state->broadcast_rgb;
else { else {
DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n", drm_dbg_atomic(&dev_priv->drm,
property->base.id, property->name); "Unknown property [PROP:%d:%s]\n",
property->base.id, property->name);
return -EINVAL; return -EINVAL;
} }
...@@ -103,8 +104,8 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector, ...@@ -103,8 +104,8 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector,
return 0; return 0;
} }
DRM_DEBUG_ATOMIC("Unknown property [PROP:%d:%s]\n", drm_dbg_atomic(&dev_priv->drm, "Unknown property [PROP:%d:%s]\n",
property->base.id, property->name); property->base.id, property->name);
return -EINVAL; return -EINVAL;
} }
...@@ -362,8 +363,8 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta ...@@ -362,8 +363,8 @@ static void intel_atomic_setup_scaler(struct intel_crtc_scaler_state *scaler_sta
mode = SKL_PS_SCALER_MODE_DYN; mode = SKL_PS_SCALER_MODE_DYN;
} }
DRM_DEBUG_KMS("Attached scaler id %u.%u to %s:%d\n", drm_dbg_kms(&dev_priv->drm, "Attached scaler id %u.%u to %s:%d\n",
intel_crtc->pipe, *scaler_id, name, idx); intel_crtc->pipe, *scaler_id, name, idx);
scaler_state->scalers[*scaler_id].mode = mode; scaler_state->scalers[*scaler_id].mode = mode;
} }
...@@ -414,8 +415,9 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, ...@@ -414,8 +415,9 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
/* fail if required scalers > available scalers */ /* fail if required scalers > available scalers */
if (num_scalers_need > intel_crtc->num_scalers){ if (num_scalers_need > intel_crtc->num_scalers){
DRM_DEBUG_KMS("Too many scaling requests %d > %d\n", drm_dbg_kms(&dev_priv->drm,
num_scalers_need, intel_crtc->num_scalers); "Too many scaling requests %d > %d\n",
num_scalers_need, intel_crtc->num_scalers);
return -EINVAL; return -EINVAL;
} }
...@@ -460,8 +462,9 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv, ...@@ -460,8 +462,9 @@ int intel_atomic_setup_scalers(struct drm_i915_private *dev_priv,
plane = drm_plane_from_index(&dev_priv->drm, i); plane = drm_plane_from_index(&dev_priv->drm, i);
state = drm_atomic_get_plane_state(drm_state, plane); state = drm_atomic_get_plane_state(drm_state, plane);
if (IS_ERR(state)) { if (IS_ERR(state)) {
DRM_DEBUG_KMS("Failed to add [PLANE:%d] to drm_state\n", drm_dbg_kms(&dev_priv->drm,
plane->base.id); "Failed to add [PLANE:%d] to drm_state\n",
plane->base.id);
return PTR_ERR(state); return PTR_ERR(state);
} }
} }
......
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