target: support HDMI as primary display interface

Support HDMI as primary interface on APQ8084/MSM8974 for
debugging, testing and other purposes. Do not initialize
other interfaces when HDMI is selected as primary interface.

Use below commands to make hdmi as primary, the settings are
persistent across power cycles:

* Reboot the device into fastboot mode
* fastboot oem select-display-panel hdmi
* fastboot reboot-bootloader
* Reboot device

Change-Id: Iefe53528c3a2be82b6e43184549e4530b9c2570a
diff --git a/target/msm8974/include/target/display.h b/target/msm8974/include/target/display.h
index dd9f9c0..db177d0 100644
--- a/target/msm8974/include/target/display.h
+++ b/target/msm8974/include/target/display.h
@@ -106,6 +106,9 @@
 
 #define PWM_BL_LPG_CHAN_ID           8
 
+#define HDMI_PANEL_NAME              "hdmi"
+#define HDMI_CONTROLLER_STRING       "hdmi:0"
+
 extern int mdss_dsi_phy_init(struct mipi_dsi_panel_config *, uint32_t ctl_base);
 
 #endif
diff --git a/target/msm8974/target_display.c b/target/msm8974/target_display.c
index b8dc850..7950979 100755
--- a/target/msm8974/target_display.c
+++ b/target/msm8974/target_display.c
@@ -366,11 +366,45 @@
 	return 0;
 }
 
+bool target_display_panel_node(char *panel_name, char *pbuf, uint16_t buf_size)
+{
+	int prefix_string_len = strlen(DISPLAY_CMDLINE_PREFIX);
+	bool ret = true;
+
+	panel_name += strspn(panel_name, " ");
+
+	if (!strcmp(panel_name, HDMI_PANEL_NAME)) {
+		if (buf_size < (prefix_string_len + LK_OVERRIDE_PANEL_LEN +
+				HDMI_CONTROLLER_STRING)) {
+			dprintf(CRITICAL, "command line argument is greater than buffer size\n");
+			return false;
+		}
+
+		strlcpy(pbuf, DISPLAY_CMDLINE_PREFIX, buf_size);
+		buf_size -= prefix_string_len;
+		strlcat(pbuf, LK_OVERRIDE_PANEL, buf_size);
+		buf_size -= LK_OVERRIDE_PANEL_LEN;
+		strlcat(pbuf, HDMI_CONTROLLER_STRING, buf_size);
+	} else {
+		ret = gcdb_display_cmdline_arg(pbuf, buf_size);
+	}
+
+	return ret;
+}
+
 void target_display_init(const char *panel_name)
 {
 	uint32_t hw_id = board_hardware_id();
 	uint32_t panel_loop = 0;
 	uint32_t ret = 0;
+
+	panel_name += strspn(panel_name, " ");
+
+	if (!strcmp(panel_name, HDMI_PANEL_NAME)) {
+		dprintf(INFO, "%s: HDMI is primary\n", __func__);
+		return;
+	}
+
 	switch (hw_id) {
 	case HW_PLATFORM_LIQUID:
 		edp_panel_init(&(panel.panel_info));