FastbootMenu: print lovely logo when mainline optimization is enabled

Thank you for everything, you are wonderful.

Change-Id: Id980aac9101ba7efd2cf720cc49579feb2dc3755
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/QcomModulePkg/Include/Library/DrawUI.h b/QcomModulePkg/Include/Library/DrawUI.h
index 72260dd..26d2610 100644
--- a/QcomModulePkg/Include/Library/DrawUI.h
+++ b/QcomModulePkg/Include/Library/DrawUI.h
@@ -93,6 +93,7 @@
   BGR_YELLOW,
   BGR_RED,
   BGR_GREEN,
+  BGR_GREEN_DARK,
   BGR_BLUE,
   BGR_CYAN,
   BGR_SILVER,
diff --git a/QcomModulePkg/Library/BootLib/DrawUI.c b/QcomModulePkg/Library/BootLib/DrawUI.c
index 2f1c0aa..e50b4d3 100644
--- a/QcomModulePkg/Library/BootLib/DrawUI.c
+++ b/QcomModulePkg/Library/BootLib/DrawUI.c
@@ -56,6 +56,7 @@
         [BGR_YELLOW] = {0x00, 0xff, 0xff, 0x00},
         [BGR_RED] = {0x00, 0x00, 0x98, 0x00},
         [BGR_GREEN] = {0x00, 0xff, 0x00, 0x00},
+        [BGR_GREEN_DARK] = {0x00, 0x99, 0x00, 0x00},
         [BGR_BLUE] = {0xff, 0x00, 0x00, 0x00},
         [BGR_CYAN] = {0xff, 0xff, 0x00, 0x00},
         [BGR_SILVER] = {0xc0, 0xc0, 0xc0, 0x00},
diff --git a/QcomModulePkg/Library/BootLib/FastbootMenu.c b/QcomModulePkg/Library/BootLib/FastbootMenu.c
index d6a85f9..05d5482 100644
--- a/QcomModulePkg/Library/BootLib/FastbootMenu.c
+++ b/QcomModulePkg/Library/BootLib/FastbootMenu.c
@@ -102,6 +102,7 @@
 #define FASTBOOT_MSG_INDEX_SECURE_BOOT            10
 #define FASTBOOT_MSG_INDEX_DEVICE_STATE_UNLOCKED  11
 #define FASTBOOT_MSG_INDEX_DEVICE_STATE_LOCKED    12
+#define FASTBOOT_MSG_INDEX_MAINLINE               13
 
 STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = {
     {{"\nPress volume key to select, "
@@ -196,6 +197,26 @@
      COMMON,
      0,
      NOACTION},
+    {{"\n"},
+     COMMON_FACTOR,
+     BGR_GREEN_DARK,
+     BGR_BLACK,
+     COMMON,
+     0,
+     NOACTION},
+};
+
+STATIC CONST CHAR8 MAINLINE_LOGO_PMOS[][MAX_RSP_SIZE] = {
+"         /\\\n",
+"        /  \\\n",
+"       /    \\\n",
+"       \\__   \\\n",
+"     /\\__ \\   \\\n",
+"    /   /  \\  _\\\n",
+"   /   /    \\/ __\n",
+"  /   / ______/  \\\n",
+" /    \\ \\         \\\n",
+"/_____/ /__________\\\n",
 };
 
 /**
@@ -264,6 +285,7 @@
   UINT32 OptionItem = 0;
   UINT32 Height = 0;
   UINT32 i = 0;
+  UINT32 j = 0;
   CHAR8 StrTemp[MAX_RSP_SIZE] = "";
   CHAR8 StrTemp1[MAX_RSP_SIZE] = "";
   CHAR8 VersionTemp[MAX_VERSION_LEN] = "";
@@ -374,6 +396,17 @@
       if (IsUnlocked ())
         continue;
       break;
+    case FASTBOOT_MSG_INDEX_MAINLINE:
+      /* Print random mainline logo (right now only pmOS though) */
+      if (!IsMainlineOptimizationEnabled ())
+        continue;
+
+      for (j = 0; j < ARRAY_SIZE (MAINLINE_LOGO_PMOS); j++) {
+        AsciiStrnCatS (
+            mFastbootCommonMsgInfo[i].Msg, sizeof (mFastbootCommonMsgInfo[i].Msg),
+            MAINLINE_LOGO_PMOS[j], sizeof (MAINLINE_LOGO_PMOS[j]));
+      }
+      break;
     }
 
     mFastbootCommonMsgInfo[i].Location = Location;