Commit 2e3586ce authored by Wambui Karuga's avatar Wambui Karuga Committed by Jani Nikula

drm/i915/bw: convert to drm_device based logging macros

This replaces the printk based logging macros with the struct drm_based
macros in i915/display/intel_bw.c
This transformation was achieved by using the following coccinelle
script that matches based on the existence of a struct drm_i915_private
device in the functions:

@rule1@
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,
...)
)
...+>
}

@rule2@
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,
...)
)
...+>
}

Resulting checkpatch warnings were addressed 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/20200121134559.17355-5-wambui.karugax@gmail.com
parent 63855149
...@@ -132,9 +132,10 @@ static int icl_get_qgv_points(struct drm_i915_private *dev_priv, ...@@ -132,9 +132,10 @@ static int icl_get_qgv_points(struct drm_i915_private *dev_priv,
if (ret) if (ret)
return ret; return ret;
DRM_DEBUG_KMS("QGV %d: DCLK=%d tRP=%d tRDPRE=%d tRAS=%d tRCD=%d tRC=%d\n", drm_dbg_kms(&dev_priv->drm,
i, sp->dclk, sp->t_rp, sp->t_rdpre, sp->t_ras, "QGV %d: DCLK=%d tRP=%d tRDPRE=%d tRAS=%d tRCD=%d tRC=%d\n",
sp->t_rcd, sp->t_rc); i, sp->dclk, sp->t_rp, sp->t_rdpre, sp->t_ras,
sp->t_rcd, sp->t_rc);
} }
return 0; return 0;
...@@ -187,7 +188,8 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel ...@@ -187,7 +188,8 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel
ret = icl_get_qgv_points(dev_priv, &qi); ret = icl_get_qgv_points(dev_priv, &qi);
if (ret) { if (ret) {
DRM_DEBUG_KMS("Failed to get memory subsystem information, ignoring bandwidth limits"); drm_dbg_kms(&dev_priv->drm,
"Failed to get memory subsystem information, ignoring bandwidth limits");
return ret; return ret;
} }
num_channels = qi.num_channels; num_channels = qi.num_channels;
...@@ -228,8 +230,9 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel ...@@ -228,8 +230,9 @@ static int icl_get_bw_info(struct drm_i915_private *dev_priv, const struct intel
bi->deratedbw[j] = min(maxdebw, bi->deratedbw[j] = min(maxdebw,
bw * 9 / 10); /* 90% */ bw * 9 / 10); /* 90% */
DRM_DEBUG_KMS("BW%d / QGV %d: num_planes=%d deratedbw=%u\n", drm_dbg_kms(&dev_priv->drm,
i, j, bi->num_planes, bi->deratedbw[j]); "BW%d / QGV %d: num_planes=%d deratedbw=%u\n",
i, j, bi->num_planes, bi->deratedbw[j]);
} }
if (bi->num_planes == 1) if (bi->num_planes == 1)
...@@ -424,10 +427,11 @@ int intel_bw_atomic_check(struct intel_atomic_state *state) ...@@ -424,10 +427,11 @@ int intel_bw_atomic_check(struct intel_atomic_state *state)
bw_state->data_rate[crtc->pipe] = new_data_rate; bw_state->data_rate[crtc->pipe] = new_data_rate;
bw_state->num_active_planes[crtc->pipe] = new_active_planes; bw_state->num_active_planes[crtc->pipe] = new_active_planes;
DRM_DEBUG_KMS("pipe %c data rate %u num active planes %u\n", drm_dbg_kms(&dev_priv->drm,
pipe_name(crtc->pipe), "pipe %c data rate %u num active planes %u\n",
bw_state->data_rate[crtc->pipe], pipe_name(crtc->pipe),
bw_state->num_active_planes[crtc->pipe]); bw_state->data_rate[crtc->pipe],
bw_state->num_active_planes[crtc->pipe]);
} }
if (!bw_state) if (!bw_state)
...@@ -441,8 +445,9 @@ int intel_bw_atomic_check(struct intel_atomic_state *state) ...@@ -441,8 +445,9 @@ int intel_bw_atomic_check(struct intel_atomic_state *state)
data_rate = DIV_ROUND_UP(data_rate, 1000); data_rate = DIV_ROUND_UP(data_rate, 1000);
if (data_rate > max_data_rate) { if (data_rate > max_data_rate) {
DRM_DEBUG_KMS("Bandwidth %u MB/s exceeds max available %d MB/s (%d active planes)\n", drm_dbg_kms(&dev_priv->drm,
data_rate, max_data_rate, num_active_planes); "Bandwidth %u MB/s exceeds max available %d MB/s (%d active planes)\n",
data_rate, max_data_rate, num_active_planes);
return -EINVAL; return -EINVAL;
} }
......
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