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/target/msm8974/oem_panel.c b/target/msm8974/oem_panel.c
index 45b00d9..8544a24 100755
--- a/target/msm8974/oem_panel.c
+++ b/target/msm8974/oem_panel.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+/* 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
@@ -293,13 +293,13 @@
 
 		if (panel_override_id < 0) {
 			dprintf(CRITICAL, "Not able to search the panel:%s\n",
-					 panel_name + strspn(panel_name, " "));
+					 panel_name);
 		} else if (panel_override_id < UNKNOWN_PANEL) {
 			/* panel override using fastboot oem command */
 			panel_id = panel_override_id;
 
 			dprintf(INFO, "OEM panel override:%s\n",
-					panel_name + strspn(panel_name, " "));
+					panel_name);
 			goto panel_init;
 		}
 	}
diff --git a/target/msm8974/target_display.c b/target/msm8974/target_display.c
index eae18f0..adacf1d 100755
--- a/target/msm8974/target_display.c
+++ b/target/msm8974/target_display.c
@@ -392,14 +392,13 @@
 	return 0;
 }
 
-bool target_display_panel_node(char *panel_name, char *pbuf, uint16_t buf_size)
+bool target_display_panel_node(char *pbuf, uint16_t buf_size)
 {
 	int prefix_string_len = strlen(DISPLAY_CMDLINE_PREFIX);
 	bool ret = true;
+	struct oem_panel_data oem = mdss_dsi_get_oem_data();
 
-	panel_name += strspn(panel_name, " ");
-
-	if (!strcmp(panel_name, HDMI_PANEL_NAME)) {
+	if (!strcmp(oem.panel, HDMI_PANEL_NAME)) {
 		if (buf_size < (prefix_string_len + LK_OVERRIDE_PANEL_LEN +
 				strlen(HDMI_CONTROLLER_STRING))) {
 			dprintf(CRITICAL, "command line argument is greater than buffer size\n");
@@ -412,7 +411,7 @@
 		buf_size -= LK_OVERRIDE_PANEL_LEN;
 		strlcat(pbuf, HDMI_CONTROLLER_STRING, buf_size);
 	} else {
-		ret = gcdb_display_cmdline_arg(panel_name, pbuf, buf_size);
+		ret = gcdb_display_cmdline_arg(pbuf, buf_size);
 	}
 
 	return ret;
@@ -423,23 +422,24 @@
 	uint32_t hw_id = board_hardware_id();
 	uint32_t panel_loop = 0;
 	int ret = 0;
-	char cont_splash = '\0';
+	struct oem_panel_data oem;
 
 	if (target_hw_interposer())
 		return;
 
-	set_panel_cmd_string(panel_name, &cont_splash);
-	panel_name += strspn(panel_name, " ");
+	set_panel_cmd_string(panel_name);
+	oem = mdss_dsi_get_oem_data();
 
-	if (!strcmp(panel_name, NO_PANEL_CONFIG)
-		|| !strcmp(panel_name, SIM_VIDEO_PANEL)
-		|| !strcmp(panel_name, SIM_DUALDSI_VIDEO_PANEL)
-		|| !strcmp(panel_name, SIM_CMD_PANEL)
-		|| !strcmp(panel_name, SIM_DUALDSI_CMD_PANEL)) {
+	if (!strcmp(oem.panel, NO_PANEL_CONFIG)
+		|| !strcmp(oem.panel, SIM_VIDEO_PANEL)
+		|| !strcmp(oem.panel, SIM_DUALDSI_VIDEO_PANEL)
+		|| !strcmp(oem.panel, SIM_CMD_PANEL)
+		|| !strcmp(oem.panel, SIM_DUALDSI_CMD_PANEL)
+		|| oem.skip) {
 		dprintf(INFO, "Selected panel: %s\nSkip panel configuration\n",
-			panel_name);
+			oem.panel);
 		return;
-	} else if (!strcmp(panel_name, HDMI_PANEL_NAME)) {
+	} else if (!strcmp(oem.panel, HDMI_PANEL_NAME)) {
 		dprintf(INFO, "%s: HDMI is primary\n", __func__);
 		return;
 	}
@@ -463,7 +463,7 @@
 	default:
 		do {
 			target_force_cont_splash_disable(false);
-			ret = gcdb_display_init(panel_name, MDP_REV_50,
+			ret = gcdb_display_init(oem.panel, MDP_REV_50,
 				(void *)MIPI_FB_ADDR);
 			if (!ret || ret == ERR_NOT_SUPPORTED) {
 				break;
@@ -475,7 +475,7 @@
 		break;
 	}
 
-	if (cont_splash == '0') {
+	if (!oem.cont_splash) {
 		dprintf(INFO, "Forcing continuous splash disable\n");
 		target_force_cont_splash_disable(true);
 	}