display driver porting in LK

Root cause:

How to fix:

Feature:
Issue:
Depends-On:

Change-Id: I5f174937eeb647c86f4a309f3cac917c43853308
RiskArea:
diff --git a/platform/msm_shared/display.c b/platform/msm_shared/display.c
old mode 100644
new mode 100755
index 780ecfc..56a58c8
--- a/platform/msm_shared/display.c
+++ b/platform/msm_shared/display.c
@@ -39,6 +39,10 @@
 #ifdef DISPLAY_TYPE_MDSS
 #include <target/display.h>
 #endif
+//[Arima][8901][JialongJhan]Set Fastboot logo delay function 20190627 Start
+#include <platform/timer.h>
+extern bool boot_into_fastboot;
+//[Arima][8901][JialongJhan]Set Fastboot logo delay function 20190627 Start
 
 static struct msm_fb_panel_data *panel;
 
@@ -284,6 +288,29 @@
 	return ret;
 }
 
+//[Arima][8901][JialongJhan] Command mode update screen 20190516 Start
+int msm_display_flush()
+{
+	int ret = NO_ERROR;
+	struct msm_panel_info *pinfo;
+
+	if (!panel)
+		return ERR_INVALID_ARGS;
+
+	pinfo = &(panel->panel_info);
+	if (!pinfo)
+		return ERR_INVALID_ARGS;
+
+	switch (pinfo->type) {
+		case MIPI_CMD_PANEL:
+
+			ret = mdp_dma_on(pinfo);
+			break;
+	}
+	return ret;
+}
+//[Arima][8901][JialongJhan] Command mode update screen 20190516 End
+
 int msm_display_init(struct msm_fb_panel_data *pdata)
 {
 	int ret = NO_ERROR;
@@ -348,7 +375,16 @@
 		goto msm_display_init_out;
 
 	fbcon_setup(&(panel->fb));
-	display_image_on_screen();
+    //[Arima][8901][JialongJhan]Shown logo/fastboot logo based on condition 20190627 Start
+
+    if(boot_into_fastboot){
+        mdelay(1100);// avoid fuzzy screen.
+        //display_fastboot_image_on_screen();
+        }
+    else{
+        display_image_on_screen();
+    }
+    //[Arima][8901][JialongJhan]Shown logo/fastboot logo based on condition 20190627 End
 
 	if ((panel->dsi2HDMI_config) && (panel->panel_info.has_bridge_chip))
 		ret = panel->dsi2HDMI_config(&(panel->panel_info));
diff --git a/platform/msm_shared/display_menu.c b/platform/msm_shared/display_menu.c
old mode 100644
new mode 100755
index 9d85e9f..52d7c1e
--- a/platform/msm_shared/display_menu.c
+++ b/platform/msm_shared/display_menu.c
@@ -45,6 +45,9 @@
 
 #define TITLE_MSG "<!>\n\n"
 
+//[Arima][8901][JialongJhan] Command mode update screen 20190516 Start
+extern int msm_display_flush();
+//[Arima][8901][JialongJhan] Command mode update screen 20190516 End
 static const char *unlock_menu_common_msg = "By unlocking the bootloader, you will be able to install "\
 				"custom operating system on this phone. "\
 				"A custom OS is not subject to the same level of testing "\
@@ -160,6 +163,9 @@
 	is_thread_start = false;
 	fbcon_clear();
 	display_image_on_screen();
+    //[Arima][8901][JialongJhan] Command mode update screen 20190618 Start 
+    msm_display_flush();
+    //[Arima][8901][JialongJhan] Command mode update screen 20190618 End 
 }
 
 void wait_for_users_action()
@@ -568,6 +574,9 @@
 		unlock_menu_msg_info->info.msg_type;
 
 	display_unlock_menu_renew(unlock_menu_msg_info, type, status);
+    //[Arima][8901][JialongJhan] Command mode update screen 20190618 Start 
+    msm_display_flush();
+    //[Arima][8901][JialongJhan] Command mode update screen 20190618 End
 	mutex_release(&unlock_menu_msg_info->msg_lock);
 
 	dprintf(INFO, "creating %s keys detect thread\n",
@@ -598,6 +607,9 @@
 		fastboot_menu_msg_info->info.msg_type;
 
 	display_fastboot_menu_renew(fastboot_menu_msg_info);
+    //[Arima][8901][JialongJhan] Command mode update screen 20190618 Start
+    msm_display_flush();
+    //[Arima][8901][JialongJhan] Command mode update screen 20190618 End
 	mutex_release(&fastboot_menu_msg_info->msg_lock);
 
 	dprintf(INFO, "creating fastboot menu keys detect thread\n");
@@ -623,6 +635,9 @@
 		bootverify_menu_msg_info->info.msg_type;
 
 	display_bootverify_menu_renew(bootverify_menu_msg_info, type);
+    //[Arima][8901][JialongJhan] Command mode update screen 201906118 Start
+    msm_display_flush();
+    //[Arima][8901][JialongJhan] Command mode update screen 20190618 End
 	mutex_release(&bootverify_menu_msg_info->msg_lock);
 
 	dprintf(INFO, "creating boot verify keys detect thread\n");
diff --git a/platform/msm_shared/menu_keys_detect.c b/platform/msm_shared/menu_keys_detect.c
old mode 100644
new mode 100755
index d7a2beb..8c7cdf9
--- a/platform/msm_shared/menu_keys_detect.c
+++ b/platform/msm_shared/menu_keys_detect.c
@@ -59,6 +59,9 @@
 
 typedef uint32_t (*keys_detect_func)(void);
 typedef void (*keys_action_func)(struct select_msg_info* msg_info);
+//[Arima][8901][JialongJhan] Command mode update screen 20190618 Start
+extern int msm_display_flush();
+//[Arima][8901][JialongJhan] Command mode update screen 20190618 End
 
 struct keys_stru {
 	int type;
@@ -386,14 +389,23 @@
 		if (is_key_pressed(VOLUME_UP)) {
 			mutex_acquire(&msg_info->msg_lock);
 			menu_pages_action[msg_info->info.msg_type].up_action_func(msg_info);
+            //[Arima][8901][JialongJhan] Command mode update screen 20190618 Start
+            msm_display_flush();
+            //[Arima][8901][JialongJhan] Command mode update screen 20190618 End
 			mutex_release(&msg_info->msg_lock);
 		} else if (is_key_pressed(VOLUME_DOWN)) {
 			mutex_acquire(&msg_info->msg_lock);
 			menu_pages_action[msg_info->info.msg_type].down_action_func(msg_info);
+            //[Arima][8901][JialongJhan] Command mode update screen 20190618 Start
+            msm_display_flush();
+            //[Arima][8901][JialongJhan] Command mode update screen 20190618 End
 			mutex_release(&msg_info->msg_lock);
 		} else if (is_key_pressed(POWER_KEY)) {
 			mutex_acquire(&msg_info->msg_lock);
 			menu_pages_action[msg_info->info.msg_type].enter_action_func(msg_info);
+            //[Arima][8901][JialongJhan] Command mode update screen 20190618 Start
+            msm_display_flush();
+            //[Arima][8901][JialongJhan] Command mode update screen 20190618 End
 			mutex_release(&msg_info->msg_lock);
 		}