Merge "platform: msm_shared: Fix cache flush issues"
diff --git a/dev/gcdb/display/gcdb_display.c b/dev/gcdb/display/gcdb_display.c
index dfb6484..753d0ed 100644
--- a/dev/gcdb/display/gcdb_display.c
+++ b/dev/gcdb/display/gcdb_display.c
@@ -478,14 +478,9 @@
 			~USE_DSI1_PLL_FLAG;
 }
 
-int gcdb_display_init(const char *panel_name, uint32_t rev, void *base)
+static int update_dsi_display_config()
 {
 	int ret = NO_ERROR;
-	int pan_type;
-
-	dsi_video_mode_phy_db.pll_type = DSI_PLL_TYPE_28NM;
-	pan_type = oem_panel_select(panel_name, &panelstruct, &(panel.panel_info),
-				 &dsi_video_mode_phy_db);
 
 	if ((panel.panel_info.lm_split[0] > 0) &&
 	    (panel.panel_info.lm_split[1] > 0))
@@ -508,10 +503,23 @@
 	    (panelstruct.paneldata->panel_operating_mode & DST_SPLIT_FLAG)) {
 		dprintf(CRITICAL, "DUAL_PIPE_FLAG and DST_SPLIT_FLAG cannot be selected togather\n");
 		ret = ERROR;
-		goto error_gcdb_display_init;
 	}
 
+	return ret;
+}
+
+int gcdb_display_init(const char *panel_name, uint32_t rev, void *base)
+{
+	int ret = NO_ERROR;
+	int pan_type;
+
+	dsi_video_mode_phy_db.pll_type = DSI_PLL_TYPE_28NM;
+	pan_type = oem_panel_select(panel_name, &panelstruct, &(panel.panel_info),
+				 &dsi_video_mode_phy_db);
+
 	if (pan_type == PANEL_TYPE_DSI) {
+		if (update_dsi_display_config())
+			goto error_gcdb_display_init;
 		target_dsi_phy_config(&dsi_video_mode_phy_db);
 		mdss_dsi_check_swap_status();
 		mdss_dsi_set_pll_src();
@@ -556,7 +564,6 @@
 		dprintf(CRITICAL, "Target panel init not found!\n");
 		ret = ERR_NOT_SUPPORTED;
 		goto error_gcdb_display_init;
-
 	}
 
 	panel.fb.base = base;
diff --git a/dev/gcdb/display/include/panel_r69007_wqxga_cmd.h b/dev/gcdb/display/include/panel_r69007_wqxga_cmd.h
index ab68848..70a5225 100644
--- a/dev/gcdb/display/include/panel_r69007_wqxga_cmd.h
+++ b/dev/gcdb/display/include/panel_r69007_wqxga_cmd.h
@@ -378,4 +378,6 @@
 	1, 1, 4095, 100, 1, "PMIC_8941"
 };
 
+#define R69007_WQXGA_CMD_PANEL_ON_DELAY 60
+
 #endif /*_PANEL_R69007_WQXGA_CMD_H_*/
diff --git a/include/stdlib.h b/include/stdlib.h
index 4db77fa..22dcf4c 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2008 Travis Geiselbrecht
  *
- * Copyright (c) 2013, 2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013, 2014-2015 The Linux Foundation. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files
@@ -51,7 +51,7 @@
 
 /* allocate a buffer on the stack aligned and padded to the cpu's cache line size */
 #define STACKBUF_DMA_ALIGN(var, size) \
-	uint8_t __##var[(size) + CACHE_LINE]; uint8_t *var = (uint8_t *)(ROUNDUP((addr_t)__##var, CACHE_LINE))
+	uint8_t __##var[(size) + CACHE_LINE] __attribute__((aligned(CACHE_LINE))); uint8_t *var = (uint8_t *)(ROUNDUP((addr_t)__##var, CACHE_LINE))
 
 /* Macro to allocate buffer in both local & global space, the STACKBUF_DMA_ALIGN cannot
  * be used for global space.
diff --git a/target/msm8996/oem_panel.c b/target/msm8996/oem_panel.c
index 8e98d95..b1fc1a1 100644
--- a/target/msm8996/oem_panel.c
+++ b/target/msm8996/oem_panel.c
@@ -101,8 +101,11 @@
 	if (panel_id == JDI_QHD_DUALDSI_CMD_PANEL) {
 		/* needs extra delay to avoid unexpected artifacts */
 		mdelay(JDI_QHD_DUALDSI_CMD_PANEL_ON_DELAY);
-
+	} else if (panel_id == R69007_WQXGA_CMD_PANEL) {
+		/* needs extra delay to avoid unexpected artifacts */
+		mdelay(R69007_WQXGA_CMD_PANEL_ON_DELAY);
 	}
+
 	return NO_ERROR;
 }