target: add support to skip panel configuration in LK

In the current implementation, a valid panel string can be
passed to kernel via command line argument only if the panel
is supported in LK. Add support to pass the panel string to kernel
even in cases where the panel is not supported in LK. Use a panel
lookup table to acquire the correct panel DT string to be passed to
kernel.

Default:
fastboot oem select-display-panel jdi_1080p_video

Skip panel:
fastboot oem select-display-panel jdi_1080p_video:skip

Disable continuous splash:
fastboot oem select-display-panel jdi_1080p_video:disable

Change-Id: Ib5cd01fb591a6b234905bbb505cd2e478200675d
diff --git a/dev/gcdb/display/fastboot_oem_display.h b/dev/gcdb/display/fastboot_oem_display.h
new file mode 100644
index 0000000..7492d2f
--- /dev/null
+++ b/dev/gcdb/display/fastboot_oem_display.h
@@ -0,0 +1,92 @@
+/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  * Neither the name of The Linux Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _FASTBOOT_OEM_DISPLAY_H_
+#define _FASTBOOT_OEM_DISPLAY_H_
+
+/*---------------------------------------------------------------------------*/
+/* Lookup table for skip panels                                              */
+/*---------------------------------------------------------------------------*/
+
+struct panel_lookup_list {
+	char name[MAX_PANEL_ID_LEN];
+	char panel_dt_string[MAX_PANEL_ID_LEN];
+	bool is_split_dsi;
+};
+
+struct panel_lookup_list lookup_skip_panels[] = {
+	{"adv7533_1080p_video", "qcom,mdss_dsi_adv7533_1080p60_video", false},
+	{"adv7533_720p_video", "qcom,mdss_dsi_adv7533_720p60_video", false},
+	{"auo_qvga_cmd", "qcom,mdss_dsi_auo_qvga_cmd", false},
+	{"generic_720p_cmd", "qcom,mdss_dsi_generic_720p_cmd", false},
+	{"hx8279a_wsvga_video", "qcom,mdss_dsi_hx8279a_wsvga_video", false},
+	{"hx8379a_wvga_video", "qcom,mdss_dsi_hx8379a_fwvga_video", false},
+	{"hx8379a_truly_fwvga_video", "qcom,mdss_dsi_hx8379a_truly_fwvga_video", false},
+	{"hx8379a_wvga_video", "qcom,mdss_dsi_hx8379a_wvga_video", false},
+	{"hx8379c_fwvga_video", "qcom,mdss_dsi_hx8379c_fwvga_video", false},
+	{"hx8389b_qhd_video", "qcom,mdss_dsi_hx8389b_qhd_video", false},
+	{"hx8394a_720p_video", "qcom,mdss_dsi_hx8394a_720p_video", false},
+	{"hx8394d_720p_video", "qcom,mdss_dsi_hx8394d_720p_video", false},
+	{"hx8394d_qhd_video", "qcom,mdss_dsi_hx8394d_qhd_video", false},
+	{"ili9806e_fwvga_video", "qcom,mdss_dsi_ili9806e_fwvga_video", false},
+	{"innolux_720p_video", "qcom,mdss_dsi_innolux_720p_video", false},
+	{"jdi_4k_dualdsi_video", "qcom,dsi_jdi_4k_video", true},
+	{"jdi_1080p_video", "qcom,mdss_dsi_jdi_1080p_video", false},
+	{"jdi_a216_fhd_video", "qcom,mdss_dsi_jdi_a216_fhd_video", false},
+	{"jdi_fhd_video", "qcom,mdss_dsi_jdi_fhd_video", false},
+	{"jdi_qhd_dualdsi_cmd", "qcom,mdss_dsi_jdi_qhd_dualmipi_cmd", true},
+	{"jdi_qhd_dualdsi_video", "qcom,dsi_jdi_qhd_video", true},
+	{"nt35521_720p_video", "qcom,mdss_dsi_nt35521_720p_video", false},
+	{"nt35521_wxga_video", "qcom,mdss_dsi_nt35521_wxga_video", false},
+	{"nt35590_720p_cmd", "qcom,mdss_dsi_nt35590_720p_cmd", false},
+	{"nt35590_720p_video", "qcom,mdss_dsi_nt35590_720p_video", false},
+	{"nt35590_qvga_cmd", "qcom,mdss_dsi_nt35590_qvga_cmd", false},
+	{"nt35596_1080p_video", "qcom,mdss_dsi_nt35596_1080p_skuk_video", false},
+	{"nt35597_wqxga_cmd", "qcom,dsi_nt35597_wqxga_cmd", false},
+	{"nt35597_wqxga_video", "qcom,dsi_nt35597_wqxga_video", false},
+	{"nt35597_wqxga_dualdsi_video", "qcom,mdss_dsi_nt35597_wqxga_video", true},
+	{"otm1283a_720p_video", "qcom,mdss_dsi_otm1283a_720p_video", false},
+	{"otm1906c_1080p_cmd", "qcom,mdss_dsi_otm1906c_1080p_cmd", false},
+	{"otm8018b_fwvga_video", "qcom,mdss_dsi_otm8018b_fwvga_video", false},
+	{"otm8019a_fwvga_video", "qcom,mdss_dsi_otm8019a_fwvga_video", false},
+	{"r61318_hd_video", "qcom,mdss_dsi_r61318_hd_video", false},
+	{"r63417_1080p_video", "qcom,mdss_dsi_r63417_1080p_video", false},
+	{"samsung_wxga_video", "qcom,mdss_dsi_samsung_wxga_video", false},
+	{"sharp_1080p_cmd", "qcom,mdss_dsi_sharp_1080p_cmd", false},
+	{"sharp_qhd_video", "qcom,mdss_dsi_sharp_qhd_video", false},
+	{"sharp_wqxga_dualdsi_video", "qcom,mdss_dsi_sharp_wqxga_video", true},
+	{"ssd2080m_720p_video", "qcom,mdss_dsi_ssd2080m_720p_video", false},
+	{"toshiba_720p_video", "qcom,mdss_dsi_toshiba_720p_video", false},
+	{"truly_1080p_cmd", "qcom,mdss_dsi_truly_1080p_cmd", false},
+	{"truly_1080p_video", "qcom,mdss_dsi_truly_1080p_video", false},
+	{"truly_wvga_cmd", "qcom,mdss_dsi_truly_wvga_cmd", false},
+	{"truly_wvga_video", "qcom,mdss_dsi_truly_wvga_video", false},
+};
+
+#endif /*_FASTBOOT_OEM_DISPLAY_H_ */
diff --git a/dev/gcdb/display/gcdb_display.c b/dev/gcdb/display/gcdb_display.c
index ccc47cd..bfb1153 100644
--- a/dev/gcdb/display/gcdb_display.c
+++ b/dev/gcdb/display/gcdb_display.c
@@ -329,138 +329,6 @@
 	return ret;
 }
 
