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

@@ -23,7 +23,6 @@
#define to_dsi_display(x) container_of(x, struct dsi_display, host)
#define INT_BASE_10 10
#define NO_OVERRIDE -1
#define MISR_BUFF_SIZE 256
#define ESD_MODE_STRING_MAX_LEN 256
@@ -2196,25 +2195,22 @@ static void dsi_display_parse_cmdline_topology(struct dsi_display *display,
}
str = strnstr(boot_str, ":config", strlen(boot_str));
if (!str)
goto end;
if (kstrtol(str + strlen(":config"), INT_BASE_10,
(unsigned long *)&cmdline_topology)) {
DSI_ERR("invalid config index override: %s\n", boot_str);
goto end;
if (str) {
if (sscanf(str, ":config%lu", &cmdline_topology) != 1) {
DSI_ERR("invalid config index override: %s\n",
boot_str);
goto end;
}
}
str = strnstr(boot_str, ":timing", strlen(boot_str));
if (!str)
goto end;
if (kstrtol(str + strlen(":timing"), INT_BASE_10,
(unsigned long *)&cmdline_timing)) {
DSI_ERR("invalid timing index override: %s. resetting both timing and config\n",
boot_str);
cmdline_topology = NO_OVERRIDE;
goto end;
if (str) {
if (sscanf(str, ":timing%lu", &cmdline_timing) != 1) {
DSI_ERR("invalid timing index override: %s\n",
boot_str);
cmdline_topology = NO_OVERRIDE;
goto end;
}
}
DSI_DEBUG("successfully parsed command line topology and timing\n");
end:
@@ -6167,13 +6163,21 @@ int dsi_display_get_modes(struct dsi_display *display,
timing_mode_count = display->panel->num_timing_nodes;
/* Validate command line timing */
if ((display->cmdline_timing != NO_OVERRIDE) &&
(display->cmdline_timing >= timing_mode_count))
display->cmdline_timing = NO_OVERRIDE;
for (mode_idx = 0; mode_idx < timing_mode_count; mode_idx++) {
struct dsi_display_mode display_mode;
int topology_override = NO_OVERRIDE;
bool is_preferred = false;
u32 frame_threshold_us = ctrl->ctrl->frame_threshold_time_us;
if (display->cmdline_timing == mode_idx)
if (display->cmdline_timing == mode_idx) {
topology_override = display->cmdline_topology;
is_preferred = true;
}
memset(&display_mode, 0, sizeof(display_mode));
@@ -6266,6 +6270,10 @@ int dsi_display_get_modes(struct dsi_display *display,
continue;
_dsi_display_populate_bit_clks(display, start, end, &array_idx);
if (is_preferred) {
/* Set first timing sub mode as preferred mode */
display->modes[start].is_preferred = true;
}
}
exit: