libhwcomposer: keep window 2 open

Window 2 is used to query global info about the LCD.

Kanged from patch for aries by Greg Hackmann <ghackmann@google.com>

Change-Id: Idf754d4536337d6c06652c1d0c744dc7c0936b15
diff --git a/exynos4/hal/libhwcomposer/SecHWCUtils.cpp b/exynos4/hal/libhwcomposer/SecHWCUtils.cpp
index 6351bbf..d210dfd 100644
--- a/exynos4/hal/libhwcomposer/SecHWCUtils.cpp
+++ b/exynos4/hal/libhwcomposer/SecHWCUtils.cpp
@@ -105,6 +105,15 @@
     case 1:
         real_id = 4;
         break;
+    case 2:
+        real_id = 0;
+        break;
+    case 3:
+        real_id = 1;
+        break;
+    case 4:
+        real_id = 2;
+        break;
     default:
         SEC_HWC_Log(HWC_LOG_ERROR, "%s::id(%d) is weird", __func__, id);
         goto error;
@@ -272,16 +281,26 @@
     return 0;
 }
 
-int window_get_global_lcd_info(int fd, struct fb_var_screeninfo *lcd_info)
+int window_get_global_lcd_info(struct hwc_context_t *ctx)
 {
-    if (ioctl(fd, FBIOGET_VSCREENINFO, lcd_info) < 0) {
+    if (ioctl(ctx->global_lcd_win.fd, FBIOGET_VSCREENINFO, &ctx->lcd_info) < 0) {
         SEC_HWC_Log(HWC_LOG_ERROR, "FBIOGET_VSCREENINFO failed : %s",
                 strerror(errno));
         return -1;
     }
 
-    SEC_HWC_Log(HWC_LOG_DEBUG, "%s:: Default LCD x(%d),y(%d)",
-            __func__, lcd_info->xres, lcd_info->yres);
+    if (ctx->lcd_info.xres == 0) {
+        SEC_HWC_Log(HWC_LOG_ERROR, "ATTENTION: XRES IS 0");
+    }
+
+    if (ctx->lcd_info.yres == 0) {
+        SEC_HWC_Log(HWC_LOG_ERROR, "ATTENTION: YRES IS 0");
+    }
+
+    if (ctx->lcd_info.bits_per_pixel == 0) {
+        SEC_HWC_Log(HWC_LOG_ERROR, "ATTENTION: BPP IS 0");
+    }
+
     return 0;
 }