hwc/overlay/hdmi: Fix / enable some error messages.

Fix cases where some errors are really warnings/info.
Print one-time events like HDMI connect disconnect as info logs.
Print the error string and type on MSMFB_OVERLAY_PREPARE failure.

An ENODEV from driver corresponds to a pipe not available and should
be treated as a warning. This could happen if a previous UNSET is
pending due to a missed vsync. ENODEV should be treated as fatal
only if it is seen continuously representing a book-keeping
blunder.

Change-Id: I730d4ac7db84c287f47805b9c74792c90cfadc6c
diff --git a/liboverlay/overlayMdp.cpp b/liboverlay/overlayMdp.cpp
index 3932c4c..1290f32 100644
--- a/liboverlay/overlayMdp.cpp
+++ b/liboverlay/overlayMdp.cpp
@@ -374,8 +374,21 @@
     if(errVal) {
         /* No dump for failure due to insufficient resource */
         if(errVal != E2BIG) {
-            mdp_wrapper::dump("Bad ov dump: ",
-                *list.overlay_list[list.processed_overlays]);
+            //ENODEV is returned when the driver cannot satisfy a pipe request.
+            //This could happen if previous round's UNSET hasn't been commited
+            //yet, either because of a missed vsync or because of difference in
+            //vsyncs of primary and external. This is expected during
+            //transition scenarios, but should be considered fatal if seen
+            //continuously.
+            if(errVal == ENODEV) {
+                ALOGW("%s: Pipe unavailable. Likely previous UNSET pending. "
+                    "Fatal if seen continuously.", __FUNCTION__);
+            } else {
+                ALOGE("%s failed, error %d: %s", __FUNCTION__, errVal,
+                        strerror(errVal));
+                mdp_wrapper::dump("Bad ov dump: ",
+                        *list.overlay_list[list.processed_overlays]);
+            }
         }
         return false;
     }