Skip to content

Commit

Permalink
drm/i915/panel: use struct drm_device based logging
Browse files Browse the repository at this point in the history
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 <[email protected]>, 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 <[email protected]>
Reviewed-by: Wambui Karuga <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
jnikula committed Apr 8, 2020
1 parent 9282a66 commit 2b3c472
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions drivers/gpu/drm/i915/display/intel_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,10 @@ static void
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 drm_i915_private *i915 = to_i915(connector->base.dev);
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);
panel->backlight.set(conn_state, level);
Expand Down Expand Up @@ -867,8 +868,8 @@ void intel_panel_disable_backlight(const struct drm_connector_state *old_conn_st
* another client is not activated.
*/
if (dev_priv->drm.switch_power_state == DRM_SWITCH_POWER_CHANGING) {
drm_dbg(&dev_priv->drm,
"Skipping backlight disable on vga switch\n");
drm_dbg_kms(&dev_priv->drm,
"Skipping backlight disable on vga switch\n");
return;
}

Expand Down Expand Up @@ -1244,7 +1245,7 @@ static u32 intel_panel_get_backlight(struct intel_connector *connector)

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;
}

Expand Down Expand Up @@ -1335,6 +1336,7 @@ static const struct backlight_ops intel_backlight_device_ops = {

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 backlight_properties props;

Expand Down Expand Up @@ -1374,14 +1376,15 @@ int intel_backlight_device_register(struct intel_connector *connector)
&intel_backlight_device_ops, &props);

if (IS_ERR(panel->backlight.device)) {
DRM_ERROR("Failed to register backlight: %ld\n",
PTR_ERR(panel->backlight.device));
drm_err(&i915->drm, "Failed to register backlight: %ld\n",
PTR_ERR(panel->backlight.device));
panel->backlight.device = NULL;
return -ENODEV;
}

DRM_DEBUG_KMS("Connector %s backlight sysfs interface registered\n",
connector->base.name);
drm_dbg_kms(&i915->drm,
"Connector %s backlight sysfs interface registered\n",
connector->base.name);

return 0;
}
Expand Down

0 comments on commit 2b3c472

Please sign in to comment.