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:
diff --git a/dev/gcdb/display/gcdb_display.h b/dev/gcdb/display/gcdb_display.h
index 3b112e3..f18ecea 100755
--- a/dev/gcdb/display/gcdb_display.h
+++ b/dev/gcdb/display/gcdb_display.h
@@ -43,9 +43,6 @@
#define BIST_SIZE 6
#define LANE_SIZE 45
-#define DSI_1_STRING ":1:"
-#define DSI_1_STRING_LEN 3
-
/*---------------------------------------------------------------------------*/
/* API */
/*---------------------------------------------------------------------------*/
diff --git a/dev/gcdb/display/include/display_resource.h b/dev/gcdb/display/include/display_resource.h
index ca392ff..5194022 100755
--- a/dev/gcdb/display/include/display_resource.h
+++ b/dev/gcdb/display/include/display_resource.h
@@ -42,6 +42,11 @@
#define LK_OVERRIDE_PANEL "1:"
#define LK_OVERRIDE_PANEL_LEN 2
+#define DSI_0_STRING ":0:"
+#define DSI_0_STRING_LEN 3
+#define DSI_1_STRING ":1:"
+#define DSI_1_STRING_LEN 3
+
#define NO_PANEL_CONFIG "none"
#define SIM_VIDEO_PANEL "sim_video_panel"
#define SIM_DUALDSI_VIDEO_PANEL "sim_dualdsi_video_panel"