-static bool mdss_dsi_set_panel_node(char *panel_name, char **dsi_id,
-		char **panel_node, char **slave_panel_node, int *panel_mode)
-{
-	if (!strcmp(panel_name, SIM_VIDEO_PANEL)) {
-		*dsi_id = SIM_DSI_ID;
-		*panel_node = SIM_VIDEO_PANEL_NODE;
-		*panel_mode = 0;
-	} else if (!strcmp(panel_name, SIM_DUALDSI_VIDEO_PANEL)) {
-		*dsi_id = SIM_DSI_ID;
-		*panel_node = SIM_DUALDSI_VIDEO_PANEL_NODE;
-		*slave_panel_node = SIM_DUALDSI_VIDEO_SLAVE_PANEL_NODE;
-		*panel_mode = 1;
-	} else if (!strcmp(panel_name, SIM_CMD_PANEL)) {
-		*dsi_id = SIM_DSI_ID;
-		*panel_node = SIM_CMD_PANEL_NODE;
-		*panel_mode = 0;
-	} else if (!strcmp(panel_name, SIM_DUALDSI_CMD_PANEL)) {
-		*dsi_id = SIM_DSI_ID;
-		*panel_node = SIM_DUALDSI_CMD_PANEL_NODE;
-		*slave_panel_node = SIM_DUALDSI_CMD_SLAVE_PANEL_NODE;
-		*panel_mode = 1;
-	} else {
-		return false;
-	}
-	return true;
-}
-
-bool gcdb_display_cmdline_arg(char *panel_name, char *pbuf, uint16_t buf_size)
-{
-	char *dsi_id = NULL;
-	char *panel_node = NULL;
-	char *slave_panel_node = NULL;
-	uint16_t dsi_id_len = 0, panel_node_len = 0, slave_panel_node_len = 0;
-	uint32_t arg_size = 0;
-	bool ret = true;
-	bool rc;
-	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, " ");
-
-	rc = mdss_dsi_set_panel_node(panel_name, &dsi_id, &panel_node,
-			&slave_panel_node, &panel_mode);
-	if (!rc) {
-		if (panelstruct.paneldata && target_cont_splash_screen()) {
-			dsi_id = panelstruct.paneldata->panel_controller;
-			panel_node = panelstruct.paneldata->panel_node_id;
-			panel_mode =
-				panelstruct.paneldata->panel_operating_mode &
-								panel_mode;
-			slave_panel_node =
-				panelstruct.paneldata->slave_panel_node_id;
-		} else {
-			if (target_is_edp())
-				default_str = "0:edp:";
-			else
-				default_str = "0:dsi:0:";
-
-			arg_size = prefix_string_len + strlen(default_str);
-			if (buf_size < arg_size) {
-				dprintf(CRITICAL, "display command line buffer is small\n");
-				return false;
-			}
-
-			strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
-			pbuf += prefix_string_len;
-			buf_size -= prefix_string_len;
-
-			strlcpy(pbuf, default_str, buf_size);
-			return true;
-		}
-	}
-
-	if (dsi_id == NULL || panel_node == NULL) {
-		dprintf(CRITICAL, "panel node or dsi ctrl not present\n");
-		return false;
-	}
-
-	if (((panel_mode & SPLIT_DISPLAY_FLAG) ||
-	     (panel_mode & DST_SPLIT_FLAG)) && slave_panel_node == NULL) {
-		dprintf(CRITICAL, "slave node not present in dual dsi case\n");
-		return false;
-	}
-
-	dsi_id_len = strlen(dsi_id);
-	panel_node_len = strlen(panel_node);
-	if (!slave_panel_node || !strcmp(slave_panel_node, ""))
-		slave_panel_node = NO_PANEL_CONFIG;
-	slave_panel_node_len = strlen(slave_panel_node);
-
-	arg_size = prefix_string_len + dsi_id_len + panel_node_len +
-						LK_OVERRIDE_PANEL_LEN + 1;
-
-	if (panelstruct.paneldata &&
-		!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");
-		ret = false;
-	} else {
-		strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
-		pbuf += prefix_string_len;
-		buf_size -= prefix_string_len;
-
-		strlcpy(pbuf, LK_OVERRIDE_PANEL, buf_size);
-		pbuf += LK_OVERRIDE_PANEL_LEN;
-		buf_size -= LK_OVERRIDE_PANEL_LEN;
-
-		strlcpy(pbuf, dsi_id, buf_size);
-		pbuf += dsi_id_len;
-		buf_size -= dsi_id_len;
-
-		strlcpy(pbuf, panel_node, buf_size);
-
-		pbuf += panel_node_len;
-		buf_size -= panel_node_len;
-
-		strlcpy(pbuf, sctl_string, buf_size);
-		pbuf += strlen(sctl_string);
-		buf_size -= strlen(sctl_string);
-		strlcpy(pbuf, slave_panel_node, buf_size);
-	}
-	return ret;
-}
-
 static void mdss_edp_panel_init(struct msm_panel_info *pinfo)
 {
 	return target_edp_panel_init(pinfo);
@@ -535,6 +403,11 @@
 	return target_display_dsi2hdmi_config(pinfo);
 }
 
