From c0eb25464be592555ee20a1a843e44e9ee4f52dc Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 15 Nov 2017 13:37:18 +0200 Subject: [PATCH] compositor-drm: update video mode printing Stop using a head for printing the mode list, because there could be multiple heads. We already gather the mode list from all heads. No need to print the connector id here, because it is logged with DRM heads, and core prints the head names on output enable. The "built-in" flag seemed dead, because it could only be printed if the kernel provided no modes. If we want more detailed info on where modes come from, we would need to inspect mode_info or add new flags to drm_mode or weston_mode. Add printing the pixel clock, because that is used by the video mode duplicate removal code. Signed-off-by: Pekka Paalanen Reviewed-by: Daniel Stone Acked-by: Derek Foreman --- libweston/compositor-drm.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 6164e02..32b9182 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -4892,13 +4892,31 @@ drm_output_fini_crtc(struct drm_output *output) output->scanout_plane = NULL; } +static void +drm_output_print_modes(struct drm_output *output) +{ + struct weston_mode *m; + struct drm_mode *dm; + + wl_list_for_each(m, &output->base.mode_list, link) { + dm = to_drm_mode(m); + + weston_log_continue(STAMP_SPACE "%dx%d@%.1f%s%s, %.1f MHz\n", + m->width, m->height, m->refresh / 1000.0, + m->flags & WL_OUTPUT_MODE_PREFERRED ? + ", preferred" : "", + m->flags & WL_OUTPUT_MODE_CURRENT ? + ", current" : "", + dm->mode_info.clock / 1000.0); + } +} + static int drm_output_enable(struct weston_output *base) { struct drm_output *output = to_drm_output(base); struct drm_backend *b = to_drm_backend(base->compositor); struct drm_head *head = to_drm_head(weston_output_get_first_head(base)); - struct weston_mode *m; drmModeRes *resources; int ret; @@ -4948,17 +4966,9 @@ drm_output_enable(struct weston_output *base) &output->scanout_plane->base, &b->compositor->primary_plane); - weston_log("Output %s, (connector %d, crtc %d)\n", - output->base.name, head->connector_id, output->crtc_id); - wl_list_for_each(m, &output->base.mode_list, link) - weston_log_continue(STAMP_SPACE "mode %dx%d@%.1f%s%s%s\n", - m->width, m->height, m->refresh / 1000.0, - m->flags & WL_OUTPUT_MODE_PREFERRED ? - ", preferred" : "", - m->flags & WL_OUTPUT_MODE_CURRENT ? - ", current" : "", - head->connector->count_modes == 0 ? - ", built-in" : ""); + weston_log("Output %s (crtc %d) video modes:\n", + output->base.name, output->crtc_id); + drm_output_print_modes(output); return 0; -- 2.7.4