target: msm8953: add support to set no panel configuration

Add support to skip splash screen and set panel to none. If the
panel name is none, the probe fails for both the dsi controllers and
fb is not initialized. The feature is provided for usecases where
there is no need for display driver to be initialized. This feature
is needed for both msm8953 and apq8053 platforms.
fastboot oem select-display-panel disable

Change-Id: Ieb0e327093a267b79cfe0756a3ca3be513951f54
diff --git a/dev/gcdb/display/include/display_resource.h b/dev/gcdb/display/include/display_resource.h
index 12437aa..142f27c 100755
--- a/dev/gcdb/display/include/display_resource.h
+++ b/dev/gcdb/display/include/display_resource.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2015, 2017, 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
@@ -70,6 +70,9 @@
 #define SIM_DUALDSI_CMD_PANEL_NODE "qcom,mdss_dsi_dual_sim_cmd"
 #define SIM_DUALDSI_CMD_SLAVE_PANEL_NODE "qcom,mdss_dsi_dual_sim_cmd"
 
+#define DISABLE_PANEL_CONFIG "disable"
+#define DISABLE_PANEL_STRING "1:dsi:0:none:1:none:cfg:none"
+
 /*---------------------------------------------------------------------------*/
 /* Structure definition                                                      */
 /*---------------------------------------------------------------------------*/
diff --git a/target/msm8953/target_display.c b/target/msm8953/target_display.c
index d0cbfd9..f085161 100644
--- a/target/msm8953/target_display.c
+++ b/target/msm8953/target_display.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2017, 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
@@ -388,8 +388,23 @@
 	struct oem_panel_data oem = mdss_dsi_get_oem_data();
 	uint32_t platform_subtype = board_hardware_subtype();
 
-	/* default to hdmi for apq iot */
-	if ((platform_subtype == HW_PLATFORM_SUBTYPE_IOT)) {
+	/*
+	 * if disable config is passed irrespective of
+	 * platform type, disable DSI controllers
+	 */
+	if (!strcmp(oem.panel, DISABLE_PANEL_CONFIG)) {
+		if (buf_size < (prefix_string_len +
+			strlen(DISABLE_PANEL_STRING))) {
+			dprintf(CRITICAL, "Disable command line argument \
+				is greater than buffer size\n");
+			return false;
+		}
+		strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
+		buf_size -= prefix_string_len;
+		pbuf += prefix_string_len;
+		strlcpy(pbuf, DISABLE_PANEL_STRING, buf_size);
+	} else if (platform_subtype == HW_PLATFORM_SUBTYPE_IOT) {
+		/* default to hdmi for apq iot */
 		if (!strcmp(oem.panel, "")) {
 			if (buf_size < (prefix_string_len +
 				strlen(HDMI_ADV_PANEL_STRING))) {
@@ -454,7 +469,9 @@
 		oem.cont_splash = false;
 	}
 
-	if ((platform_subtype == HW_PLATFORM_SUBTYPE_IOT)) {
+	/* skip splash screen completely not just cont splash */
+	if ((platform_subtype == HW_PLATFORM_SUBTYPE_IOT)
+		|| !strcmp(oem.panel, DISABLE_PANEL_CONFIG)) {
 		dprintf(INFO, "%s: Platform subtype %d\n",
 			__func__, platform_subtype);
 		return;