diff mbox series

[3/6] drm/modes: switch drm_mode_prune_invalid() to use struct drm_printer

Message ID b9e4f74f13a732b4d8e2536dcc0debe10e6bc6d8.1709843865.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm: debug logging improvements | expand

Commit Message

Jani Nikula March 7, 2024, 8:39 p.m. UTC
Use device based debug logging for the mode via drm_printer.

This changes the output from the format:

[drm:drm_mode_debug_printmodeline] Modeline "6144x3456": 60 1378800 6144 6192 6224 6464 3456 3459 3464 3555 0x48 0x9
[drm:drm_mode_prune_invalid] Not using 6144x3456 mode: CLOCK_HIGH

to format:

i915 0000:00:02.0: [drm] Rejected mode: "6144x3456": 60 1378800 6144 6192 6224 6464 3456 3459 3464 3555 0x48 0x9
i915 0000:00:02.0: [drm] Rejected mode: "6144x3456": CLOCK_HIGH

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_modes.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 711750ab57c7..0fff5a8d4d81 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1825,10 +1825,13 @@  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_DEBUG_KMS("Not using %s mode: %s\n",
-					      mode->name,
-					      drm_get_mode_status_name(mode->status));
+				struct drm_printer p;
+
+				p = drm_dbg_printer(dev, DRM_UT_KMS, "Rejected mode:");
+
+				drm_mode_print(&p, mode);
+				drm_printf(&p, "\"%s\": %s\n", mode->name,
+					   drm_get_mode_status_name(mode->status));
 			}
 			drm_mode_destroy(dev, mode);
 		}