Commit 2b3c472c authored by Jani Nikula's avatar Jani Nikula

drm/i915/panel: use struct drm_device based logging

Convert all the DRM_* logging macros to the struct drm_device based
macros to provide device specific logging.

No functional changes.

Generated using the following semantic patch, originally written by
Wambui Karuga <wambui.karugax@gmail.com>, with manual fixups on top:

@@
identifier fn, T;
@@

fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&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_NOTE(
+drm_notice(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&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,
...)
)
...+>
}

Cc: Wambui Karuga <wambui.karugax@gmail.com>
Reviewed-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/20200402114819.17232-2-jani.nikula@intel.com
parent 9282a66c
...@@ -684,9 +684,10 @@ static void ...@@ -684,9 +684,10 @@ static void
intel_panel_actually_set_backlight(const struct drm_connector_state *conn_state, u32 level) intel_panel_actually_set_backlight(const struct drm_connector_state *conn_state, u32 level)
{ {
struct intel_connector *connector = to_intel_connector(conn_state->connector); struct intel_connector *connector = to_intel_connector(conn_state->connector);
struct drm_i915_private *i915 = to_i915(connector->base.dev);
struct intel_panel *panel = &connector->panel; struct intel_panel *panel = &connector->panel;
DRM_DEBUG_DRIVER("set backlight PWM = %d\n", level); drm_dbg_kms(&i915->drm, "set backlight PWM = %d\n", level);
level = intel_panel_compute_brightness(connector, level); level = intel_panel_compute_brightness(connector, level);
panel->backlight.set(conn_state, level); panel->backlight.set(conn_state, level);
...@@ -867,8 +868,8 @@ void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_st ...@@ -867,8 +868,8 @@ void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_st
* another client is not activated. * another client is not activated.
*/ */
if (dev_priv->drm.switch_power_state == DRM_SWITCH_POWER_CHANGING) { if (dev_priv->drm.switch_power_state == DRM_SWITCH_POWER_CHANGING) {
drm_dbg(&dev_priv->drm, drm_dbg_kms(&dev_priv->drm,
"Skipping backlight disable on vga switch\n"); "Skipping backlight disable on vga switch\n");
return; return;
} }
...@@ -1244,7 +1245,7 @@ static u32 intel_panel_get_backlight(struct intel_connector *connector) ...@@ -1244,7 +1245,7 @@ static u32 intel_panel_get_backlight(struct intel_connector *connector)
mutex_unlock(&dev_priv->backlight_lock); mutex_unlock(&dev_priv->backlight_lock);
drm_dbg(&dev_priv->drm, "get backlight PWM = %d\n", val); drm_dbg_kms(&dev_priv->drm, "get backlight PWM = %d\n", val);
return val; return val;
} }
...@@ -1335,6 +1336,7 @@ static const struct backlight_ops intel_backlight_device_ops = { ...@@ -1335,6 +1336,7 @@ static const struct backlight_ops intel_backlight_device_ops = {
int intel_backlight_device_register(struct intel_connector *connector) int intel_backlight_device_register(struct intel_connector *connector)
{ {
struct drm_i915_private *i915 = to_i915(connector->base.dev);
struct intel_panel *panel = &connector->panel; struct intel_panel *panel = &connector->panel;
struct backlight_properties props; struct backlight_properties props;
...@@ -1374,14 +1376,15 @@ int intel_backlight_device_register(struct intel_connector *connector) ...@@ -1374,14 +1376,15 @@ int intel_backlight_device_register(struct intel_connector *connector)
&intel_backlight_device_ops, &props); &intel_backlight_device_ops, &props);
if (IS_ERR(panel->backlight.device)) { if (IS_ERR(panel->backlight.device)) {
DRM_ERROR("Failed to register backlight: %ld\n", drm_err(&i915->drm, "Failed to register backlight: %ld\n",
PTR_ERR(panel->backlight.device)); PTR_ERR(panel->backlight.device));
panel->backlight.device = NULL; panel->backlight.device = NULL;
return -ENODEV; return -ENODEV;
} }
DRM_DEBUG_KMS("Connector %s backlight sysfs interface registered\n", drm_dbg_kms(&i915->drm,
connector->base.name); "Connector %s backlight sysfs interface registered\n",
connector->base.name);
return 0; return 0;
} }
......
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