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/platformdrmgeneric.cpp b/platformdrmgeneric.cpp
index 099a5d9..90ba0e2 100644
--- a/platformdrmgeneric.cpp
+++ b/platformdrmgeneric.cpp
@@ -134,4 +134,12 @@
   }
   return 0;
 }
+
+#ifdef USE_DRM_GENERIC_IMPORTER
+std::unique_ptr<Planner> Planner::CreateInstance(DrmResources *) {
+  std::unique_ptr<Planner> planner(new Planner);
+  planner->AddStage<PlanStageGreedy>();
+  return planner;
+}
+#endif
 }