drm_hwcomposer: Introduce Planner interface

This patch introduces a new Planner interface to the platform specific
code. This new interface will allow for platform-specific plane provisioning
decisions to cover various hardware quirks.

Each platform must provide a Planner with one or more PlanStage steps. These
stages are run in order and are used to move the given layers onto composition
planes.

There are two generic stages provided by the platform:
- Protected: Places layers on dedicated planes
- Greedy: Provisions as many layers to planes and sticks the rest in precomp

There is also one platform-specific stage included:
- ProtectedRotated: Places any protected & rotated layer on the primary plane

BUG=b/28117135
TEST=Tested on ryu with a variety of window layouts

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: Ib6062ab4779166753afaf122450bb63126bf9161
diff --git a/Android.mk b/Android.mk
index 5ebdbee..5308225 100644
--- a/Android.mk
+++ b/Android.mk
@@ -30,6 +30,7 @@
 
 
 LOCAL_C_INCLUDES := \
+        external/drm_gralloc \
 	external/libdrm \
 	external/libdrm/include/drm \
 	system/core/include/utils \
@@ -53,17 +54,17 @@
 	drmproperty.cpp \
 	glworker.cpp \
 	hwcomposer.cpp \
+        platform.cpp \
+        platformdrmgeneric.cpp \
+        platformnv.cpp \
 	separate_rects.cpp \
 	virtualcompositorworker.cpp \
 	vsyncworker.cpp \
 	worker.cpp
 
 ifeq ($(strip $(BOARD_DRM_HWCOMPOSER_BUFFER_IMPORTER)),nvidia-gralloc)
-LOCAL_SRC_FILES += platformnv.cpp
 LOCAL_CPPFLAGS += -DUSE_NVIDIA_IMPORTER
 else
-LOCAL_C_INCLUDES += external/drm_gralloc
-LOCAL_SRC_FILES += platformdrmgeneric.cpp
 LOCAL_CPPFLAGS += -DUSE_DRM_GENERIC_IMPORTER
 endif