add support hwc 1.1

Bug: 7124069

Change-Id: I53d705105c4ad8954d3f50ee4f4c8b7ec936b871
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
index fe928c5..f253ecc 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.h
@@ -36,6 +36,7 @@
 
 struct hwc_composer_device_1;
 struct hwc_display_contents_1;
+struct hwc_layer_1;
 struct hwc_procs;
 struct framebuffer_device_t;
 
@@ -43,6 +44,7 @@
 // ---------------------------------------------------------------------------
 
 class GraphicBuffer;
+class Fence;
 class LayerBase;
 class Region;
 class String8;
@@ -97,12 +99,18 @@
     // create a work list for numLayers layer. sets HWC_GEOMETRY_CHANGED.
     status_t createWorkList(int32_t id, size_t numLayers);
 
+    bool supportsFramebufferTarget() const;
+
     // does this display have layers handled by HWC
     bool hasHwcComposition(int32_t id) const;
 
     // does this display have layers handled by GLES
     bool hasGlesComposition(int32_t id) const;
 
+    // get the releaseFence file descriptor for the given display
+    // the release fence is only valid after commit()
+    int getAndResetReleaseFenceFd(int32_t id);
+
     // needed forward declarations
     class LayerListIterator;
 
@@ -111,7 +119,7 @@
     int getVisualID() const;
 
     // Forwarding to FB HAL for pre-HWC-1.1 code (see FramebufferSurface).
-    int fbPost(buffer_handle_t buffer);
+    int fbPost(int32_t id, const sp<Fence>& acquireFence, const sp<GraphicBuffer>& buf);
     int fbCompositionComplete();
     void fbDump(String8& result);
 
@@ -253,7 +261,6 @@
     void loadFbHalModule();
 
     LayerListIterator getLayerIterator(int32_t id, size_t index);
-    size_t getNumLayers(int32_t id) const;
 
     struct cb_context;
 
@@ -269,10 +276,15 @@
 
     void queryDisplayProperties(int disp);
 
+    status_t setFramebufferTarget(int32_t id,
+            const sp<Fence>& acquireFence, const sp<GraphicBuffer>& buf);
+
+
     struct DisplayData {
         DisplayData() : xdpi(0), ydpi(0), refresh(0),
             hasFbComp(false), hasOvComp(false),
-            capacity(0), list(NULL) { }
+            capacity(0), list(NULL),
+            framebufferTarget(NULL), fbTargetHandle(NULL) { }
         ~DisplayData() {
             free(list);
         }
@@ -286,6 +298,8 @@
         bool hasOvComp;
         size_t capacity;
         hwc_display_contents_1* list;
+        hwc_layer_1* framebufferTarget;
+        buffer_handle_t fbTargetHandle;
     };
 
     sp<SurfaceFlinger>              mFlinger;