Commit b959eb4f authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/client: Look for command-line modes first

When picking a mode, first look for modes that have been specified
by the user on the kernel's command line. Only if that fails, use
the existing heuristic of picking a nearby mode from it's various
parameters.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220511183125.14294-3-tzimmermann@suse.de
parent b6415bd7
...@@ -165,6 +165,17 @@ drm_connector_pick_cmdline_mode(struct drm_connector *connector) ...@@ -165,6 +165,17 @@ drm_connector_pick_cmdline_mode(struct drm_connector *connector)
struct drm_display_mode *mode; struct drm_display_mode *mode;
bool prefer_non_interlace; bool prefer_non_interlace;
/*
* Find a user-defined mode. If the user gave us a valid
* mode on the kernel command line, it will show up in this
* list.
*/
list_for_each_entry(mode, &connector->modes, head) {
if (mode->type & DRM_MODE_TYPE_USERDEF)
return mode;
}
cmdline_mode = &connector->cmdline_mode; cmdline_mode = &connector->cmdline_mode;
if (cmdline_mode->specified == false) if (cmdline_mode->specified == false)
return NULL; return NULL;
......
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