+struct panel_struct mdss_dsi_get_panel_data(void)
+{
+	return panelstruct;
+}
+
 int gcdb_display_init(const char *panel_name, uint32_t rev, void *base)
 {
 	int ret = NO_ERROR;
diff --git a/dev/gcdb/display/gcdb_display.h b/dev/gcdb/display/gcdb_display.h
index d1f1df5..1fbc2f7 100755
--- a/dev/gcdb/display/gcdb_display.h
+++ b/dev/gcdb/display/gcdb_display.h
@@ -56,22 +56,18 @@
 int target_dsi_phy_config(struct mdss_dsi_phy_ctrl *phy_db);
 
 int gcdb_display_init(const char *panel_name, uint32_t rev, void *base);
-int gcdb_display_cmdline_arg(char *panel_name, char *pbuf, uint16_t buf_size);
+int gcdb_display_cmdline_arg(char *pbuf, uint16_t buf_size);
 void gcdb_display_shutdown();
 int oem_panel_select(const char *panel_name, struct panel_struct *panelstruct,
 	struct msm_panel_info *pinfo, struct mdss_dsi_phy_ctrl *phy_db);
+void set_panel_cmd_string(const char *panel_name);
+struct oem_panel_data mdss_dsi_get_oem_data(void);
+struct panel_struct mdss_dsi_get_panel_data(void);
 
-static inline void set_panel_cmd_string(const char *panel_name,
-	char *cont_splash)
-{
-	char *ch = NULL;
-	ch = strchr((char *) panel_name, ':');
-	if (ch) {
-		*cont_splash = *(ch + 1);
-		*ch = '\0';
-	} else {
-		*cont_splash = '\0';
-	}
-}
+struct oem_panel_data  {
+	char panel[MAX_PANEL_ID_LEN];
+	bool cont_splash;
+	bool skip;
+};
 
 #endif /*_GCDB_DISPLAY_H_ */
diff --git a/dev/gcdb/display/gcdb_display_param.c b/dev/gcdb/display/gcdb_display_param.c
new file mode 100644
index 0000000..1b4f25e
--- /dev/null
+++ b/dev/gcdb/display/gcdb_display_param.c
@@ -0,0 +1,243 @@
+/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *  * Neither the name of The Linux Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <debug.h>
+#include <err.h>
+#include <string.h>
+#include <stdlib.h>
+#include <mdp5.h>
+
+#include "gcdb_display.h"
+#include "target/display.h"
+#include "fastboot_oem_display.h"
+
+struct oem_panel_data oem_data = {{'\0'}, false, false};
+
+void panel_name_to_dt_string(struct panel_lookup_list supp_panels[],
+			  uint32_t supp_panels_size,
+			  const char *panel_name, char **panel_node,
+			  char **slave_panel_node, int *panel_mode)
+{
+	uint32_t i;
+
+	if (!panel_name) {
+		dprintf(CRITICAL, "Invalid panel name\n");
+		return;
+	}
+
+	for (i = 0; i < supp_panels_size; i++) {
+		if (!strncmp(panel_name, supp_panels[i].name,
+			MAX_PANEL_ID_LEN)) {
+			*panel_node = supp_panels[i].panel_dt_string;
+			if (supp_panels[i].is_split_dsi) {
+				*slave_panel_node =
+					supp_panels[i].panel_dt_string;
+				*panel_mode = DUAL_DSI_FLAG;
+			} else {
+				*panel_mode = 0;
+			}
+			break;
+		}
+	}
+
+	if (i == supp_panels_size)
+		dprintf(CRITICAL, "Panel_name:%s not found in lookup table\n",
+			panel_name);
+}
+
+struct oem_panel_data mdss_dsi_get_oem_data(void)
+{
+	return oem_data;
+}
+
+void set_panel_cmd_string(const char *panel_name)
+{
+	char *ch = NULL;
+	int i;
+
+	panel_name += strspn(panel_name, " ");
+
+	/* Panel string */
+	ch = strchr((char *) panel_name, ':');
+	if (ch) {
+		for (i = 0; (panel_name + i) < ch; i++)
+			oem_data.panel[i] = *(panel_name + i);
+		oem_data.panel[i] = '\0';
+	} else {
+		strlcpy(oem_data.panel, panel_name, MAX_PANEL_ID_LEN);
+	}
+
+	/* Skip LK configuration */
+	ch = strstr((char *) panel_name, ":skip");
+	oem_data.skip = ch ? true : false;
+
+	/* Cont. splash status */
+	ch = strstr((char *) panel_name, ":disable");
+	oem_data.cont_splash = ch ? false : true;
+}
+
+static bool mdss_dsi_set_panel_node(char *panel_name, char **dsi_id,
+		char **panel_node, char **slave_panel_node, int *panel_mode)
+{
+	if (!strcmp(panel_name, SIM_VIDEO_PANEL)) {
+		*dsi_id = SIM_DSI_ID;
+		*panel_node = SIM_VIDEO_PANEL_NODE;
+		*panel_mode = 0;
+	} else if (!strcmp(panel_name, SIM_DUALDSI_VIDEO_PANEL)) {
+		*dsi_id = SIM_DSI_ID;
+		*panel_node = SIM_DUALDSI_VIDEO_PANEL_NODE;
+		*slave_panel_node = SIM_DUALDSI_VIDEO_SLAVE_PANEL_NODE;
+		*panel_mode = DUAL_DSI_FLAG;
+	} else if (!strcmp(panel_name, SIM_CMD_PANEL)) {
+		*dsi_id = SIM_DSI_ID;
+		*panel_node = SIM_CMD_PANEL_NODE;
+		*panel_mode = 0;
+	} else if (!strcmp(panel_name, SIM_DUALDSI_CMD_PANEL)) {
+		*dsi_id = SIM_DSI_ID;
+		*panel_node = SIM_DUALDSI_CMD_PANEL_NODE;
+		*slave_panel_node = SIM_DUALDSI_CMD_SLAVE_PANEL_NODE;
+		*panel_mode = DUAL_DSI_FLAG;
+	} else if (oem_data.skip) {
+		/* For skip panel case, check the lookup table */
+		*dsi_id = SIM_DSI_ID;
+		panel_name_to_dt_string(lookup_skip_panels,
+			ARRAY_SIZE(lookup_skip_panels), panel_name,
+			panel_node, slave_panel_node, panel_mode);
+	} else {
+		return false;
+	}
+	return true;
+}
+
+bool gcdb_display_cmdline_arg(char *pbuf, uint16_t buf_size)
+{
+	char *dsi_id = NULL;
+	char *panel_node = NULL;
+	char *slave_panel_node = NULL;
+	uint16_t dsi_id_len = 0, panel_node_len = 0, slave_panel_node_len = 0;
+	uint32_t arg_size = 0;
+	bool ret = true;
+	bool rc;
+	char *default_str;
+	struct panel_struct panelstruct;
+	int panel_mode = SPLIT_DISPLAY_FLAG | DUAL_PIPE_FLAG | DST_SPLIT_FLAG;
+	int prefix_string_len = strlen(DISPLAY_CMDLINE_PREFIX);
+	char *sctl_string;
+
+	panelstruct = mdss_dsi_get_panel_data();
+
+	rc = mdss_dsi_set_panel_node(oem_data.panel, &dsi_id, &panel_node,
+			&slave_panel_node, &panel_mode);
+
+	if (!rc) {
+		if (panelstruct.paneldata && target_cont_splash_screen()) {
+			dsi_id = panelstruct.paneldata->panel_controller;
+			panel_node = panelstruct.paneldata->panel_node_id;
+			panel_mode =
+				panelstruct.paneldata->panel_operating_mode &
+								panel_mode;
+			slave_panel_node =
+				panelstruct.paneldata->slave_panel_node_id;
+		} else {
+			if (target_is_edp())
+				default_str = "0:edp:";
+			else
+				default_str = "0:dsi:0:";
+
+			arg_size = prefix_string_len + strlen(default_str);
+			if (buf_size < arg_size) {
+				dprintf(CRITICAL, "display command line buffer is small\n");
+				return false;
+			}
+
+			strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
+			pbuf += prefix_string_len;
+			buf_size -= prefix_string_len;
+
+			strlcpy(pbuf, default_str, buf_size);
+			return true;
+		}
+	}
+
+	if (dsi_id == NULL || panel_node == NULL) {
+		dprintf(CRITICAL, "panel node or dsi ctrl not present\n");
+		return false;
+	}
+
+	if (((panel_mode & SPLIT_DISPLAY_FLAG) ||
+	     (panel_mode & DST_SPLIT_FLAG)) && slave_panel_node == NULL) {
+		dprintf(CRITICAL, "slave node not present in dual dsi case\n");
+		return false;
+	}
+
+	dsi_id_len = strlen(dsi_id);
+	panel_node_len = strlen(panel_node);
+	if (!slave_panel_node || !strcmp(slave_panel_node, ""))
+		slave_panel_node = NO_PANEL_CONFIG;
+	slave_panel_node_len = strlen(slave_panel_node);
+
+	arg_size = prefix_string_len + dsi_id_len + panel_node_len +
+						LK_OVERRIDE_PANEL_LEN + 1;
+
+	if (panelstruct.paneldata &&
+		!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");
+		ret = false;
+	} else {
+		strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
+		pbuf += prefix_string_len;
+		buf_size -= prefix_string_len;
+
+		strlcpy(pbuf, LK_OVERRIDE_PANEL, buf_size);
+		pbuf += LK_OVERRIDE_PANEL_LEN;
+		buf_size -= LK_OVERRIDE_PANEL_LEN;
+
+		strlcpy(pbuf, dsi_id, buf_size);
+		pbuf += dsi_id_len;
+		buf_size -= dsi_id_len;
+
+		strlcpy(pbuf, panel_node, buf_size);
+
+		pbuf += panel_node_len;
+		buf_size -= panel_node_len;
+
+		strlcpy(pbuf, sctl_string, buf_size);
+		pbuf += strlen(sctl_string);
+		buf_size -= strlen(sctl_string);
+		strlcpy(pbuf, slave_panel_node, buf_size);
+	}
+	return ret;
+}
diff --git a/dev/gcdb/display/panel_display.c b/dev/gcdb/display/panel_display.c
index 2555274..4ea95d1 100755
--- a/dev/gcdb/display/panel_display.c
+++ b/dev/gcdb/display/panel_display.c
@@ -484,8 +484,6 @@
 		return panel_id;
 	}
 
-	/* Remove any leading whitespaces */
-	panel_name += strspn(panel_name, " ");
 	for (i = 0; i < supp_panels_size; i++) {
 		if (!strncmp(panel_name, supp_panels[i].name,
 			MAX_PANEL_ID_LEN)) {
diff --git a/dev/gcdb/display/rules.mk b/dev/gcdb/display/rules.mk
index 71e35f2..da81eae 100755
--- a/dev/gcdb/display/rules.mk
+++ b/dev/gcdb/display/rules.mk
@@ -4,5 +4,6 @@
 
 OBJS += \
     $(LOCAL_DIR)/gcdb_display.o \
+    $(LOCAL_DIR)/gcdb_display_param.o \
     $(LOCAL_DIR)/panel_display.o \
     $(LOCAL_DIR)/gcdb_autopll.o