hwc: do not require hdmi

Change-Id: I456d9ef6ea416a14b52b9e5548e9b469a2167696
Signed-off-by: Dima Zavin <dima@android.com>
diff --git a/libhwc/hwc.cpp b/libhwc/hwc.cpp
index a50a448..22ba8da 100644
--- a/libhwc/hwc.cpp
+++ b/libhwc/hwc.cpp
@@ -565,6 +565,10 @@
 
 static int hdmi_enable(struct exynos5_hwc_composer_device_1_t *dev)
 {
+    /* hdmi not supported */
+    if (dev->hdmi_mixer0 < 0)
+        return 0;
+
     if (dev->hdmi_enabled)
         return 0;
 
@@ -2086,11 +2090,8 @@
             dev->gsc[i].dst_buf_fence[j] = -1;
 
     dev->hdmi_mixer0 = open("/dev/v4l-subdev7", O_RDWR);
-    if (dev->hdmi_mixer0 < 0) {
+    if (dev->hdmi_mixer0 < 0)
         ALOGE("failed to open hdmi mixer0 subdev");
-        ret = dev->hdmi_mixer0;
-        goto err_ioctl;
-    }
 
     dev->hdmi_layers[0].id = 0;
     dev->hdmi_layers[0].fd = open("/dev/video16", O_RDWR);
@@ -2160,7 +2161,8 @@
 err_vsync:
     close(dev->vsync_fd);
 err_mixer0:
-    close(dev->hdmi_mixer0);
+    if (dev->hdmi_mixer0 >= 0)
+        close(dev->hdmi_mixer0);
 err_hdmi1:
     close(dev->hdmi_layers[0].fd);
 err_hdmi0:
@@ -2184,7 +2186,8 @@
         exynos5_cleanup_gsc_m2m(dev, i);
     gralloc_close(dev->alloc_device);
     close(dev->vsync_fd);
-    close(dev->hdmi_mixer0);
+    if (dev->hdmi_mixer0 >= 0)
+        close(dev->hdmi_mixer0);
     close(dev->hdmi_layers[0].fd);
     close(dev->hdmi_layers[1].fd);
     close(dev->fd);