Merge "hwc: Add support for clearing with c2d"
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp
index 0335f5e..d95b376 100644
--- a/libgralloc/framebuffer.cpp
+++ b/libgralloc/framebuffer.cpp
@@ -87,8 +87,8 @@
     private_module_t* m =
         reinterpret_cast<private_module_t*>(dev->common.module);
     struct mdp_display_commit prim_commit;
-    prim_commit.wait_for_finish = 1;
     memset(&prim_commit, 0, sizeof(struct mdp_display_commit));
+    prim_commit.wait_for_finish = 1;
     if (ioctl(m->framebuffer->fd, MSMFB_DISPLAY_COMMIT, &prim_commit) == -1) {
         ALOGE("%s: MSMFB_DISPLAY_COMMIT for primary failed, str: %s",
                 __FUNCTION__, strerror(errno));
diff --git a/libhwcomposer/hwc_qclient.cpp b/libhwcomposer/hwc_qclient.cpp
index c130208..edf579f 100644
--- a/libhwcomposer/hwc_qclient.cpp
+++ b/libhwcomposer/hwc_qclient.cpp
@@ -42,11 +42,7 @@
 QClient::QClient(hwc_context_t *ctx) : mHwcContext(ctx),
         mMPDeathNotifier(new MPDeathNotifier(ctx))
 {
-
     ALOGD_IF(QCLIENT_DEBUG, "QClient Constructor invoked");
-    //The only way to make this class in this process subscribe to media
-    //player's death.
-    IMediaDeathNotifier::getMediaPlayerService();
 }
 
 QClient::~QClient()
@@ -72,6 +68,10 @@
 }
 
 void QClient::securing(uint32_t startEnd) {
+    //The only way to make this class in this process subscribe to media
+    //player's death.
+    IMediaDeathNotifier::getMediaPlayerService();
+
     mHwcContext->mSecuring = startEnd;
     //We're done securing
     if(startEnd == IQService::END)
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 3a85d47..013833f 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -19,6 +19,7 @@
  */
 #define HWC_UTILS_DEBUG 0
 #include <sys/ioctl.h>
+#include <linux/fb.h>
 #include <binder/IServiceManager.h>
 #include <EGL/egl.h>
 #include <cutils/properties.h>
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 7221c13..e4431d0 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -29,7 +29,6 @@
 #include <utils/String8.h>
 #include "qdMetaData.h"
 #include <overlayUtils.h>
-#include <linux/fb.h>
 
 #define ALIGN_TO(x, align)     (((x) + ((align)-1)) & ~((align)-1))
 #define LIKELY( exp )       (__builtin_expect( (exp) != 0, true  ))