hwc: Fix booting with hdmi attached
authorBenoit Goby <benoit@android.com>
Fri, 31 Aug 2012 00:42:41 +0000 (17:42 -0700)
committerBenoit Goby <benoit@android.com>
Wed, 5 Sep 2012 00:50:56 +0000 (17:50 -0700)
Change-Id: Ie487ac413ec77b7a17c943ae51f854b0c67365e7

libhwc/hwc.cpp

index d860be840d5ff20ff1266e2305aead81824f0f67..10a545cc7ee07ff346b6665a114406680658046d 100644 (file)
@@ -1605,8 +1605,13 @@ static int exynos5_open(const struct hw_module_t *module, const char *name,
     sw_fd = open("/sys/class/switch/hdmi/state", O_RDONLY);
     if (sw_fd) {
         char val;
-        if (read(sw_fd, &val, 1) == 1 && val == '1')
+        if (read(sw_fd, &val, 1) == 1 && val == '1') {
             dev->hdmi_hpd = true;
+            if (hdmi_get_config(dev)) {
+                ALOGE("Error reading HDMI configuration");
+                dev->hdmi_hpd = false;
+            }
+        }
     }
 
     dev->base.common.tag = HARDWARE_DEVICE_TAG;