dev: gcdb: display: fix dsi panel config when only DSI1 is configured
It is possible to configure display using DSI1 alone. In such cases, the
panel configuration should be corrected to indicate that no panel is
connected to DSI0.
Change-Id: I29a472ff1269e0401b8cdcee3e8a0efa64ed0532
diff --git a/dev/gcdb/display/gcdb_display.c b/dev/gcdb/display/gcdb_display.c
index 2066e4d..f0503ee 100755
--- a/dev/gcdb/display/gcdb_display.c
+++ b/dev/gcdb/display/gcdb_display.c
@@ -199,6 +199,7 @@
char *default_str;
int panel_mode = SPLIT_DISPLAY_FLAG | DUAL_PIPE_FLAG | DST_SPLIT_FLAG;
int prefix_string_len = strlen(DISPLAY_CMDLINE_PREFIX);
+ char *sctl_string;
panel_name += strspn(panel_name, " ");
@@ -254,7 +255,12 @@
arg_size = prefix_string_len + dsi_id_len + panel_node_len +
LK_OVERRIDE_PANEL_LEN + 1;
- arg_size += DSI_1_STRING_LEN + slave_panel_node_len;
+ if (!strcmp(panelstruct.paneldata->panel_destination, "DISPLAY_2"))
+ sctl_string = DSI_0_STRING;
+ else
+ sctl_string = DSI_1_STRING;
+
+ arg_size += strlen(sctl_string) + slave_panel_node_len;
if (buf_size < arg_size) {
dprintf(CRITICAL, "display command line buffer is small\n");
@@ -277,9 +283,9 @@
pbuf += panel_node_len;
buf_size -= panel_node_len;
- strlcpy(pbuf, DSI_1_STRING, buf_size);
- pbuf += DSI_1_STRING_LEN;
- buf_size -= DSI_1_STRING_LEN;
+ strlcpy(pbuf, sctl_string, buf_size);
+ pbuf += strlen(sctl_string);
+ buf_size -= strlen(sctl_string);
strlcpy(pbuf, slave_panel_node, buf_size);
}
end: