get rid of the shared-memory control block

Change-Id: If814060aca1d2ff2619d4adcd57296983d207f7f
diff --git a/services/surfaceflinger/DisplayHardware.cpp b/services/surfaceflinger/DisplayHardware.cpp
index 067a54f..4b5d8ab 100644
--- a/services/surfaceflinger/DisplayHardware.cpp
+++ b/services/surfaceflinger/DisplayHardware.cpp
@@ -24,6 +24,7 @@
 #include <utils/RefBase.h>
 #include <utils/Log.h>
 
+#include <ui/DisplayInfo.h>
 #include <ui/PixelFormat.h>
 
 #include <GLES/gl.h>
@@ -31,7 +32,6 @@
 #include <EGL/eglext.h>
 
 #include <hardware/gralloc.h>
-#include <private/gui/SharedBufferStack.h>
 
 #include "DisplayHardware/FramebufferSurface.h"
 #include "DisplayHardware/DisplayHardwareBase.h"
@@ -148,6 +148,19 @@
     return mSurface;
 }
 
+status_t DisplayHardware::getInfo(DisplayInfo* info) const {
+    info->w = getWidth();
+    info->h = getHeight();
+    info->xdpi = getDpiX();
+    info->ydpi = getDpiY();
+    info->fps = getRefreshRate();
+    info->density = getDensity();
+    info->orientation = getOrientation();
+    // TODO: this needs to go away (currently needed only by webkit)
+    getPixelFormatInfo(getFormat(), &info->pixelFormatInfo);
+    return NO_ERROR;
+}
+
 void DisplayHardware::init(EGLConfig config)
 {
     ANativeWindow* const window = mNativeWindow.get();
@@ -226,17 +239,6 @@
     mFormat  = format;
     mPageFlipCount = 0;
 
-    // initialize the shared control block
-    surface_flinger_cblk_t* const scblk = mFlinger->getControlBlock();
-    scblk->connected |= 1 << mDisplayId;
-    display_cblk_t* dcblk = &scblk->displays[mDisplayId];
-    memset(dcblk, 0, sizeof(display_cblk_t));
-    dcblk->format = format;
-    dcblk->xdpi = mDpiX;
-    dcblk->ydpi = mDpiY;
-    dcblk->fps = mRefreshRate;
-    dcblk->density = mDensity;
-
     // initialize the display orientation transform.
     DisplayHardware::setOrientation(ISurfaceComposer::eOrientationDefault);
 }
@@ -365,13 +367,5 @@
         h = tmp;
     }
     mOrientation = orientation;
-
-    // update the shared control block
-    surface_flinger_cblk_t* const scblk = mFlinger->getControlBlock();
-    volatile display_cblk_t* dcblk = &scblk->displays[mDisplayId];
-    dcblk->orientation = orientation;
-    dcblk->w = w;
-    dcblk->h = h;
-
     return NO_ERROR;
 }