drm_hwcomposer: Remove GL compositing support

The GL based compositing adds alot of complexity and was only ever well
tested on closed stacks. It also only supports GLES3.x and still relies
on sw_sync timeline which is now a debugfs feature. Those are just the
known issues.

Removing the GL compositor means everything related to squashing layers
and pre-compositing can be removed. The planner is left as it may be
useful when adding back support for overlay planes. With this change,
only a single plane is supported until ValidateDisplay learns to do
atomic modesetting test for overlay planes.

Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
diff --git a/platform.h b/platform.h
index e417bf7..068499e 100644
--- a/platform.h
+++ b/platform.h
@@ -38,10 +38,6 @@
   // Creates a platform-specific importer instance
   static Importer *CreateInstance(DrmResources *drm);
 
-  // Imports EGLImage for glcompositor, since NV handles this in non-standard
-  // way, and fishing out the details is specific to the gralloc used.
-  virtual EGLImageKHR ImportImage(EGLDisplay egl_display, buffer_handle_t handle) = 0;
-
   // Imports the buffer referred to by handle into bo.
   //
   // Note: This can be called from a different thread than ReleaseBuffer. The
@@ -77,17 +73,7 @@
       return plane;
     }
 
-    // Finds and returns the squash layer from the composition
-    static DrmCompositionPlane *GetPrecomp(
-        std::vector<DrmCompositionPlane> *composition) {
-      auto l = GetPrecompIter(composition);
-      if (l == composition->end())
-        return NULL;
-      return &(*l);
-    }
-
-    // Inserts the given layer:plane in the composition right before the precomp
-    // layer
+    // Inserts the given layer:plane in the composition at the back
     static int Emplace(std::vector<DrmCompositionPlane> *composition,
                        std::vector<DrmPlane *> *planes,
                        DrmCompositionPlane::Type type, DrmCrtc *crtc,
@@ -96,41 +82,26 @@
       if (!plane)
         return -ENOENT;
 
-      auto precomp = GetPrecompIter(composition);
-      composition->emplace(precomp, type, plane, crtc, source_layer);
+      composition->emplace_back(type, plane, crtc, source_layer);
       return 0;
     }
-
-   private:
-    static std::vector<DrmCompositionPlane>::iterator GetPrecompIter(
-        std::vector<DrmCompositionPlane> *composition) {
-      return std::find_if(composition->begin(), composition->end(),
-                          [](const DrmCompositionPlane &p) {
-        return p.type() == DrmCompositionPlane::Type::kPrecomp;
-      });
-    }
   };
 
   // Creates a planner instance with platform-specific planning stages
   static std::unique_ptr<Planner> CreateInstance(DrmResources *drm);
 
   // Takes a stack of layers and provisions hardware planes for them. If the
-  // entire stack can't fit in hardware, the Planner may place the remaining
-  // layers in a PRECOMP plane. Layers in the PRECOMP plane will be composited
-  // using GL. PRECOMP planes should be placed above any 1:1 layer:plane
-  // compositions. If use_squash_fb is true, the Planner should try to reserve a
-  // plane at the highest z-order with type SQUASH.
+  // entire stack can't fit in hardware, FIXME
   //
   // @layers: a map of index:layer of layers to composite
-  // @use_squash_fb: reserve a squash framebuffer
   // @primary_planes: a vector of primary planes available for this frame
   // @overlay_planes: a vector of overlay planes available for this frame
   //
   // Returns: A tuple with the status of the operation (0 for success) and
   //          a vector of the resulting plan (ie: layer->plane mapping).
   std::tuple<int, std::vector<DrmCompositionPlane>> ProvisionPlanes(
-      std::map<size_t, DrmHwcLayer *> &layers, bool use_squash_fb,
-      DrmCrtc *crtc, std::vector<DrmPlane *> *primary_planes,
+      std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc *crtc,
+      std::vector<DrmPlane *> *primary_planes,
       std::vector<DrmPlane *> *overlay_planes);
 
   template <typename T, typename... A>
@@ -156,18 +127,6 @@
                       std::vector<DrmPlane *> *planes);
 };
 
-// This plan stage provisions the precomp plane with any remaining layers that
-// are on top of the current precomp layers. This stage should be included in
-// all platforms before loosely allocating layers (i.e. PlanStageGreedy) if
-// any previous plan could have modified the precomp plane layers
-// (ex. PlanStageProtected).
-class PlanStagePrecomp : public Planner::PlanStage {
- public:
-  int ProvisionPlanes(std::vector<DrmCompositionPlane> *composition,
-                      std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc *crtc,
-                      std::vector<DrmPlane *> *planes);
-};
-
 // This plan stage places as many layers on dedicated planes as possible (first
 // come first serve), and then sticks the rest in a precomposition plane (if
 // needed).