Commit 96a91515 authored by Jani Nikula's avatar Jani Nikula

drm: prefer DRM_MODE_FMT/ARG over drm_mode_debug_printmodeline()

We have DRM_MODE_FMT and DRM_MODE_ARG() macros to allow unified debug
printing of modes in any printk-formatted logging. Prefer them over
drm_mode_debug_printmodeline().

This allows drm device specific logging of modes, in the right drm debug
category, and inline with the rest of the logging instead of split to
multiple lines.
Suggested-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/6df18588dfa17c5d0a1501f5af9ff21f25a1981b.1712568037.git.jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent fad8e251
......@@ -145,10 +145,10 @@ int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state,
&state->mode, blob->data);
if (ret) {
drm_dbg_atomic(crtc->dev,
"[CRTC:%d:%s] invalid mode (ret=%d, status=%s):\n",
"[CRTC:%d:%s] invalid mode (%s, %pe): " DRM_MODE_FMT "\n",
crtc->base.id, crtc->name,
ret, drm_get_mode_status_name(state->mode.status));
drm_mode_debug_printmodeline(&state->mode);
drm_get_mode_status_name(state->mode.status),
ERR_PTR(ret), DRM_MODE_ARG(&state->mode));
return -EINVAL;
}
......
......@@ -775,9 +775,9 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
ret = drm_mode_convert_umode(dev, mode, &crtc_req->mode);
if (ret) {
drm_dbg_kms(dev, "Invalid mode (ret=%d, status=%s)\n",
ret, drm_get_mode_status_name(mode->status));
drm_mode_debug_printmodeline(mode);
drm_dbg_kms(dev, "Invalid mode (%s, %pe): " DRM_MODE_FMT "\n",
drm_get_mode_status_name(mode->status),
ERR_PTR(ret), DRM_MODE_ARG(mode));
goto out;
}
......
......@@ -657,8 +657,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set,
if (!drm_mode_equal(set->mode, &set->crtc->mode)) {
drm_dbg_kms(dev, "[CRTC:%d:%s] modes are different, full mode set:\n",
set->crtc->base.id, set->crtc->name);
drm_mode_debug_printmodeline(&set->crtc->mode);
drm_mode_debug_printmodeline(set->mode);
drm_dbg_kms(dev, DRM_MODE_FMT "\n", DRM_MODE_ARG(&set->crtc->mode));
drm_dbg_kms(dev, DRM_MODE_FMT "\n", DRM_MODE_ARG(set->mode));
mode_changed = true;
}
......@@ -766,9 +766,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set,
if (mode_changed) {
if (drm_helper_crtc_in_use(set->crtc)) {
drm_dbg_kms(dev, "[CRTC:%d:%s] attempting to set mode from userspace\n",
set->crtc->base.id, set->crtc->name);
drm_mode_debug_printmodeline(set->mode);
drm_dbg_kms(dev, "[CRTC:%d:%s] attempting to set mode from userspace: " DRM_MODE_FMT "\n",
set->crtc->base.id, set->crtc->name, DRM_MODE_ARG(set->mode));
set->crtc->primary->fb = set->fb;
if (!drm_crtc_helper_set_mode(set->crtc, set->mode,
set->x, set->y,
......
......@@ -1201,9 +1201,8 @@ int of_get_drm_display_mode(struct device_node *np,
if (bus_flags)
drm_bus_flags_from_videomode(&vm, bus_flags);
pr_debug("%pOF: got %dx%d display mode\n",
np, vm.hactive, vm.vactive);
drm_mode_debug_printmodeline(dmode);
pr_debug("%pOF: got %dx%d display mode: " DRM_MODE_FMT "\n",
np, vm.hactive, vm.vactive, DRM_MODE_ARG(dmode));
return 0;
}
......@@ -1251,7 +1250,7 @@ int of_get_drm_panel_display_mode(struct device_node *np,
dmode->width_mm = width_mm;
dmode->height_mm = height_mm;
drm_mode_debug_printmodeline(dmode);
pr_debug(DRM_MODE_FMT "\n", DRM_MODE_ARG(dmode));
return 0;
}
......@@ -1813,10 +1812,8 @@ void drm_mode_prune_invalid(struct drm_device *dev,
DRM_MODE_FMT "\n", DRM_MODE_ARG(mode));
}
if (verbose) {
drm_mode_debug_printmodeline(mode);
drm_dbg_kms(dev, "Not using %s mode: %s\n",
mode->name,
drm_get_mode_status_name(mode->status));
drm_dbg_kms(dev, "Rejected mode: " DRM_MODE_FMT " (%s)\n",
DRM_MODE_ARG(mode), drm_get_mode_status_name(mode->status));
}
drm_mode_destroy(dev, mode);
}
......
......@@ -701,7 +701,8 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
list_for_each_entry(mode, &connector->modes, head) {
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
drm_mode_debug_printmodeline(mode);
drm_dbg_kms(dev, "Probed mode: " DRM_MODE_FMT "\n",
DRM_MODE_ARG(mode));
}
return count;
......
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