disp: msm: dsi: select timing mode shared from kernel command line

If the command line timing is given, select corresponding
drm display mode as preferred mode. Select first sub mode of
that timing as preferred mode if dynamic clock or dynamic fps
is enabled.

Change-Id: I688b3bc07f79f4d014b8a7797204d3d6a873222d
Signed-off-by: Rajeev Nandan <rajeevny@codeaurora.org>
This commit is contained in:
Rajeev Nandan
2020-04-13 12:01:50 +05:30
committed by Gerrit - the friendly Code Review server
parent e2f98dc79b
commit b990bd6a04
4 changed files with 39 additions and 21 deletions

View File

@@ -882,9 +882,15 @@ int dsi_connector_get_modes(struct drm_connector *connector, void *data,
}
m->width_mm = connector->display_info.width_mm;
m->height_mm = connector->display_info.height_mm;
/* set the first mode in list as preferred */
if (i == 0)
if (display->cmdline_timing != NO_OVERRIDE) {
/* get the preferred mode from dsi display mode */
if (modes[i].is_preferred)
m->type |= DRM_MODE_TYPE_PREFERRED;
} else if (i == 0) {
/* set the first mode in list as preferred */
m->type |= DRM_MODE_TYPE_PREFERRED;
}
drm_mode_probed_add(connector, m);
}