Merge "overlay: writeback: Do not create writeback instance on dumpsys" into klp-dev
diff --git a/msm8974/libhwcomposer/hwc.cpp b/msm8974/libhwcomposer/hwc.cpp
index 3a4e552..b26c32a 100644
--- a/msm8974/libhwcomposer/hwc.cpp
+++ b/msm8974/libhwcomposer/hwc.cpp
@@ -213,7 +213,7 @@
     hwc_context_t* ctx = (hwc_context_t*)(dev);
     const int dpy = HWC_DISPLAY_VIRTUAL;
 
-    if (list && list->numHwLayers > 1) {
+    if (list && list->outbuf && list->numHwLayers > 1) {
         reset_layer_prop(ctx, dpy, list->numHwLayers - 1);
         uint32_t last = list->numHwLayers - 1;
         hwc_layer_1_t *fbLayer = &list->hwLayers[last];
@@ -228,7 +228,8 @@
         }
 
         ctx->dpyAttr[dpy].fd = Writeback::getInstance()->getFbFd();
-        Writeback::getInstance()->configureDpyInfo(fbWidth, fbHeight);
+        private_handle_t *ohnd = (private_handle_t *)list->outbuf;
+        Writeback::getInstance()->configureDpyInfo(ohnd->width, ohnd->height);
         setListStats(ctx, list, dpy);
 
         if(ctx->mMDPComp[dpy]->prepare(ctx, list) < 0) {