drm/probe-helper: Ensure cmdline mode matches interlace mode

drm_helper_probe_add_cmdline_mode was looking for a match for
the width, height, and refresh rate within the EDID modes, but
didn't check the interlacing flag. That meant that with
video=1920x1080@50i would match any 1920x1080@50 mode that was
found.
The converse would be possible too if an interlaced mode with
matching resolution & refresh rate was found first.

Check the interlacing flag as well.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2025-06-16 16:44:08 +01:00
committed by Dom Cobley
parent 0e56f6eb75
commit beb34bb3a7

View File

@@ -164,6 +164,10 @@ static int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector)
continue;
}
if (cmdline_mode->interlace !=
!!(mode->flags & DRM_MODE_FLAG_INTERLACE))
continue;
/* Mark the matching mode as being preferred by the user */
mode->type |= DRM_MODE_TYPE_USERDEF;
return 0;