hwc: Derive view frame for external display.

Derive viewframe rectangle for external display from primary
resolution and primary device orientation.

Change-Id: I1885b660cd6343e41e4b574e358fd063cd47a54d
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index e64f89c..2b889f5 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -200,6 +200,11 @@
 // -----------------------------------------------------------------------------
 // Utility functions - implemented in hwc_utils.cpp
 void dumpLayer(hwc_layer_1_t const* l);
+
+// Calculate viewframe for external/primary display from primary resolution and
+// primary device orientation
+hwc_rect_t calculateDisplayViewFrame(hwc_context_t *ctx, int dpy);
+
 void setListStats(hwc_context_t *ctx, hwc_display_contents_1_t *list,
         int dpy);
 void initContext(hwc_context_t *ctx);